Skip to content

Core Metadata: Remove line suggesting metadata produces should use outdated versions - #1063

Closed
CAM-Gerlach wants to merge 1 commit into
python:mainfrom
CAM-Gerlach:core-metadata-rm-lower-version
Closed

CAM-Gerlach wants to merge 1 commit into
python:mainfrom
CAM-Gerlach:core-metadata-rm-lower-version

Conversation

@CAM-Gerlach

@CAM-Gerlach CAM-Gerlach commented Mar 14, 2022 •

Copy link
Copy Markdown
Member

Presently, the Metadata-Version section of the core metadata spec states:

For broader compatibility, build tools MAY choose to produce distribution metadata using the lowest metadata version that includes all of the needed fields.

Following discussion on PEP 685's thread and related conversations on metadata-version, it seemed prudent to simply remove this; per @pfmoore

I would prefer to drop the quoted statement, and let the whole thing come under the “be strict in what you produce and lenient in what you consume” principle, so that metadata producers should always produce the latest version that they can, and consumers should be capable of dealing with older versions.

PEP 609 in turn delegates to the the PyPA Specifications document, which states:

All enhancements proposed this way must be discussed on the Packaging category of the Python.org Discourse prior to amending the PEP

I opened a thread on the packaging discourse to gather consensus and any objections to this change.

@CAM-Gerlach CAM-Gerlach changed the title Core Metadata: Rm line allowing metadata producers to use lower versions Core Metadata: Remove line suggesting metadata produces should use outdated versions Mar 14, 2022

@merwok merwok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One approval on the forum, no opposition.

PR title typo: producers*

@brettcannon

Copy link
Copy Markdown
Member

@CAM-Gerlach is this still a draft?

@rgommers rgommers added the type: enhancement A self-contained enhancement or new feature label 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.

This got only one response on DPO, but it looks like an outright bad idea to me based on recent experience - build backends bumping too quickly to the latest Core Metadata version can reduce in unnecessary incompatibility with older tools (uploaders, index servers, etc.). twine is known to take a long time to update for example; for index servers folks will look at PyPI having enabled support; other index servers are likely to move much slower. Etc. IIRC for Core Metadata 2.5, hatch updated immediately and this resulted in problems. I know meson-python does use the more conservative option here, and it works perfectly fine.

I also don't see any good rationale here. So I suggest to just close this PR and leave things as they are. I'll post the same on DPO in case anyone disagrees.

@dnicolodi

Copy link
Copy Markdown

To clarify, meson-python inherits the behavior of using the earliest version of the metadata sufficient to represent what the package describes in pyproject.toml from pyproject-metadata. I also think this behavior is desirable: there are no benefits in using a later metadata version if an earlier version can represent all information.

This works because, so far, all metadata format updates have been additions to the specification. In presence of metadata format changes that modify how information should be encoded or interpreted, deriving the most appropriate metadata version from the data to be encoded is not possible anymore and a the tool encoding the metadata needs to make a choice.

@rgommers

Copy link
Copy Markdown
Contributor

@rgommers

Copy link
Copy Markdown
Contributor

Closing as my proposed rejection of this change on DPO received enough positive and no negative feedback after two weeks. Including from Paul Moore, who originally proposed this change.

@rgommers rgommers closed this Nov 24, 2026
@rgommers

Copy link
Copy Markdown
Contributor

Thanks for taking up that suggested change and writing the RFC though @CAM-Gerlach!

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

Labels

component: specifications type: enhancement A self-contained enhancement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants