-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to packaging for parsing metadata and support metadata 2.4 #1180
Open
dnicolodi
wants to merge
6
commits into
pypa:main
Choose a base branch
from
dnicolodi:packaging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
This comment was marked as outdated.
This comment was marked as outdated.
dnicolodi
force-pushed
the
packaging
branch
3 times, most recently
from
November 24, 2024 01:02
60ba024
to
adc9f2e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
dnicolodi
force-pushed
the
packaging
branch
3 times, most recently
from
November 25, 2024 23:21
3bc839b
to
d727449
Compare
dnicolodi
changed the title
Switch from pkginfo to packaging for parsing distribution metadata
Switch to packaging for parsing metadata and support metadata 2.4
Nov 25, 2024
I've reviewed what I could imagine adding some more metadata validation on top, similar to what |
The packaging package is maintained by the PyPA and it is the de-facto reference implementation for the packaging standards. Using packaging for parsing metadata guarantees support for the latest metadata versions. warehouse, the Python package index implementation used by PyPI, also uses packaging for parsing metadata. This guarantees that metadata parsing is the same on the client and server side, for the most prominent index.
It was done in the support code for the wheel file format but it affects metadata loading from all supported distribution types. Move it to generic code.
When any of the glob patterns specified in the provisional field "license-files" in the "tool.setuptools" section in pyproject.toml matches a file in the package, Setuptools emits a License-File metadata entry. However, Setuptools sets the Metadata-Version to 2.1. With the implementation of PEP 639 and metadata version 2.4, this combination is now invalid and is rejected by packaging, and thus by PyPI. Reset tools.setuptools.license-files to do not match any file. This prevents invalid metadata to be generated.
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.
The
packaging
package is maintained by the PyPA and it is the de-facto reference implementation for the packaging standards. Usingpackaging
for parsing metadata guarantees support for the latest metadata versions.warehouse
, the Python package index implementation used by PyPI, also usespackaging
for parsing metadata. This guarantees that metadata parsing is the same on the client and server side, for the most prominent index.