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

Allow non-nested archives for hexdump and others #1564

Merged
merged 1 commit into from
Feb 17, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary#1562

It turns out that hexdump uses an invalid source distribution format whereby the contents aren't nested in a top-level directory -- instead, they're all just flattened at the top-level. In looking at pip's source (https://github.com/pypa/pip/blob/51de88ca6459fdd5213f86a54b021a80884572f9/src/pip/_internal/utils/unpacking.py#L62), it only strips the top-level directory if all entries have the same directory prefix (i.e., if it's the only thing in the directory). This PR accommodates these "invalid" distributions.

I can't find any history on this method in pip. It looks like it dates back over 15 years ago, to before pip was even called pip.

Closes #1376.

@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Feb 17, 2024
@charliermarsh charliermarsh merged commit 340cb67 into main Feb 17, 2024
7 checks passed
@charliermarsh charliermarsh deleted the charlie/hexdump branch February 17, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv pip install hexdump==3.3 fails: The top level of the archive must only contain a list directory
2 participants