fix: migrate project.license to SPDX expression (#260)#261
Open
patchwright wants to merge 1 commit into
Open
Conversation
Drop the deprecated License :: trove classifier and switch project.license from the PEP 621 table form to an SPDX string expression, silencing the setuptools >=77 deprecation warnings. Bump build-system to setuptools>=77 as required by the SPDX string form (PEP 639).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #260. Building with setuptools >=77 emits two deprecation warnings:
project.licenseas a TOML table, and theLicense :: OSI Approved :: MIT Licensetrove classifier. Both point at the PEP 639 migration. Confirmed on main HEAD 1d872d3.Root cause
pyproject.tomluses the PEP 621 table formlicense = { text = "MIT" }and also lists theLicense ::classifier. setuptools 77.0.0 (PEP 639) deprecates both in favour of an SPDX string expression.Fix
license = { text = "MIT" }->license = "MIT"(SPDX expression)License :: OSI Approved :: MIT Licenseclassifiersetuptools>=61->>=77(the SPDX string form needs >=77; the warning itself notes "available on setuptools>=77.0.0")Metadata only; no runtime change.
How to test
Before:
After:
Full suite: 47 passed.
Backward compatibility
Build floor moves to setuptools >=77 (compatible with
requires-python >= 3.9; setuptools 77 supports 3.9+). Runtime unchanged. pip build isolation already resolves >=77.Assisted-by: Claude (code generation, reviewed and tested locally)