From 902775067d127f1b08a5e907572cdf1fa0bfb4e0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 18 Apr 2024 12:54:25 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Switch=20packaging=20metadata=20?= =?UTF-8?q?to=20use=20PEP=20621?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch migrated most related content to `pyproject.toml` semi-automatically. The change was produced by using `jaraco.develop.migrate-config` and `ini2toml`. As a part of this change previously used for packaging configuration `setup.cfg` and `setup.py` files have been removed. `setup.py` hasn't been needed for quite a while but kept for backward compatibility. We don't care about that anymore. Co-authored-by: Sviatoslav Sydorenko --- pyproject.toml | 75 ++++++++++++++++++++- requirements/dist-build-constraints.in | 2 +- setup.cfg | 91 -------------------------- setup.py | 8 --- 4 files changed, 75 insertions(+), 101 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 88df57dcc1..c958acac84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,11 +3,84 @@ # NOTE: at all times. requires = [ # Essentials - "setuptools>=34.4", + "setuptools >= 61.2", # Plugins "setuptools-scm >= 7.0.0", ] build-backend = "setuptools.build_meta" +[project] +name = "cheroot" +description = "Highly-optimized, pure-python HTTP server" +authors = [ + { name = "CherryPy Team", email = "team@cherrypy.dev" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Framework :: CherryPy", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "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 :: Implementation", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: Jython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: HTTP Servers", + "Topic :: Internet :: WWW/HTTP :: WSGI", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", + "Typing :: Typed", +] +keywords = [ + "http", + "server", + "ssl", + "wsgi", +] +requires-python = ">=3.8" +dependencies = [ + "more_itertools >= 2.6", + "jaraco.functools", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://cheroot.cherrypy.dev" +"Chat: Matrix" = "https://matrix.to/#/#cherrypy-space:matrix.org" +"CI: GitHub" = "https://github.com/cherrypy/cheroot/actions" +"Docs: RTD" = "https://cheroot.cherrypy.dev" +"GitHub: issues" = "https://github.com/cherrypy/cheroot/issues" +"GitHub: repo" = "https://github.com/cherrypy/cheroot" +"Tidelift: funding" = "https://tidelift.com/subscription/pkg/pypi-cheroot?utm_source=pypi-cheroot&utm_medium=referral&utm_campaign=pypi" + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.optional-dependencies] +docs = [ + # upstream + "sphinx >= 1.8.2", + "jaraco.packaging >= 3.2", + "sphinx-tabs >= 1.1.0", + + # local + "furo", + # `scm_tag_titles_ext` extension dep in docs/ + "python-dateutil", + "sphinxcontrib-apidoc >= 0.3.0", +] + +[project.scripts] +cheroot = "cheroot.cli:main" + [tool.setuptools_scm] diff --git a/requirements/dist-build-constraints.in b/requirements/dist-build-constraints.in index a37baef1a9..0d9192add8 100644 --- a/requirements/dist-build-constraints.in +++ b/requirements/dist-build-constraints.in @@ -2,7 +2,7 @@ # NOTE: at all times. # Essentials -setuptools >= 34.4 +setuptools >= 61.2 # Plugins setuptools-scm[toml] >= 7.0.0 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 40573a7afd..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,91 +0,0 @@ -[bdist_wheel] -# NOTE: "universal = 1" causes `bdist_wheel` to create a wheel that with the -# NOTE: tag "py2.py3" which implies (and tricks pip into thinking) that this -# NOTE: wheel contains Python 2 compatible code. This is not true and conflicts -# NOTE: with the "Requires-Python" field in the metadata that says that we only -# NOTE: support Python 3.6+. -# NOTE: We need to keep it at "0" which will produce wheels tagged with "py3" -# NOTE: when built under Python 3. -# Ref: https://github.com/pypa/packaging.python.org/issues/726 -universal = 0 - -[metadata] -name = cheroot -url = https://cheroot.cherrypy.dev -project_urls = - Chat: Matrix = https://matrix.to/#/#cherrypy-space:matrix.org - CI: GitHub = https://github.com/cherrypy/cheroot/actions - Docs: RTD = https://cheroot.cherrypy.dev - GitHub: issues = https://github.com/cherrypy/cheroot/issues - GitHub: repo = https://github.com/cherrypy/cheroot - Tidelift: funding = https://tidelift.com/subscription/pkg/pypi-cheroot?utm_source=pypi-cheroot&utm_medium=referral&utm_campaign=pypi -description = Highly-optimized, pure-python HTTP server -long_description = file: README.rst -long_description_content_type = text/x-rst -author = CherryPy Team -author_email = team@cherrypy.dev -license_files = - LICENSE.md -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Web Environment - Intended Audience :: Developers - Operating System :: OS Independent - Framework :: CherryPy - License :: OSI Approved :: BSD License - Programming Language :: Python - Programming Language :: Python :: 3 - 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 :: Implementation - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: Jython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Internet :: WWW/HTTP - Topic :: Internet :: WWW/HTTP :: HTTP Servers - Topic :: Internet :: WWW/HTTP :: WSGI - Topic :: Internet :: WWW/HTTP :: WSGI :: Server - Typing :: Typed -keywords = - http - server - ssl - wsgi - -[options] -use_scm_version = True -python_requires = >=3.8 -packages = find: -include_package_data = True - -# These are required during `setup.py` run: -setup_requires = - setuptools_scm >= 7.0.0 - -# These are required in actual runtime: -install_requires = - more_itertools >= 2.6 - jaraco.functools - -[options.extras_require] -docs = - # upstream - sphinx>=1.8.2 - jaraco.packaging>=3.2 - sphinx-tabs>=1.1.0 - - # local - furo - # `scm_tag_titles_ext` extension dep in docs/ - python-dateutil - sphinxcontrib-apidoc>=0.3.0 - -[options.entry_points] -console_scripts = - cheroot = cheroot.cli:main - -[options.package_data] -cheroot = py.typed diff --git a/setup.py b/setup.py deleted file mode 100644 index 22e9bf3af5..0000000000 --- a/setup.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -"""Cheroot package setuptools installer.""" - -import setuptools - -if __name__ == '__main__': - setuptools.setup(use_scm_version=True)