Skip to content

Conversation

@jobselko
Copy link
Contributor

fixes #1101

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@jobselko jobselko self-assigned this Feb 12, 2026


def extract_wheel_metadata(filename: str) -> bytes | None:
def extract_non_normalized_pkg_name_with_version(
Copy link
Contributor Author

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.

Copy link
Contributor

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?

@jobselko jobselko marked this pull request as ready for review February 12, 2026 18:49
@jobselko jobselko requested a review from gerrod3 February 12, 2026 18:50
Copy link
Contributor

@gerrod3 gerrod3 left a 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:

  1. 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?
  2. pkg_info.wheel takes 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?
  3. 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(
Copy link
Contributor

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?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata file does not match the wheel metadata (PEP 658)

2 participants