Skip to content

Commit ea65656

Browse files
authored
Move metadata to pyproject.toml, fix test fixture inclusion in sdist (#111)
Fixes: #109
1 parent 9ce64c5 commit ea65656

File tree

3 files changed

+59
-47
lines changed

3 files changed

+59
-47
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
recursive-include tests *.py
1+
recursive-include tests *.py test-data/*
22
recursive-include immutables *.py *.c *.h *.pyi
33
include LICENSE* NOTICE README.rst bench.png
44
include immutables/py.typed

pyproject.toml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,65 @@
1+
[project]
2+
name = "immutables"
3+
description = "Immutable Collections"
4+
authors = [{name = "MagicStack Inc", email = "[email protected]"}]
5+
readme = "README.rst"
6+
license = {text = "Apache License, Version 2.0"}
7+
dynamic = ["version"]
8+
keywords = [
9+
"collections",
10+
"immutable",
11+
"hamt",
12+
]
13+
classifiers=[
14+
"License :: OSI Approved :: Apache Software License",
15+
"Intended Audience :: Developers",
16+
"Programming Language :: Python :: 3 :: Only",
17+
"Programming Language :: Python :: 3.8",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: Implementation :: CPython",
23+
"Operating System :: POSIX",
24+
"Operating System :: MacOS :: MacOS X",
25+
"Operating System :: Microsoft :: Windows",
26+
"Topic :: Software Development :: Libraries",
27+
]
28+
dependencies = [
29+
'typing-extensions>=3.7.4.3;python_version<"3.8"',
30+
]
31+
32+
[project.urls]
33+
github = "https://github.com/MagicStack/immutables"
34+
35+
[project.optional-dependencies]
36+
# Minimal dependencies required to test immutables.
37+
# pycodestyle is a dependency of flake8, but it must be frozen because
38+
# their combination breaks too often
39+
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
40+
test = [
41+
'flake8~=5.0',
42+
'pycodestyle~=2.9',
43+
'mypy~=1.4',
44+
'pytest~=7.4',
45+
]
46+
147
[build-system]
248
requires = ["setuptools>=42", "wheel"]
349
build-backend = "setuptools.build_meta"
450

51+
[tool.setuptools]
52+
zip-safe = false
53+
54+
[tool.setuptools.packages.find]
55+
include = ["immutables", "immutables.*"]
56+
57+
[tool.setuptools.package-data]
58+
immutables = ["py.typed", "*.pyi"]
59+
60+
[tool.setuptools.exclude-package-data]
61+
"*" = ["*.c", "*.h"]
62+
563
[tool.pytest.ini_options]
664
minversion = "6.0"
765
addopts = "--capture=no --assert=plain --strict-markers --tb=native --import-mode=importlib"

setup.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,6 @@
33
import setuptools
44

55

6-
# Minimal dependencies required to test immutables.
7-
TEST_DEPENDENCIES = [
8-
# pycodestyle is a dependency of flake8, but it must be frozen because
9-
# their combination breaks too often
10-
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
11-
'flake8~=5.0',
12-
'pycodestyle~=2.9',
13-
'mypy~=1.4',
14-
'pytest~=7.4',
15-
]
16-
17-
EXTRA_DEPENDENCIES = {
18-
'test': TEST_DEPENDENCIES,
19-
}
20-
216
system = platform.uname().system
227
CFLAGS = ['-O2']
238

@@ -62,38 +47,7 @@
6247
ext_modules = []
6348

6449

65-
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
66-
readme = f.read()
67-
68-
6950
setuptools.setup(
70-
name='immutables',
7151
version=VERSION,
72-
description='Immutable Collections',
73-
long_description=readme,
74-
python_requires='>=3.7',
75-
classifiers=[
76-
'License :: OSI Approved :: Apache Software License',
77-
'Intended Audience :: Developers',
78-
'Programming Language :: Python :: 3 :: Only',
79-
'Programming Language :: Python :: 3.8',
80-
'Programming Language :: Python :: 3.9',
81-
'Programming Language :: Python :: 3.10',
82-
'Programming Language :: Python :: 3.11',
83-
'Programming Language :: Python :: 3.12',
84-
'Operating System :: POSIX',
85-
'Operating System :: MacOS :: MacOS X',
86-
'Operating System :: Microsoft :: Windows',
87-
],
88-
author='MagicStack Inc',
89-
author_email='[email protected]',
90-
url='https://github.com/MagicStack/immutables',
91-
license='Apache License, Version 2.0',
92-
packages=['immutables'],
93-
package_data={"immutables": ["py.typed", "*.pyi"]},
94-
provides=['immutables'],
95-
include_package_data=True,
9652
ext_modules=ext_modules,
97-
install_requires=['typing-extensions>=3.7.4.3;python_version<"3.8"'],
98-
extras_require=EXTRA_DEPENDENCIES,
9953
)

0 commit comments

Comments
 (0)