Skip to content

Use a SPDX expression for project.license - #40

Merged
shimwell merged 1 commit into
mainfrom
spdx-license
Aug 19, 2026
Merged

Use a SPDX expression for project.license#40
shimwell merged 1 commit into
mainfrom
spdx-license

Conversation

@shimwell

Copy link
Copy Markdown
Member

Follow up to #39. The build warns:

Please use a simple string containing a SPDX expression for project.license ... By 2027-Feb-18, you need to update your project

Moves to the PEP 639 form:

  • license = "MIT" instead of the {file = "LICENSE"} table
  • license-files = ["LICENSE"] so the LICENSE file is still shipped, the table form was doing that implicitly
  • drops the License :: OSI Approved :: MIT License classifier, setuptools raises an error if a license expression and a license classifier are both given
  • bumps the build requirement to setuptools >= 77.0.3, which is where SPDX expression support landed

The built wheel now has Metadata-Version: 2.4, License-Expression: MIT and License-File: LICENSE, with no deprecation warnings and twine check passing on the wheel and sdist.

Two notes on the toolchain. Uploading Metadata 2.4 needs twine 6.1 or newer, the publish workflow installs the latest twine so it is fine. And setuptools 77 needs Python 3.9+ to build, which does not change the requires-python = ">=3.8" floor for installing.

setuptools warns that the table form of project.license is deprecated
and needs to be a SPDX string by 2027-Feb-18. Switch to the PEP 639
form, which means license = "MIT", an explicit license-files entry to
keep shipping the LICENSE file, and dropping the now superseded license
classifier, setuptools errors if both are given.

SPDX license expressions need setuptools 77.0.3 or newer, so bump the
build requirement.

The built wheel now has Metadata-Version 2.4 with License-Expression:
MIT and License-File: LICENSE, and builds with no deprecation warnings.
@shimwell
shimwell merged commit f334eb8 into main Aug 19, 2026
3 checks passed
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.

1 participant