Skip to content

Commit

Permalink
Migrated the metadata into setup.cfg from setup.py.
Browse files Browse the repository at this point in the history
Added a section to `pyproject.toml` according to `PEP 517`.
Version is now fetched automatically from git tags using `setuptools_scm`.
  • Loading branch information
KOLANICH committed Oct 19, 2022
1 parent 0cfdab8 commit de29d97
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Add any project-specific files here:

sniffio/_version.py

# Sphinx docs
docs/build/
Expand Down
4 changes: 2 additions & 2 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ EOF
exit 0
fi

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

# Actual tests
pip install -Ur test-requirements.txt
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[build-system]
requires = ["setuptools>=42.2", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "sniffio/_version.py"
write_to_template = "__version__ = \"{version}\"\n"

[tool.towncrier]
package = "sniffio"
filename = "docs/source/history.rst"
Expand Down
30 changes: 30 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[metadata]
name = sniffio
author = Nathaniel J. Smith
author_email = [email protected]
license = MIT OR Apache-2.0
description = Sniff out which async library your code is running under
long_description = file: README.rst
keywords = async, trio, asyncio
url = https://github.com/python-trio/sniffio
classifiers =
License :: OSI Approved :: MIT License
License :: OSI Approved :: Apache Software License
Framework :: Trio
Framework :: AsyncIO
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Intended Audience :: Developers
Development Status :: 5 - Production/Stable

[options]
packages = find:
python_requires = >=3.7
tests_require = curio

[options.package_data]
sniffio = py.typed
39 changes: 0 additions & 39 deletions setup.py

This file was deleted.

3 changes: 0 additions & 3 deletions sniffio/_version.py

This file was deleted.

0 comments on commit de29d97

Please sign in to comment.