Skip to content

Commit de29d97

Browse files
committed
Migrated the metadata into setup.cfg from setup.py.
Added a section to `pyproject.toml` according to `PEP 517`. Version is now fetched automatically from git tags using `setuptools_scm`.
1 parent 0cfdab8 commit de29d97

File tree

6 files changed

+41
-45
lines changed

6 files changed

+41
-45
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Add any project-specific files here:
2-
2+
sniffio/_version.py
33

44
# Sphinx docs
55
docs/build/

ci.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ EOF
4343
exit 0
4444
fi
4545

46-
python setup.py sdist --formats=zip
47-
pip install dist/*.zip
46+
python -m build -nsx .
47+
pip install dist/*.tar.gz
4848

4949
# Actual tests
5050
pip install -Ur test-requirements.txt

pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
[build-system]
2+
requires = ["setuptools>=42.2", "setuptools_scm[toml]>=3.4.3"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
write_to = "sniffio/_version.py"
7+
write_to_template = "__version__ = \"{version}\"\n"
8+
19
[tool.towncrier]
210
package = "sniffio"
311
filename = "docs/source/history.rst"

setup.cfg

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[metadata]
2+
name = sniffio
3+
author = Nathaniel J. Smith
4+
author_email = [email protected]
5+
license = MIT OR Apache-2.0
6+
description = Sniff out which async library your code is running under
7+
long_description = file: README.rst
8+
keywords = async, trio, asyncio
9+
url = https://github.com/python-trio/sniffio
10+
classifiers =
11+
License :: OSI Approved :: MIT License
12+
License :: OSI Approved :: Apache Software License
13+
Framework :: Trio
14+
Framework :: AsyncIO
15+
Operating System :: POSIX :: Linux
16+
Operating System :: MacOS :: MacOS X
17+
Operating System :: Microsoft :: Windows
18+
Programming Language :: Python :: 3 :: Only
19+
Programming Language :: Python :: Implementation :: CPython
20+
Programming Language :: Python :: Implementation :: PyPy
21+
Intended Audience :: Developers
22+
Development Status :: 5 - Production/Stable
23+
24+
[options]
25+
packages = find:
26+
python_requires = >=3.7
27+
tests_require = curio
28+
29+
[options.package_data]
30+
sniffio = py.typed

setup.py

-39
This file was deleted.

sniffio/_version.py

-3
This file was deleted.

0 commit comments

Comments
 (0)