Skip to content

docs: clarify PEP 639 license fields and setuptools minimum - #2143

Open
harshitethic wants to merge 3 commits into
pypa:mainfrom
harshitethic:docs/1854-clarify-pep639-fields
Open

harshitethic wants to merge 3 commits into
pypa:mainfrom
harshitethic:docs/1854-clarify-pep639-fields

Conversation

@harshitethic

@harshitethic harshitethic commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clarify two ambiguities in the license / license-files guidance.

  • explain that PEP 639 defines two independent fields with different roles rather than requiring both together
  • correct the setuptools version that introduced SPDX project.license and project.license-files support to 77.0.0
  • make clear these are historical first-support versions, not versions users should pin today

Fixes #1854.


📚 Documentation preview 📚: https://python-packaging-user-guide--2143.org.readthedocs.build/en/2143/

Comment on lines +326 to +327
:pep:`639` defines two fields for modern license metadata. They serve
different purposes and can be used independently:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As PEP 639 itself says, the canonical specification is at https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata, which is what should be linked instead of PEP639 I believe. Maybe it would make sense to change this in the scope of this pull request?

@harshitethic

Copy link
Copy Markdown
Contributor Author

Updated the requested spec links in commit f073eec: the backend-support table and its explanation now refer to the canonical Core Metadata license fields, using the existing <core-metadata-license> cross-reference rather than calling PEP 639 the specification. This follows the review note. AI-assisted edit; full documentation build not yet run.

@rgommers rgommers added type: bug A confirmed bug or unintended behavior component: guides labels Nov 10, 2026

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @harshitethic, this looks reasonable but please address review comments. In addition, I noticed a footnote for flit in that same table about not supporting WITH clauses in SPDX expressions that is no longer accurate - can you remove that as well?

- uv-build
* - 1.27.0
- 77.0.3
- 77.0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1854 (comment) is correct, this change is undesirable.

---------------------------------

As per :pep:`639`, licenses should be declared with two fields:
The :ref:`Core Metadata specification <core-metadata-license>` defines two fields

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This links to the deprecated License field rather than to License-Expression. Please link to the latter.

Comment on lines +332 to +333
- ``license-files`` declares the license and other legal files that should be
included in distribution metadata, using a list of glob patterns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a very accurate sentence I think, since the files get included in distribution archives rather than in distribution metadata.

Suggested change
- ``license-files`` declares the license and other legal files that should be
included in distribution metadata, using a list of glob patterns.
- ``license-files`` specifies glob patterns matching license files and other
legal notices to include in distribution archives.

@rgommers

Copy link
Copy Markdown
Contributor

Also please update the PR title, since the setuptools minimum shouldn't be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: guides type: bug A confirmed bug or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minor issues in writing-pyproject-toml

3 participants