Skip to content

Commit

Permalink
Merge pull request #690 from cherrypy/feature/pep-621
Browse files Browse the repository at this point in the history
📝 Switch packaging metadata to use PEP 621

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.

`jaraco.packaging` also had to be bumped @ the Sphinx lock files as
this is apparently necessary to get the `jaraco.packaging.sphinx`
Sphinx extension to stop calling `setup.py` directly, which is
deprecated and is being removed from the ecosystem.

The update is recorded in the `packaging` category of the changelog,
keeping in mind that the downstreams would the ones to care
about this change the most.

Co-authored-by: Sviatoslav Sydorenko <[email protected]>
  • Loading branch information
webknjaz authored Apr 23, 2024
2 parents 2d63ec2 + 0b75287 commit 808ce78
Show file tree
Hide file tree
Showing 20 changed files with 875 additions and 237 deletions.
9 changes: 9 additions & 0 deletions docs/changelog-fragments.d/690.packaging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The packaging metadata has been migrated to the
:file:`pyproject.toml`-based :pep:`621` declaration
-- by :user:`jaraco` and :user:`webknjaz`.

As a part of this update, the minimum version of the
``setuptools`` build backend was bumped to 61.2.
Moreover, any compatibility shims that existed in
:file:`setup.cfg` and :file:`setup.py` have been
removed for good.
78 changes: 77 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,87 @@
# 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"
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.authors]]
name = "CherryPy Team"
email = "[email protected]"

[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]
2 changes: 1 addition & 1 deletion requirements/dist-build-constraints.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# NOTE: at all times.

# Essentials
setuptools >= 34.4
setuptools >= 61.2

# Plugins
setuptools-scm[toml] >= 7.0.0
Expand Down
8 changes: 4 additions & 4 deletions requirements/tox-build-docs-cp310-linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp310-linux-x86_64.txt --strip-extras requirements/tox-build-docs-cp310-linux-x86_64.in setup.cfg
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp310-linux-x86_64.txt --strip-extras pyproject.toml requirements/tox-build-docs-cp310-linux-x86_64.in
#
alabaster==0.7.16
# via sphinx
Expand Down Expand Up @@ -71,10 +71,10 @@ jaraco-context==4.3.0
# jaraco-text
jaraco-functools==4.0.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# jaraco-text
# tempora
jaraco-packaging==9.5.0
jaraco-packaging==10.1.0
# via -r requirements/tox-build-docs-cp310-linux-x86_64.in
jaraco-text==3.12.0
# via -r requirements/tests.in
Expand All @@ -90,7 +90,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# inflect
# jaraco-functools
# jaraco-text
Expand Down
8 changes: 4 additions & 4 deletions requirements/tox-build-docs-cp311-linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp311-linux-x86_64.txt --strip-extras requirements/tox-build-docs-cp311-linux-x86_64.in setup.cfg
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp311-linux-x86_64.txt --strip-extras pyproject.toml requirements/tox-build-docs-cp311-linux-x86_64.in
#
alabaster==0.7.16
# via sphinx
Expand Down Expand Up @@ -71,10 +71,10 @@ jaraco-context==4.3.0
# jaraco-text
jaraco-functools==4.0.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# jaraco-text
# tempora
jaraco-packaging==9.5.0
jaraco-packaging==10.1.0
# via -r requirements/tox-build-docs-cp311-linux-x86_64.in
jaraco-text==3.12.0
# via -r requirements/tests.in
Expand All @@ -90,7 +90,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# inflect
# jaraco-functools
# jaraco-text
Expand Down
8 changes: 4 additions & 4 deletions requirements/tox-build-docs-cp312-linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp312-linux-x86_64.txt --strip-extras requirements/tox-build-docs-cp312-linux-x86_64.in setup.cfg
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp312-linux-x86_64.txt --strip-extras pyproject.toml requirements/tox-build-docs-cp312-linux-x86_64.in
#
alabaster==0.7.16
# via sphinx
Expand Down Expand Up @@ -71,10 +71,10 @@ jaraco-context==4.3.0
# jaraco-text
jaraco-functools==4.0.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# jaraco-text
# tempora
jaraco-packaging==9.5.0
jaraco-packaging==10.1.0
# via -r requirements/tox-build-docs-cp312-linux-x86_64.in
jaraco-text==3.12.0
# via -r requirements/tests.in
Expand All @@ -90,7 +90,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# inflect
# jaraco-functools
# jaraco-text
Expand Down
8 changes: 4 additions & 4 deletions requirements/tox-build-docs-cp313-linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp313-linux-x86_64.txt --strip-extras requirements/tox-build-docs-cp313-linux-x86_64.in setup.cfg
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp313-linux-x86_64.txt --strip-extras pyproject.toml requirements/tox-build-docs-cp313-linux-x86_64.in
#
alabaster==0.7.16
# via sphinx
Expand Down Expand Up @@ -71,10 +71,10 @@ jaraco-context==4.3.0
# jaraco-text
jaraco-functools==4.0.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# jaraco-text
# tempora
jaraco-packaging==9.5.0
jaraco-packaging==10.1.0
# via -r requirements/tox-build-docs-cp313-linux-x86_64.in
jaraco-text==3.12.0
# via -r requirements/tests.in
Expand All @@ -90,7 +90,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# inflect
# jaraco-functools
# jaraco-text
Expand Down
8 changes: 4 additions & 4 deletions requirements/tox-build-docs-cp38-linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp38-linux-x86_64.txt --strip-extras requirements/tox-build-docs-cp38-linux-x86_64.in setup.cfg
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp38-linux-x86_64.txt --strip-extras pyproject.toml requirements/tox-build-docs-cp38-linux-x86_64.in
#
alabaster==0.7.13
# via sphinx
Expand Down Expand Up @@ -81,10 +81,10 @@ jaraco-context==4.3.0
# jaraco-text
jaraco-functools==4.0.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# jaraco-text
# tempora
jaraco-packaging==9.5.0
jaraco-packaging==10.1.0
# via -r requirements/tox-build-docs-cp38-linux-x86_64.in
jaraco-text==3.12.0
# via -r requirements/tests.in
Expand All @@ -100,7 +100,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# inflect
# jaraco-functools
# jaraco-text
Expand Down
8 changes: 4 additions & 4 deletions requirements/tox-build-docs-cp39-linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp39-linux-x86_64.txt --strip-extras requirements/tox-build-docs-cp39-linux-x86_64.in setup.cfg
# pip-compile --allow-unsafe --output-file=requirements/tox-build-docs-cp39-linux-x86_64.txt --strip-extras pyproject.toml requirements/tox-build-docs-cp39-linux-x86_64.in
#
alabaster==0.7.16
# via sphinx
Expand Down Expand Up @@ -78,10 +78,10 @@ jaraco-context==4.3.0
# jaraco-text
jaraco-functools==4.0.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# jaraco-text
# tempora
jaraco-packaging==9.5.0
jaraco-packaging==10.1.0
# via -r requirements/tox-build-docs-cp39-linux-x86_64.in
jaraco-text==3.12.0
# via -r requirements/tests.in
Expand All @@ -97,7 +97,7 @@ mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
# via
# cheroot (setup.cfg)
# cheroot (pyproject.toml)
# inflect
# jaraco-functools
# jaraco-text
Expand Down
2 changes: 1 addition & 1 deletion requirements/tox-docs.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r tests.in # `sphinxcontrib-autodoc` will import all the files

Sphinx >= 1.8.2
jaraco.packaging >= 3.2
jaraco.packaging >= 9 # first version to load meta through PEP 517 interface
sphinx-tabs >= 1.1.0

furo
Expand Down
Loading

0 comments on commit 808ce78

Please sign in to comment.