From da1bf379e30e4ca20b7ecd6ca618f9dc349bde1d Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 4 Oct 2024 14:03:38 +0400 Subject: [PATCH] Switch from setup.py to pyproject.toml --- pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 43 ------------------------------------- 2 files changed, 58 insertions(+), 43 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 5bc78c9..68c806a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,61 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "trustme" +dynamic = ["version"] +description = "#1 quality TLS certs while you wait, for the discerning tester" +readme = "README.rst" +license = {text = "MIT OR Apache-2.0"} +requires-python = ">=3.9" +authors = [ + { name = "Nathaniel J. Smith", email = "njs@pobox.com" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Security :: Cryptography", + "Topic :: Software Development :: Testing", + "Topic :: System :: Networking", +] +dependencies = [ + "cryptography>=3.1", + "idna>=2.0", +] + +[project.urls] +Homepage = "https://github.com/python-trio/trustme" + +[tool.hatch.version] +path = "src/trustme/_version.py" + + +[tool.hatch.build.targets.sdist] +include = [ + "/docs", + "/src", + "/tests", + "/test-requirements.txt", + "/README.rst", + "/LICENSE", + "/LICENSE.APACHE2", + "/LICENSE.MIT", +] + + + [tool.towncrier] # Usage: # - PRs should drop a file like "issuenumber.feature" in newsfragments diff --git a/setup.py b/setup.py deleted file mode 100644 index 872cc3a..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -from setuptools import setup, find_packages - -# defines __version__ -exec(open("src/trustme/_version.py").read()) - -setup( - name="trustme", - version=__version__, - description= - "#1 quality TLS certs while you wait, for the discerning tester", - long_description=open("README.rst").read(), - author="Nathaniel J. Smith", - author_email="njs@pobox.com", - license="MIT OR Apache-2.0", - packages=find_packages(where="src"), - package_data={ - 'trustme': ['py.typed'], - }, - package_dir={'': 'src'}, - url="https://github.com/python-trio/trustme", - python_requires=">=3.9", - install_requires=[ - "cryptography>=3.1", - "idna>=2.0", - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Topic :: System :: Networking", - "Topic :: Security :: Cryptography", - "Topic :: Software Development :: Testing", - ])