Skip to content

Commit 3443725

Browse files
committed
use setup.cfg to handle setuptools metadata
1 parent 2fe4483 commit 3443725

File tree

3 files changed

+44
-59
lines changed

3 files changed

+44
-59
lines changed

.pre-commit-config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ repos:
1717
hooks:
1818
- id: pyupgrade
1919
args: [--py38-plus]
20+
- repo: https://github.com/asottile/setup-cfg-fmt
21+
rev: v2.4.0
22+
hooks:
23+
- id: setup-cfg-fmt
2024
- repo: https://github.com/pycqa/flake8
2125
rev: 6.0.0
2226
hooks:

setup.cfg

+39-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,46 @@
1+
[metadata]
2+
name = pycodestyle
3+
version = attr: pycodestyle.__version__
4+
description = Python style guide checker
5+
long_description = file: README.rst
6+
long_description_content_type = text/x-rst
7+
url = https://pycodestyle.pycqa.org/
8+
author = Johann C. Rocholl
9+
author_email = [email protected]
10+
maintainer = Ian Lee
11+
maintainer_email = [email protected]
12+
license = MIT
13+
license_files = LICENSE
14+
classifiers =
15+
Development Status :: 5 - Production/Stable
16+
Environment :: Console
17+
Intended Audience :: Developers
18+
License :: OSI Approved :: MIT License
19+
Operating System :: OS Independent
20+
Programming Language :: Python
21+
Programming Language :: Python :: 3
22+
Programming Language :: Python :: 3 :: Only
23+
Programming Language :: Python :: Implementation :: CPython
24+
Programming Language :: Python :: Implementation :: PyPy
25+
Topic :: Software Development :: Libraries :: Python Modules
26+
keywords = pycodestyle, pep8, PEP 8, PEP-8, PEP8
27+
project_urls =
28+
Changes=https://pycodestyle.pycqa.org/en/latest/developer.html#changes
29+
30+
[options]
31+
py_modules = pycodestyle
32+
python_requires = >=3.8
33+
include_package_data = True
34+
zip_safe = False
35+
36+
[options.entry_points]
37+
console_scripts =
38+
pycodestyle = pycodestyle:_main
39+
140
[bdist_wheel]
241
universal = 1
342

4-
[metadata]
5-
license_file = LICENSE
6-
743
[pycodestyle]
8-
select =
944
ignore = E226,E24,W504
1045
max_line_length = 79
1146
max_doc_length = 72

setup.py

+1-55
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,2 @@
11
from setuptools import setup
2-
3-
4-
def get_version():
5-
with open('pycodestyle.py') as f:
6-
for line in f:
7-
if line.startswith('__version__'):
8-
return eval(line.split('=')[-1])
9-
10-
11-
def get_long_description():
12-
descr = []
13-
for fname in 'README.rst', 'CHANGES.txt':
14-
with open(fname) as f:
15-
descr.append(f.read())
16-
return '\n\n'.join(descr)
17-
18-
19-
setup(
20-
name='pycodestyle',
21-
version=get_version(),
22-
description="Python style guide checker",
23-
long_description=get_long_description(),
24-
keywords='pycodestyle, pep8, PEP 8, PEP-8, PEP8',
25-
author='Johann C. Rocholl',
26-
author_email='[email protected]',
27-
maintainer='Ian Lee',
28-
maintainer_email='[email protected]',
29-
url='https://pycodestyle.pycqa.org/',
30-
license='Expat license',
31-
py_modules=['pycodestyle'],
32-
include_package_data=True,
33-
zip_safe=False,
34-
python_requires='>=3.8',
35-
entry_points={
36-
'console_scripts': [
37-
'pycodestyle = pycodestyle:_main',
38-
],
39-
},
40-
classifiers=[
41-
'Development Status :: 5 - Production/Stable',
42-
'Environment :: Console',
43-
'Intended Audience :: Developers',
44-
'License :: OSI Approved :: MIT License',
45-
'Operating System :: OS Independent',
46-
'Programming Language :: Python',
47-
'Programming Language :: Python :: 3',
48-
'Programming Language :: Python :: Implementation :: CPython',
49-
'Programming Language :: Python :: Implementation :: PyPy',
50-
'Topic :: Software Development :: Libraries :: Python Modules',
51-
],
52-
project_urls={
53-
'Changes':
54-
'https://pycodestyle.pycqa.org/en/latest/developer.html#changes',
55-
},
56-
)
2+
setup()

0 commit comments

Comments
 (0)