-
Notifications
You must be signed in to change notification settings - Fork 83
[PULP-1200] Fix edge case when creating metadata file #1102
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
|
|
||
| def extract_wheel_metadata(filename: str) -> bytes | None: | ||
| def extract_non_normalized_pkg_name_with_version( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not found any function that already handles "de-normalization" so I created this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, will packaging.utils.parse_wheel_filename not work here?
gerrod3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I'm comfortable with this regex parsing. I feel there has to be a library we can use to find the file name.
Some questions:
- The name in the metadata file doesn't have to be normalized (I think). Modern packages should be but old ones like some in our fixtures have mismatches. But does the name(path) of the metadata file have to be normalized?
pkg_info.wheeltakes the list of all the files in the wheel and tries to find the shortest path to a METADATA file. Is this the correct method we should copy? Seems kind of crazy, is there always a guaranteed that the main package will have the shortest path for its METADATA?- Do any of our packages in our fixtures have multiple metadata files? Can we find one for the tests?
|
|
||
|
|
||
| def extract_wheel_metadata(filename: str) -> bytes | None: | ||
| def extract_non_normalized_pkg_name_with_version( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, will packaging.utils.parse_wheel_filename not work here?
fixes #1101
📜 Checklist
See: Pull Request Walkthrough