Debian Codegraph @

pyproject.toml

raw
1 [project]
2 name = "beets"
3 version = "2.14.1"
4 description = "music tagger and library organizer"
5 authors = [{ name = "Adrian Sampson", email = "[email protected]" }]
6 maintainers = [{ name = "Serene-Arc" }]
7 license = { text = "MIT" }
8 readme = "README.rst"
9 requires-python = ">=3.10,<3.15"
10 classifiers = [
11 "Topic :: Multimedia :: Sound/Audio",
12 "Topic :: Multimedia :: Sound/Audio :: Players :: MP3",
13 "License :: OSI Approved :: MIT License",
14 "Environment :: Console",
15 "Environment :: Web Environment",
16 "Programming Language :: Python",
17 "Programming Language :: Python :: 3",
18 "Programming Language :: Python :: 3.10",
19 "Programming Language :: Python :: 3.11",
20 "Programming Language :: Python :: 3.12",
21 "Programming Language :: Python :: 3.13",
22 "Programming Language :: Python :: 3.14",
23 "Programming Language :: Python :: Implementation :: CPython",
24 ]
25
26 dependencies = [
27 "colorama ; sys_platform == 'win32'",
28 "confuse>=2.2.0",
29 "jellyfish",
30 "lap>=0.5.12",
31 "mediafile>=0.17.0",
32 "numpy>=2.0.2 ; python_version < '3.13'",
33 "numpy>=2.3.5 ; python_version >= '3.13'",
34 "packaging>=24.0",
35 "platformdirs>=3.5.0",
36 "pyyaml",
37 "requests>=2.32.5",
38 "requests-ratelimiter>=0.7.0",
39 "typing_extensions",
40 "unidecode>=1.3.6",
41 ]
42
43 [dependency-groups]
44 docs = [
45 "docutils>=0.20.1",
46 "pydata-sphinx-theme",
47 "sphinx<9",
48 "sphinx-lint>=1.0.0",
49 "sphinx-design>=0.6.1",
50 "sphinx-copybutton>=0.5.2",
51 "sphinx-toolbox>=4.1.0",
52 "titlecase>=2.4.1,<3",
53 ]
54 test = [
55 "beautifulsoup4",
56 "codecov>=2.1.13",
57 "flask",
58 "langdetect",
59 "pylast",
60 "pytest",
61 "pytest-cov",
62 "pytest-factoryboy>=2.8.1",
63 "pytest-flask",
64 "python-mpd2",
65 "python3-discogs-client>=2.3.15",
66 "py7zr",
67 "pyxdg",
68 "rarfile",
69 "requests-mock>=1.12.1",
70 "requests-oauthlib",
71 "responses>=0.3.0",
72 "titlecase>=2.4.1,<3",
73 ]
74 lint = [
75 "docstrfmt>=2.0.2",
76 "ruff>=0.13.0",
77 "sphinx-lint>=1.0.0",
78 ]
79 typing = [
80 "mypy",
81 "types-beautifulsoup4",
82 "types-docutils>=0.22.2.20251006",
83 "types-Flask-Cors",
84 "types-Pillow",
85 "types-PyYAML",
86 "types-requests",
87 "types-urllib3",
88 ]
89 release = [
90 "click>=8.1.7",
91 "tomli>=2.0.1",
92 ]
93 dev = [
94 { include-group = "docs" },
95 { include-group = "lint" },
96 { include-group = "test" },
97 { include-group = "typing" },
98 ]
99
100 [project.optional-dependencies]
101 # inline comments note required external / non-python dependencies
102 absubmit = ["requests"] # extractor binary from https://acousticbrainz.org/download
103 aura = ["flask", "flask-cors", "Pillow"]
104 autobpm = ["librosa>=0.11", "resampy>=0.4.3", "numba>=0.65.1"]
105 # badfiles # mp3val and flac
106 beatport = ["requests-oauthlib>=0.6.1"]
107 bpd = [
108 "PyGObject ; sys_platform != 'win32'",
109 ] # gobject-introspection, gstreamer1.0-plugins-base, python3-gst-1.0
110 chroma = ["pyacoustid>=1.3.1,<2"] # chromaprint or fpcalc
111 # convert # ffmpeg
112 discogs = ["python3-discogs-client>=2.3.15"]
113 embedart = ["Pillow"] # ImageMagick
114 embyupdate = ["requests"]
115 fetchart = ["beautifulsoup4", "langdetect", "Pillow", "requests"]
116 import = ["py7zr", "rarfile"]
117 # ipfs # go-ipfs
118 # keyfinder # KeyFinder
119 kodiupdate = ["requests"]
120 lastgenre = ["pylast"]
121 lastimport = ["pylast"]
122 lyrics = ["beautifulsoup4", "langdetect", "requests"]
123 metasync = ["dbus-python ; sys_platform != 'win32'"]
124 mpdstats = ["python-mpd2>=0.4.2"]
125 plexupdate = ["requests"]
126 reflink = ["reflink"]
127 replaygain = [
128 "PyGObject ; sys_platform != 'win32'",
129 ] # python-gi and GStreamer 1.0+ or mp3gain/aacgain or Python Audio Tools or ffmpeg
130 scrub = ["mutagen>=1.33"]
131 sonosupdate = ["soco"]
132 tidal = ["requests-oauthlib>=0.6.1"]
133 titlecase = ["titlecase"]
134 thumbnails = ["Pillow", "pyxdg"]
135 web = ["flask", "flask-cors"]
136
137 [project.scripts]
138 beet = "beets.ui:main"
139
140 [project.urls]
141 Homepage = "https://beets.io/"
142 Repository = "https://github.com/beetbox/beets"
143 Documentation = "https://beets.readthedocs.io/en/stable/"
144 Changelog = "https://github.com/beetbox/beets/blob/master/docs/changelog.rst"
145 "Bug Tracker" = "https://github.com/beetbox/beets/issues"
146
147 [build-system]
148 requires = ["hatchling"]
149 build-backend = "hatchling.build"
150
151 [tool.hatch.build]
152 artifacts = [
153 "man/**",
154 ]
155
156 [tool.hatch.build.targets.wheel]
157 packages = ["beets", "beetsplug"]
158
159 [tool.hatch.build.targets.sdist]
160 include = [
161 "beets/",
162 "beetsplug/",
163 "docs/",
164 "extra/",
165 "man/",
166 "test/",
167 ]
168 exclude = [
169 "docs/_build/",
170 "docs/modd.conf",
171 "docs/**/*.css",
172 ]
173
174 [tool.poe.tasks.build]
175 help = "Build the package"
176 shell = """
177 make -C docs man
178 rm -rf man
179 mv docs/_build/man .
180 uv build
181 """
182
183 [tool.poe.tasks.bump]
184 help = "Bump project version and update relevant files"
185 cmd = "python ./extra/release.py bump $version"
186 args = { version = { help = "The new version to set", positional = true, required = true } }
187
188 [tool.poe.tasks.changelog]
189 help = "Print the latest version's changelog in Markdown"
190 cmd = "python ./extra/release.py changelog"
191
192 [tool.poe.tasks.check-docs-links]
193 help = "Check the documentation for broken URLs"
194 cmd = "make -C docs linkcheck"
195
196 [tool.poe.tasks.check-format]
197 help = "Check the code for style issues"
198 cmd = "ruff format --check --diff"
199
200 [tool.poe.tasks.check-types]
201 help = "Check the code for typing issues. Accepts mypy options."
202 cmd = "mypy"
203
204 [tool.poe.tasks.docs]
205 help = "Build documentation"
206 args = [{ name = "COMMANDS", positional = true, multiple = true, default = "html" }]
207 cmd = "make -C docs $COMMANDS"
208
209 [tool.poe.tasks.format]
210 help = "Format the codebase"
211 cmd = "ruff format --config=pyproject.toml"
212
213 [tool.poe.tasks.format-docs]
214 help = "Format the documentation"
215 cmd = "docstrfmt --preserve-adornments docs *.rst"
216
217 [tool.poe.tasks.install]
218 help = "Install project dependencies"
219 cmd = "uv sync --locked"
220
221 [tool.poe.tasks.lint]
222 help = "Check the code for linting issues. Accepts ruff options."
223 cmd = "ruff check --config=pyproject.toml"
224
225 [tool.poe.tasks.lint-docs]
226 help = "Lint the documentation"
227 interpreter = "bash"
228 shell = """
229 set -o pipefail
230 files=$(git ls-files '*.rst')
231
232 grep -Eno ' `[^`][^`]+`[^_]' $files |
233 sed 's/ .*/ Use double backticks for inline literal (double-backticks-required)/' && failed=1
234 sphinx-lint --enable all --disable default-role $files || failed=1
235
236 exit ${failed:-0}
237 """
238
239 [tool.poe.tasks.update-dependencies]
240 help = "Update dependencies to their latest versions."
241 cmd = "uv sync --upgrade"
242
243 [tool.poe.tasks.test]
244 help = "Run tests with pytest"
245 cmd = "uv run pytest $OPTS"
246 env.OPTS.default = "-p no:cov"
247
248 [tool.poe.tasks.test-with-coverage]
249 help = "Run tests and record coverage"
250 ref = "test"
251 # record coverage in beets and beetsplug packages
252 # save xml for coverage upload to coveralls
253 # save html report for local dev use
254 # measure coverage across logical branches
255 # show which tests cover specific lines in the code (see the HTML report)
256 env.OPTS = """
257 --cov=.
258 --cov-report=xml:.reports/coverage.xml
259 --cov-report=html:.reports/html
260 --cov-branch
261 --cov-context=test
262 """
263
264 [tool.poe.tasks.check-temp-files]
265 help = "Run each test module one by one and check for leftover temp files"
266 shell = """
267 setopt nullglob
268 for file in test/**/*.py; do
269 print Temp files created by $file && poe test $file &>/dev/null
270 tempfiles=(/tmp/**/tmp* /tmp/beets/**/*)
271 if (( $#tempfiles )); then
272 print -l $'\t'$^tempfiles
273 rm -r --interactive=never $tempfiles &>/dev/null
274 fi
275 done
276 """
277 interpreter = "zsh"
278
279 [tool.docstrfmt]
280 line-length = 80
281 extend-exclude = [
282 "docs/_templates/**/*",
283 "docs/api/**/*",
284 "README_kr.rst",
285 ]
286
287 [tool.ruff]
288 target-version = "py310"
289 line-length = 80
290
291 [tool.ruff.format]
292 skip-magic-trailing-comma = true
293
294 [tool.ruff.lint]
295 future-annotations = true
296 select = [
297 "A", # flake8-builtins
298 "ANN", # flake8-annotations
299 # "ARG", # flake8-unused-arguments
300 # "C4", # flake8-comprehensions
301 "E", # pycodestyle
302 "F", # pyflakes
303 # "B", # flake8-bugbear
304 "G", # flake8-logging-format
305 "I", # isort
306 "ISC", # flake8-implicit-str-concat
307 "N", # pep8-naming
308 "PIE", # flake8-pie
309 "PT", # flake8-pytest-style
310 "RET", # flake8-return
311 "RUF", # ruff
312 "UP", # pyupgrade
313 "TC", # flake8-type-checking
314 "W", # pycodestyle
315 ]
316 ignore = [
317 "ANN002", # no need to document *args due to noise
318 "ANN003", # no need to document **kwargs due to noise
319 "ANN401", # we use Any type in the codebase
320 "TC006", # no need to quote 'cast's since we use 'from __future__ import annotations'
321 ]
322
323 [tool.ruff.lint.per-file-ignores]
324 "beets/**" = ["PT"]
325 "docs/conf.py" = ["ANN"]
326 "test/plugins/test_ftintitle.py" = ["E501"]
327 "test/test_util.py" = ["E501"]
328 "test/util/test_diff.py" = ["E501"]
329 "test/util/test_id_extractors.py" = ["E501"]
330 "test/**" = [
331 "RUF001", # we use Unicode characters in tests
332 "ANN", # we don't annotate test functions
333 ]
334
335 [tool.ruff.lint.isort]
336 split-on-trailing-comma = false
337
338 [tool.ruff.lint.pycodestyle]
339 max-line-length = 88
340
341 [tool.ruff.lint.flake8-annotations]
342 allow-star-arg-any = true
343 suppress-dummy-args = true
344
345 [tool.ruff.lint.flake8-pytest-style]
346 fixture-parentheses = false
347 mark-parentheses = false
348 parametrize-names-type = "csv"
349
350 [tool.ruff.lint.flake8-unused-arguments]
351 ignore-variadic-names = true
352
353 [tool.ruff.lint.pep8-naming]
354 classmethod-decorators = ["cached_classproperty"]
355 extend-ignore-names = ["assert*", "cached_classproperty"]