-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
103 lines (91 loc) · 3.58 KB
/
Copy pathpyproject.toml
File metadata and controls
103 lines (91 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "harmonie"
# Version is derived from git via setuptools-scm — see [tool.setuptools_scm]
# below. Tagged commits get the tag's version (e.g. ``v1.0.0`` → ``1.0.0``);
# untagged commits get a unique ``MAJOR.MINOR.PATCH.devN+gHASH`` string so
# ``pipx upgrade harmonie`` actually upgrades.
dynamic = ["version"]
description = "Audio similarity service. Scans music libraries, extracts Essentia embeddings + descriptors, exposes an HTTP API for similarity queries and playlist generation."
readme = "README.md"
requires-python = ">=3.9,<3.13"
dependencies = [
"numpy>=1.23",
"essentia-tensorflow",
"fastapi>=0.110",
"uvicorn[standard]>=0.27",
"pydantic>=2.6",
"pydantic-settings>=2.2",
"platformdirs>=4.0",
"tqdm>=4.65",
"mutagen>=1.47",
# Lets Pydantic models use ``X | None`` annotations on Python 3.9.
# Pydantic re-evaluates annotations at runtime, so ``from __future__
# import annotations`` alone isn't sufficient for the new union
# syntax on 3.9.
'eval_type_backport>=0.2; python_version < "3.10"',
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.23",
# Cap httpx below 1.0: we install with ``--pre`` to pick up Essentia's
# ``.dev`` build, which also pulls in httpx 1.0 pre-releases that have
# removed ``BaseTransport`` — still imported by starlette's TestClient
# in the 1.0 release line. Lift this cap once starlette publishes a
# version compatible with httpx 1.0 final.
"httpx>=0.27,<1.0",
"ruff>=0.6",
]
[project.scripts]
harmonie = "harmonie.cli:main"
[tool.setuptools.packages.find]
include = ["harmonie*"]
[tool.setuptools_scm]
# Write the resolved version into the package at build time so the runtime
# can read it without re-querying git (which isn't available in a wheel).
version_file = "harmonie/_version.py"
# When installed outside a git checkout (e.g. from an sdist that didn't
# include git history), fall back to this rather than failing the build.
# Note: do NOT include a local-version part (the bit after ``+``) here —
# setuptools-scm v9 splices the fallback's local part into the computed
# version's local part, producing strings like ``...+unknown.gHASH``.
fallback_version = "0.0.0"
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
# ---------------------------------------------------------------------------
# Ruff: format + lint
# ---------------------------------------------------------------------------
[tool.ruff]
target-version = "py39"
line-length = 88
extend-exclude = [".venv", "data", "harmonie/_version.py"]
[tool.ruff.lint]
# Enabled rule families:
# E, W pycodestyle (style errors and warnings)
# F pyflakes (undefined names, unused imports, etc.)
# I isort (import ordering)
# UP pyupgrade (modernize syntax)
# B flake8-bugbear (likely bugs)
# C4 flake8-comprehensions
# SIM flake8-simplify (de-duplicate logic)
select = ["E", "W", "F", "I", "UP", "B", "C4", "SIM"]
ignore = [
# Black/Ruff-formatter compatibility: line-length is the formatter's
# job, not the linter's.
"E501",
# Bugbear's "do not use mutable default argument" — Pydantic
# ``Field(default_factory=...)`` is the canonical pattern; keep it
# readable.
"B008",
]
[tool.ruff.lint.per-file-ignores]
# Tests intentionally use bare asserts and import shadowing for fixtures.
"tests/**" = ["B011", "B904"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = false