Skip to content

Don't normalize distribution filenames #123

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

Closed
di opened this issue May 14, 2025 · 0 comments · Fixed by #124
Closed

Don't normalize distribution filenames #123

di opened this issue May 14, 2025 · 0 comments · Fixed by #124

Comments

@di
Copy link
Contributor

di commented May 14, 2025

So, PyPI is behaving as expected, but something between the attestation generation step and the upload step is renaming the wheel files with compressed tag sets. @webknjaz @woodruffw does that ring any bells?

I think this is product of some last-second normalization within pypi-attestations: pypi-attestations "ultranormalizes" the distribution's filename by ordering the compressed tag set if present, since that's the one part of the wheel filename specification that isn't already canonical.

That happens here:

def _ultranormalize_dist_filename(dist: str) -> str:

In practice this is strictly superfluous, since PEP 740 says that attestation verification is done by comparing the subject (i.e. dist filename) by parsing, rather than assuming string equality. So, we could probably remove this entirely 🙂

TL:DR: This is probably happening in pypi-attestations and can be removed without breakage, since it's a conservative step beyond what PEP 740 requires. At the same time, I'm curious how it got surfaced here since the "ultranormalized" form only occurs within the attestation itself, while PyPI uses the form that it receives.

Originally posted by @woodruffw in #18128

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 a pull request may close this issue.

1 participant