Skip to content

Commit

Permalink
Move metadata to pyproject.toml, fix test fixture inclusion in sdist (
Browse files Browse the repository at this point in the history
#111)

Fixes: #109
  • Loading branch information
elprans committed Aug 14, 2023
1 parent 9ce64c5 commit ea65656
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 47 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include tests *.py
recursive-include tests *.py test-data/*
recursive-include immutables *.py *.c *.h *.pyi
include LICENSE* NOTICE README.rst bench.png
include immutables/py.typed
58 changes: 58 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,65 @@
[project]
name = "immutables"
description = "Immutable Collections"
authors = [{name = "MagicStack Inc", email = "hello@magic.io"}]
readme = "README.rst"
license = {text = "Apache License, Version 2.0"}
dynamic = ["version"]
keywords = [
"collections",
"immutable",
"hamt",
]
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries",
]
dependencies = [
'typing-extensions>=3.7.4.3;python_version<"3.8"',
]

[project.urls]
github = "https://github.com/MagicStack/immutables"

[project.optional-dependencies]
# Minimal dependencies required to test immutables.
# pycodestyle is a dependency of flake8, but it must be frozen because
# their combination breaks too often
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
test = [
'flake8~=5.0',
'pycodestyle~=2.9',
'mypy~=1.4',
'pytest~=7.4',
]

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
zip-safe = false

[tool.setuptools.packages.find]
include = ["immutables", "immutables.*"]

[tool.setuptools.package-data]
immutables = ["py.typed", "*.pyi"]

[tool.setuptools.exclude-package-data]
"*" = ["*.c", "*.h"]

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--capture=no --assert=plain --strict-markers --tb=native --import-mode=importlib"
Expand Down
46 changes: 0 additions & 46 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@
import setuptools


# Minimal dependencies required to test immutables.
TEST_DEPENDENCIES = [
# pycodestyle is a dependency of flake8, but it must be frozen because
# their combination breaks too often
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
'flake8~=5.0',
'pycodestyle~=2.9',
'mypy~=1.4',
'pytest~=7.4',
]

EXTRA_DEPENDENCIES = {
'test': TEST_DEPENDENCIES,
}

system = platform.uname().system
CFLAGS = ['-O2']

Expand Down Expand Up @@ -62,38 +47,7 @@
ext_modules = []


with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
readme = f.read()


setuptools.setup(
name='immutables',
version=VERSION,
description='Immutable Collections',
long_description=readme,
python_requires='>=3.7',
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
],
author='MagicStack Inc',
author_email='hello@magic.io',
url='https://github.com/MagicStack/immutables',
license='Apache License, Version 2.0',
packages=['immutables'],
package_data={"immutables": ["py.typed", "*.pyi"]},
provides=['immutables'],
include_package_data=True,
ext_modules=ext_modules,
install_requires=['typing-extensions>=3.7.4.3;python_version<"3.8"'],
extras_require=EXTRA_DEPENDENCIES,
)

0 comments on commit ea65656

Please sign in to comment.