-
Notifications
You must be signed in to change notification settings - Fork 210
pyproject.toml: use non-deprecated license specification #1687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
pyproject.toml: use non-deprecated license specification #1687
Conversation
Fixes these deprecation warnings during `python -m build`: env/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: 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. ******************************************************************************** !! env/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! Signed-off-by: Bastian Krause <[email protected]>
e2128eb
to
e97065f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #1687 +/- ##
======================================
Coverage 55.6% 55.6%
======================================
Files 172 172
Lines 13466 13466
======================================
Hits 7492 7492
Misses 5974 5974
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -1,7 +1,7 @@ | |||
[build-system] | |||
# Minimum requirements for the build system to execute. | |||
requires = [ | |||
"setuptools>=47.2.0", | |||
"setuptools>=77.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid this? For example, Debian stable only has 66.1.1 (77.0 was released in March 2025).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how. On 2026-Feb-18 we won't be able to prepare builds with the setuptools version released then (see deprecation warning above). The migration phase is pretty short. Maybe we should postpone merging this PR until beginning of 2026?
There's also discussion here pypa/setuptools#4903, including comments pointing to distro versions of setuptools pypa/setuptools#4903 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets postpone this a bit and see how this evolves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I've converted this into a draft, so it won't be merged yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would switching build systems be an option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there alternatives that are widely available in binary distributions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fond of hatch/hatchling
, which it seems is available at least for Debian 12 and Fedora 42, although the versions differ significantly:
Debian 12:
(labgrid-venv) tgamblin@ecogrid:~/labgrid$ apt info python3-hatchling
Package: python3-hatchling
Version: 1.12.2-1
Priority: optional
Section: python
Source: hatchling
Maintainer: Debian Python Team <[email protected]>
Installed-Size: 401 kB
Depends: python3-importlib-metadata | python3 (>> 3.8), python3-packaging, python3-pathspec (>= 0.10), python3-pluggy, python3-tomli | python3 (>> 3.11), python3:any
Homepage: https://hatch.pypa.io/
Download-Size: 53.6 kB
APT-Sources: http://deb.debian.org/debian bookworm/main amd64 Packages
Description: Python package build backend used by Hatch
This is the extensible, standards compliant build backend used by Hatch.
.
It may be required to build a Python module from source.
Fedora 42:
tgamblin@megalith ~ $ dnf info python3-hatchling
Updating and loading repositories:
Repositories loaded.
Available packages
Name : python3-hatchling
Epoch : 0
Version : 1.27.0
Release : 2.fc42
Architecture : noarch
Download size : 220.8 KiB
Installed size : 604.2 KiB
Source : python-hatchling-1.27.0-2.fc42.src.rpm
Repository : fedora
Summary : The build backend used by Hatch
URL : https://pypi.org/project/hatchling
License : MIT
Description : This is the extensible, standards compliant build backend used by Hatch.
Vendor : Fedora Project
They also have a page comparing against setuptools. I can see flit
in the package repositories as well, but I'd have to do a bit more research on it and other backends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how. On 2026-Feb-18 we won't be able to prepare builds with the setuptools version released then (see deprecation warning above). The migration phase is pretty short. Maybe we should postpone merging this PR until beginning of 2026?
There's also discussion here pypa/setuptools#4903, including comments pointing to distro versions of setuptools pypa/setuptools#4903 (comment).
Why is the version bump actually needed?
@@ -15,7 +15,8 @@ authors = [ | |||
] | |||
description = "embedded systems control library for development, testing and installation" | |||
readme = "README.rst" | |||
license = { file="LICENSE" } | |||
license = "LGPL-2.0-or-later" | |||
license-files = ["LICENSE"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines look good
@@ -1,7 +1,7 @@ | |||
[build-system] | |||
# Minimum requirements for the build system to execute. | |||
requires = [ | |||
"setuptools>=47.2.0", | |||
"setuptools>=77.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how. On 2026-Feb-18 we won't be able to prepare builds with the setuptools version released then (see deprecation warning above). The migration phase is pretty short. Maybe we should postpone merging this PR until beginning of 2026?
There's also discussion here pypa/setuptools#4903, including comments pointing to distro versions of setuptools pypa/setuptools#4903 (comment).
Why is the version bump actually needed?
Description
Fixes these deprecation warnings during
python -m build
:Checklist