Skip to content

fix: migrate project.license to SPDX expression (#260)#261

Open
patchwright wants to merge 1 commit into
WhyNotHugo:mainfrom
patchwright:fix/pep639-license-metadata
Open

fix: migrate project.license to SPDX expression (#260)#261
patchwright wants to merge 1 commit into
WhyNotHugo:mainfrom
patchwright:fix/pep639-license-metadata

Conversation

@patchwright

Copy link
Copy Markdown

Problem

Fixes #260. Building with setuptools >=77 emits two deprecation warnings: project.license as a TOML table, and the License :: OSI Approved :: MIT License trove classifier. Both point at the PEP 639 migration. Confirmed on main HEAD 1d872d3.

Root cause

pyproject.toml uses the PEP 621 table form license = { text = "MIT" } and also lists the License :: classifier. setuptools 77.0.0 (PEP 639) deprecates both in favour of an SPDX string expression.

Fix

  • license = { text = "MIT" } -> license = "MIT" (SPDX expression)
  • drop the License :: OSI Approved :: MIT License classifier
  • bump build-system setuptools>=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:

$ python -m build
SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated ...
SetuptoolsDeprecationWarning: License classifiers are deprecated.
  License :: OSI Approved :: MIT License

After:

$ python -m build
adding license file 'LICENCE'      # no license/classifier deprecation warnings

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)

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong licence classifiers

1 participant