Skip to content

Commit 26ee259

Browse files
committed
migrate project settings to pyproject.toml
Move essential settings from setup.py to pyproject.toml, leaving only the definition of the C extension. Add some trailing commas in the setup() call to tell YAPF not to collapse the function arguments too much. Add module docstring to setup.py. Previously the source distribution did not include any test code, but now the top-level tests directory is added automatically (just the top level: test code without test data). Add MANIFEST.in with an explicit removal of tests directory to keep the source distribution the same as it was before. I'm not using a PEP 639 compliant license expression in pyproject.toml yet. This is because of supported Python version constraints: the most recent setuptools version that still supports Python 3.7 is 68.0.0, while the PEP 639 license expressions are only supported from 77.0.0. I guess I'll have to live with the deprecation warnings until I drop support for the older Python versions.
1 parent cbcbfa4 commit 26ee259

File tree

3 files changed

+70
-53
lines changed

3 files changed

+70
-53
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prune tests

pyproject.toml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,59 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "ARver"
7+
dynamic = ["version"]
8+
dependencies = ["discid", "musicbrainzngs", "pycdio", "requests"]
9+
requires-python = ">=3.7"
10+
11+
authors = [{ name = "arcctgx", email = "[email protected]" }]
12+
13+
description = "Application for verifying ripped audio files using AccurateRip database."
14+
readme = { file = "README.md", content-type = "text/markdown" }
15+
license = { text = "GPLv3" }
16+
17+
classifiers = [
18+
"Development Status :: 5 - Production/Stable",
19+
"Environment :: Console",
20+
"Intended Audience :: End Users/Desktop",
21+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
22+
"Natural Language :: English",
23+
"Operating System :: POSIX :: Linux",
24+
"Programming Language :: C",
25+
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.7",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Topic :: Multimedia :: Sound/Audio :: Analysis",
33+
"Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
34+
]
35+
36+
[project.scripts]
37+
arver = "arver.arver_main:main"
38+
arver-discinfo = "arver.arver_discinfo:main"
39+
arver-ripinfo = "arver.arver_ripinfo:main"
40+
arver-bin-parser = "arver.arver_bin_parser:main"
41+
42+
[project.urls]
43+
Homepage = "https://github.com/arcctgx/ARver"
44+
Issues = "https://github.com/arcctgx/ARver/issues"
45+
46+
[tool.setuptools.dynamic]
47+
version = { attr = "arver.VERSION" }
48+
49+
[tool.setuptools.packages.find]
50+
where = ["."]
51+
152
[tool.mypy]
253
exclude = "build"
354

455
[[tool.mypy.overrides]]
5-
module = [
6-
"discid",
7-
"musicbrainzngs",
8-
"cdio",
9-
"pycdio"
10-
]
56+
module = ["discid", "musicbrainzngs", "cdio", "pycdio"]
1157
ignore_missing_imports = true
1258

1359
[tool.pylint.basic]

setup.py

Lines changed: 17 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,19 @@
1-
from setuptools import Extension, find_packages, setup
1+
"""ARver C extension definition."""
22

3-
from arver import APPNAME, URL, VERSION
3+
from setuptools import Extension, setup
44

5-
with open('README.md', encoding='utf-8') as f:
6-
readme = f.read()
7-
8-
setup(name=APPNAME,
9-
version=VERSION,
10-
description='Application for verifying ripped audio files using AccurateRip database.',
11-
long_description=readme,
12-
long_description_content_type="text/markdown",
13-
author='arcctgx',
14-
author_email='[email protected]',
15-
url=URL,
16-
license='GPLv3',
17-
classifiers=[
18-
'Development Status :: 5 - Production/Stable', 'Environment :: Console',
19-
'Intended Audience :: End Users/Desktop',
20-
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
21-
'Natural Language :: English', 'Operating System :: POSIX :: Linux',
22-
'Programming Language :: C', 'Programming Language :: Python :: 3 :: Only',
23-
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8',
24-
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10',
25-
'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12',
26-
'Topic :: Multimedia :: Sound/Audio :: Analysis',
27-
'Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping'
28-
],
29-
python_requires='>=3.7',
30-
packages=find_packages(),
31-
entry_points={
32-
'console_scripts': [
33-
'arver = arver.arver_main:main', 'arver-discinfo = arver.arver_discinfo:main',
34-
'arver-ripinfo = arver.arver_ripinfo:main',
35-
'arver-bin-parser = arver.arver_bin_parser:main'
36-
]
37-
},
38-
ext_modules=[
39-
Extension('arver.audio._audio',
40-
sources=['arver/audio/_audio.c'],
41-
libraries=['sndfile', 'z'],
42-
extra_compile_args=['-std=c99', '-O3', '-D_DEFAULT_SOURCE'],
43-
define_macros=[('Py_LIMITED_API', '0x03070000')],
44-
py_limited_api=True)
45-
],
46-
options={'bdist_wheel': {
47-
'py_limited_api': 'cp37'
48-
}},
49-
install_requires=['discid', 'musicbrainzngs', 'pycdio', 'requests'])
5+
setup(
6+
ext_modules=[
7+
Extension('arver.audio._audio',
8+
sources=['arver/audio/_audio.c'],
9+
libraries=['sndfile', 'z'],
10+
extra_compile_args=['-std=c99', '-O3', '-D_DEFAULT_SOURCE'],
11+
define_macros=[('Py_LIMITED_API', '0x03070000')],
12+
py_limited_api=True),
13+
],
14+
options={
15+
'bdist_wheel': {
16+
'py_limited_api': 'cp37'
17+
},
18+
},
19+
)

0 commit comments

Comments
 (0)