-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Preserve original PKG-INFO
contents when creating wheel (instead of calling wheel.metadata.pkginfo_to_metadata
)
#4701
base: main
Are you sure you want to change the base?
Conversation
PKG-INFO
contents when creating wheel (instead of calling wheel.metadata.pkginfo_to_metadata
)PKG-INFO
contents when creating wheel (instead of calling wheel.metadata.pkginfo_to_metadata
)
2924da8
to
9841171
Compare
@agronholm do you have any reservations regarding this approach? |
If I understood this correctly, then it's fine by me. It's about time we start ditching the awkward conversion code from egg-info metadata. The only thing preventing me from advancing this myself is mental exhaustion. |
I will wait to see the assessment on #4698 before merging the PR. |
Given that the |
a8e0012
to
a465e30
Compare
There are 2 aspects to this question. The first one is the existence of The second aspect is that this PR in some way is a step towards generating proper 2.4 metadata directly. What I plan in #4698 is to change |
This seems to be a necessary step towards implementing new versions of metadata (e.g. PEP 685).
As pointed out in #4698, even if we modify
setuptools
to emit new versions of the metadata,pypa/wheel
still hardcodes version 2.1, which can be problematic.The good news is that recently
setuptools
has started emitting valid and complete 2.1 metadata on its own (seesetuptools/_core_metadata.py
). This PR assumes that it is OK just to reuse the file generated by setuptools without any need to post-process it inbdist_wheel
.Summary of changes
test_core_metadata
to ensure the generatedPKG-INFO
is compatible with standards forMETADATA
.PKG-INFO
of real-world configuration scenarios, makimg sure they are compatible withwheel.metadata.pkginfo_to_metadata
.PKG-INFO
to make sure they "round-trip" when subject to the parsing and serialisation methods used bypypa/wheel
.setuptools.command.bdist_wheel
to simply re-use the already generatedPKG-INFO
.Closes
Limitations
There are "minor" differences between
METADATA
generated bypypa/wheel
andPKG-INFO
generated bysetuptools
:I believe that an acceptable level of normalisation, fully compliant with the spec, will be "automatically" achieved once pypa/packaging#845 and pypa/packaging#644 (comment) are handled1.
Pull Request Checklist
newsfragments/
.(See documentation for details)
Footnotes
Right now, the specs mandate the extras to be normalised, but not the name. Setuptools relies on
packaging
for the normalisation, so once the potential bug in https://github.com/pypa/packaging/issues/845 is solved, it will be compliant to the spec. Ifpackaging
introduces names normalisation we will also adopt it. ↩