diff --git a/.gitignore b/.gitignore index 47ad4b1..fcbb5dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Add any project-specific files here: - +sniffio/_version.py # Sphinx docs docs/build/ diff --git a/ci.sh b/ci.sh index bab85fc..afa8a5a 100755 --- a/ci.sh +++ b/ci.sh @@ -10,7 +10,7 @@ pip install -U pip setuptools wheel if [ "$CHECK_FORMATTING" = "1" ]; then pip install yapf==${YAPF_VERSION} - if ! yapf -rpd setup.py sniffio; then + if ! yapf -rpd sniffio; then cat <=61.2", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "sniffio" +authors = [{name = "Nathaniel J. Smith", email = "njs@pobox.com"}] +license = {text = "MIT OR Apache-2.0"} +description = "Sniff out which async library your code is running under" +readme = "README.rst" +keywords = ["async", "trio", "asyncio"] +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", +] +urls = {Homepage = "https://github.com/python-trio/sniffio"} +requires-python = ">=3.7" +dynamic = ["version"] + +[project.optional-dependencies] +testing = ["curio"] + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.packages] +find = {namespaces = false} + +[tool.setuptools.package-data] +sniffio = ["py.typed"] + +[tool.setuptools_scm] +write_to = "sniffio/_version.py" +write_to_template = "__version__ = \"{version}\"\n" + [tool.towncrier] package = "sniffio" filename = "docs/source/history.rst" diff --git a/setup.py b/setup.py deleted file mode 100644 index 374839c..0000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -from setuptools import setup, find_packages - -exec(open("sniffio/_version.py", encoding="utf-8").read()) - -LONG_DESC = open("README.rst", encoding="utf-8").read() - -setup( - name="sniffio", - version=__version__, - description="Sniff out which async library your code is running under", - url="https://github.com/python-trio/sniffio", - long_description=LONG_DESC, - author="Nathaniel J. Smith", - author_email="njs@pobox.com", - license="MIT OR Apache-2.0", - packages=find_packages(), - package_data={"sniffio": ["py.typed"]}, - keywords=[ - "async", - "trio", - "asyncio", - ], - python_requires=">=3.7", - tests_require=['curio'], - 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", - ], -) diff --git a/sniffio/_version.py b/sniffio/_version.py deleted file mode 100644 index 0de77e3..0000000 --- a/sniffio/_version.py +++ /dev/null @@ -1,3 +0,0 @@ -# This file is imported from __init__.py and exec'd from setup.py - -__version__ = "1.3.0+dev"