Skip to content
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

Implement PEP 639, Metadata 2.4 #16949

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Implement PEP 639, Metadata 2.4 #16949

wants to merge 14 commits into from

Conversation

ewdurbin
Copy link
Member

@ewdurbin ewdurbin commented Oct 22, 2024

Depends on merge/release of pypa/packaging#828

Closes #16620

TODO: Move to release of packaging with license-expression parser

Copy link
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

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

Looking cool, and coming along nicely! I commented a bit inside.

One thing I'm curious about - at what point should we be looking to consolidate any file operations where we pop open the file and read stuff from it, so we only have to open/iterate once?

warehouse/packaging/models.py Outdated Show resolved Hide resolved
warehouse/forklift/legacy.py Outdated Show resolved Hide resolved
…rectory" from PEP 639

> The directory under which license files are stored in a project source tree, distribution archive or installed project. Also, the root directory that their paths recorded in the License-File Core Metadata field are relative to. Defined to be the project root directory for a project source tree or source distribution; and a subdirectory named licenses of the directory containing the built metadata— i.e., the .dist-info/licenses directory— for a Built Distribution or installed project.
@ewdurbin
Copy link
Member Author

ewdurbin commented Oct 23, 2024

One thing I'm curious about - at what point should we be looking to consolidate any file operations where we pop open the file and read stuff from it, so we only have to open/iterate once?

I thought about this a little and can imagine an approach of stashing a list of filenames when we iterate through to in _is_valid_dist_file, and fetching any files we actually need to read... at the moment that would only be .dist-info/METADATA. I wonder if a simple utility class wrapper that does this on __init__ would allow for us to make calls to get_wheel_metadata and contains or something would work... will poke a bit.

Edit: On second consideration... nearly all file uploads are dominated by either the advisory lock on journals or s3.putobject. Not sure this optimization is worth the effort at this point.

@ewdurbin
Copy link
Member Author

@befeleme would you be able to take a look at this to review the implementation details?

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.

Implement PEP 639
2 participants