Skip to content

Commit 9f38f39

Browse files
committed
Move metadata from setup.py to setup.cfg
A declarative file is nicer.
1 parent c5e0a82 commit 9f38f39

File tree

3 files changed

+48
-49
lines changed

3 files changed

+48
-49
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ requires = [
55
"wheel",
66
]
77

8+
[tool.setuptools_scm]
9+
write_to = "src/pluggy/_version.py"
10+
811
[tool.towncrier]
912
package = "pluggy"
1013
package_dir = "src/pluggy"

setup.cfg

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,50 @@
22
universal=1
33

44
[metadata]
5-
license_file=LICENSE
5+
name = pluggy
6+
description = plugin and hook calling mechanisms for python
7+
long_description = file: README.rst
8+
long_description_content_type = text/x-rst
9+
license = MIT
10+
platforms = unix, linux, osx, win32
11+
author = Holger Krekel
12+
author_email = [email protected]
13+
url = https://github.com/pytest-dev/pluggy
14+
classifiers =
15+
Development Status :: 4 - Beta
16+
Intended Audience :: Developers
17+
License :: OSI Approved :: MIT License
18+
Operating System :: POSIX
19+
Operating System :: Microsoft :: Windows
20+
Operating System :: MacOS :: MacOS X
21+
Topic :: Software Development :: Testing
22+
Topic :: Software Development :: Libraries
23+
Topic :: Utilities
24+
Programming Language :: Python :: Implementation :: CPython
25+
Programming Language :: Python :: Implementation :: PyPy
26+
Programming Language :: Python :: 3
27+
Programming Language :: Python :: 3 :: Only
28+
Programming Language :: Python :: 3.6
29+
Programming Language :: Python :: 3.7
30+
Programming Language :: Python :: 3.8
31+
Programming Language :: Python :: 3.9
32+
33+
[options]
34+
packages =
35+
pluggy
36+
install_requires =
37+
importlib-metadata>=0.12;python_version<"3.8"
38+
python_requires = >=3.6
39+
package_dir =
40+
=src
41+
setup_requires =
42+
setuptools-scm
43+
[options.extras_require]
44+
dev =
45+
pre-commit
46+
tox
47+
testing =
48+
pytest
649

750
[devpi:upload]
851
formats=sdist.tgz,bdist_wheel

setup.py

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,5 @@
11
from setuptools import setup
22

3-
classifiers = [
4-
"Development Status :: 4 - Beta",
5-
"Intended Audience :: Developers",
6-
"License :: OSI Approved :: MIT License",
7-
"Operating System :: POSIX",
8-
"Operating System :: Microsoft :: Windows",
9-
"Operating System :: MacOS :: MacOS X",
10-
"Topic :: Software Development :: Testing",
11-
"Topic :: Software Development :: Libraries",
12-
"Topic :: Utilities",
13-
"Programming Language :: Python :: Implementation :: CPython",
14-
"Programming Language :: Python :: Implementation :: PyPy",
15-
"Programming Language :: Python :: 3 :: Only",
16-
] + [("Programming Language :: Python :: %s" % x) for x in "3 3.6 3.7 3.8 3.9".split()]
17-
18-
with open("README.rst", "rb") as fd:
19-
long_description = fd.read().decode("utf-8")
20-
21-
with open("CHANGELOG.rst", "rb") as fd:
22-
long_description += "\n\n" + fd.read().decode("utf-8")
23-
24-
EXTRAS_REQUIRE = {
25-
"dev": ["pre-commit", "tox"],
26-
"testing": ["pytest"],
27-
}
28-
29-
30-
def main():
31-
setup(
32-
name="pluggy",
33-
description="plugin and hook calling mechanisms for python",
34-
long_description=long_description,
35-
use_scm_version={"write_to": "src/pluggy/_version.py"},
36-
setup_requires=["setuptools-scm"],
37-
license="MIT license",
38-
platforms=["unix", "linux", "osx", "win32"],
39-
author="Holger Krekel",
40-
author_email="[email protected]",
41-
url="https://github.com/pytest-dev/pluggy",
42-
python_requires=">=3.6",
43-
install_requires=['importlib-metadata>=0.12;python_version<"3.8"'],
44-
extras_require=EXTRAS_REQUIRE,
45-
classifiers=classifiers,
46-
packages=["pluggy"],
47-
package_dir={"": "src"},
48-
)
49-
503

514
if __name__ == "__main__":
52-
main()
5+
setup()

0 commit comments

Comments
 (0)