Skip to content

Commit 9be5b88

Browse files
Update the build-system requirements; resolve warnings and errors (#327)
* Update the build-system requirements; resolve warnings and errors # The current situation The current build-system requires setuptools 40.8.0 or higher. However, setuptools v40.8.0 doesn't have a `build_meta` submodule. To demonstrate the problem, the following commands were run: ``` python3.13 -m venv venv-3.13 source venv-3.13/bin/activate python -m pip install setuptools==40.8.0 build python -m build --no-isolation ``` This results in the following error message: ``` $ python -m build --no-isolation * Getting build dependencies for sdist... Traceback (most recent call last): File ".../lib/python3.13/site-packages/pyproject_hooks/_impl.py", line 402, in _call_hook raise BackendUnavailable( ...<4 lines>... ) pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta' ERROR Backend 'setuptools.build_meta' is not available. ``` Upgrading to the latest version of setuptools, 80.9.0, allows the package to build: ``` python -m pip install --upgrade setuptools python -m build --no-isolation ``` However, warnings are emitted: ``` SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** ``` ``` SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: Apache Software License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** ``` # The solution This change addresses the lower setuptools bound based on the warnings: it sets the setuptools minimum version to v77.0.1 (v77.0.0 was not released to PyPI). In addition, it addresses the license-related warnings by switching to the SPDX short identifier `"Apache-2.0"` and by removing the `License` trove classifier. With this change in place, the package can be built on the lowest supported setuptools version as well as the latest released version. * Feedback: Require `setuptools>=77.0.3` From the PR comment: > 77.0.3 fixes known early bugs of the PEP 639 implementation --------- Co-authored-by: Mike Fiedler <miketheman@gmail.com>
1 parent d047a29 commit 9be5b88

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ authors = [
66
{name = "The Python Packaging Authority", email = "admin@mail.pypi.org"}
77
]
88
readme = "README.rst"
9-
license = {text = "Apache License, Version 2.0"}
9+
license = "Apache-2.0"
1010
dependencies = [
1111
"nh3>=0.2.14",
1212
"docutils>=0.21.2",
1313
"Pygments>=2.5.1",
1414
]
1515
classifiers = [
1616
"Intended Audience :: Developers",
17-
"License :: OSI Approved :: Apache Software License",
1817
"Natural Language :: English",
1918
"Operating System :: MacOS :: MacOS X",
2019
"Operating System :: POSIX",
@@ -48,7 +47,7 @@ exclude = ["tests", "tests.*"]
4847
Home-page = "https://github.com/pypa/readme_renderer"
4948

5049
[build-system]
51-
requires = ["setuptools>=40.8.0"]
50+
requires = ["setuptools>=77.0.3"]
5251
build-backend = "setuptools.build_meta"
5352

5453

0 commit comments

Comments
 (0)