Bug: `parse_wheel_filenames` accepts wheel filenames with unsorted compressed tag sets · Issue #909 · pypa/packaging · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm filing this as a bug report for some observed behavior.
TL;DR: parse_wheel_filename appears to allow compressed tag sets (defined in PEP 425) to appear in any order, while the PEP and living spec both require the order to be "sorted" (my emphasis below):
To allow for compact filenames of bdists that work with more than one compatibility tag triple, each tag in a filename can instead be a ‘.’-separated, sorted, set of tags. For example, pip, a pure-Python package that is written to run under Python 2 and 3 with the same source code, could distribute a bdist with the tag py2.py3-none-any.
packaging doesn't warn or fail with the new wheel distribution name, per this bug report;
pypi-attestations then "ultranormalized" the wheel name for signing purposes, fixing it up to pyvirtualcam-0.13.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Hello
packaging
maintainers!I'm filing this as a bug report for some observed behavior.
TL;DR:
parse_wheel_filename
appears to allow compressed tag sets (defined in PEP 425) to appear in any order, while the PEP and living spec both require the order to be "sorted" (my emphasis below):(Permalinks: https://peps.python.org/pep-0425/#compressed-tag-sets and https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#compressed-tag-sets)
This can be seen by using
parse_wheel_filename
to parse a wheel whose compressed tags are out of order:Actual behavior
The above call yields:
Expected behavior
I expected the above the raise a (subclass of)
ValueError
, since the compressed tag set appears in the wrong order in the wheel's filename.The right order would be:
pyvirtualcam-0.13.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
.Additional context
This was noticed due to an interaction of a few different components in pypi/warehouse#18128:
pyvirtualcam-0.13.0-cp310-cp310-linux_x86_64.whl
);auditwheel repair
on the wheel, which re-tagged it aspyvirtualcam-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
). This tag ordering is incorrect per PEP 425, and is being tracked againstauditwheel
with Compressed tag sets are not sorted when rewriting wheel filename. auditwheel#583;packaging
doesn't warn or fail with the new wheel distribution name, per this bug report;pypi-attestations
then "ultranormalized" the wheel name for signing purposes, fixing it up topyvirtualcam-0.13.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
TL;DR: multiple components behaved in slightly different ways here, resulting in maximum confusion:
auditwheel repair
produced an incorrect tag ordering;packaging
silently honored that incorrect tag ordering, causing PyPI to also honor it;pypi-attestations
attempted to "fix" it per PEP 425, leading to a correct tag ordering but one that confused the user (since all other components used the invalid-but-accepted one). This last part has been fixed with fix: remove ultranormalization of distribution filenames trailofbits/pypi-attestations#124See also #873 for a related (but different) issue in wheel filename parsing 🙂
CC @di for viz
The text was updated successfully, but these errors were encountered: