Skip to content

Commit 09189ad

Browse files
authored
Convert to declarative setup (#275)
1 parent 027cd6e commit 09189ad

File tree

3 files changed

+53
-69
lines changed

3 files changed

+53
-69
lines changed

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[build-system]
2-
requires= ['setuptools', 'wheel']
2+
requires = [
3+
"setuptools >= 46.4.0", "wheel >= 0.37.0",
4+
]
5+
build-backend = "setuptools.build_meta"
36

47
[tool.towncrier]
58
package = "frozenlist"

setup.cfg

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
1-
[aliases]
2-
test = pytest
3-
41
[metadata]
5-
license_file = LICENSE
2+
name = frozenlist
3+
version = attr: frozenlist.__version__
4+
url = https://github.com/aio-libs/frozenlist
5+
project_urls =
6+
Chat: Gitter = https://gitter.im/aio-libs/Lobby
7+
CI: Github Actions = https://github.com/aio-libs/frozenlist/actions
8+
Coverage: codecov = https://codecov.io/github/aio-libs/frozenlist
9+
Docs: RTD = https://frozenlist.readthedocs.io
10+
GitHub: issues = https://github.com/aio-libs/frozenlist/issues
11+
GitHub: repo = https://github.com/aio-libs/frozenlist
12+
description = A list-like structure which implements collections.abc.MutableSequence
13+
long_description = file: README.rst
14+
long_description_content_type = text/x-rst
15+
maintainer = aiohttp team <[email protected]>
16+
maintainer_email = [email protected]
17+
license = Apache 2
18+
license_files = LICENSE
19+
classifiers =
20+
License :: OSI Approved :: Apache Software License
21+
Intended Audience :: Developers
22+
Programming Language :: Python
23+
Programming Language :: Python :: 3
24+
Programming Language :: Python :: 3.7
25+
Programming Language :: Python :: 3.8
26+
Programming Language :: Python :: 3.9
27+
Programming Language :: Python :: 3.10
28+
Development Status :: 5 - Production/Stable
29+
Operating System :: POSIX
30+
Operating System :: MacOS :: MacOS X
31+
Operating System :: Microsoft :: Windows
32+
33+
[options]
34+
python_requires = >=3.7
35+
packages = find:
36+
# https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag
37+
zip_safe = False
38+
include_package_data = True
39+
40+
[options.exclude_package_data]
41+
* =
42+
*.c
43+
*.h
44+
45+
[options.package_data]
46+
# Ref:
47+
# https://setuptools.readthedocs.io/en/latest/setuptools.html#options
48+
# (see notes for the asterisk/`*` meaning)
49+
* =
50+
*.so
651

752
[pep8]
853
max-line-length=79

setup.py

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import os
2-
import pathlib
3-
import re
42
import sys
53

64
from setuptools import Extension, setup
75

8-
if sys.version_info < (3, 6):
9-
raise RuntimeError("frozenlist 1.x requires Python 3.6+")
10-
11-
126
NO_EXTENSIONS = (
137
bool(os.environ.get('FROZENLIST_NO_EXTENSIONS')) or
148
sys.implementation.name != "cpython"
159
)
1610

17-
here = pathlib.Path(__file__).parent
18-
1911
if NO_EXTENSIONS:
2012
print("*********************")
2113
print("* Pure Python build *")
@@ -30,62 +22,6 @@
3022
]
3123

3224

33-
txt = (here / 'frozenlist' / '__init__.py').read_text('utf-8')
34-
try:
35-
version = re.findall(r'^__version__ = "([^"]+)"\r?$',
36-
txt, re.M)[0]
37-
except IndexError:
38-
raise RuntimeError('Unable to determine version.')
39-
40-
install_requires = []
41-
42-
43-
def read(f):
44-
return (here / f).read_text('utf-8').strip()
45-
46-
4725
setup(
48-
name='frozenlist',
49-
version=version,
50-
description=(
51-
'A list-like structure which implements '
52-
'collections.abc.MutableSequence'
53-
),
54-
long_description=read('README.rst'),
55-
long_description_content_type="text/x-rst",
56-
classifiers=[
57-
'License :: OSI Approved :: Apache Software License',
58-
'Intended Audience :: Developers',
59-
'Programming Language :: Python',
60-
'Programming Language :: Python :: 3',
61-
'Programming Language :: Python :: 3.7',
62-
'Programming Language :: Python :: 3.8',
63-
'Programming Language :: Python :: 3.9',
64-
'Programming Language :: Python :: 3.10',
65-
'Development Status :: 5 - Production/Stable',
66-
'Operating System :: POSIX',
67-
'Operating System :: MacOS :: MacOS X',
68-
'Operating System :: Microsoft :: Windows',
69-
],
70-
author='Nikolay Kim',
71-
author_email='[email protected]',
72-
maintainer='Martijn Pieters <[email protected]>',
73-
maintainer_email='[email protected]',
74-
url='https://github.com/aio-libs/frozenlist',
75-
project_urls={
76-
'Chat: Gitter': 'https://gitter.im/aio-libs/Lobby',
77-
'CI: Github Actions':
78-
'https://github.com/aio-libs/frozenlist/actions',
79-
'Coverage: codecov': 'https://codecov.io/github/aio-libs/frozenlist',
80-
'Docs: RTD': 'https://frozenlist.readthedocs.io',
81-
'GitHub: issues': 'https://github.com/aio-libs/frozenlist/issues',
82-
'GitHub: repo': 'https://github.com/aio-libs/frozenlist',
83-
},
84-
license='Apache 2',
85-
packages=['frozenlist'],
8626
ext_modules=ext_modules,
87-
python_requires='>=3.7',
88-
install_requires=install_requires,
89-
include_package_data=True,
90-
exclude_package_data={"": ["*.c"]},
9127
)

0 commit comments

Comments
 (0)