uv
26f84e56 - Percent-decode URLs in canonical comparisons (#11088)

Commit
364 days ago
Percent-decode URLs in canonical comparisons (#11088) ## Summary This PR adds an additional normalization step to `CanonicalUrl` whereby we now percent-decode the path, to ensure that (e.g.) `torch-2.5.1%2Bcpu.cxx11.abi-cp39-cp39-linux_x86_64.whl` and `torch-2.5.1+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl` are considered equal. Further, when generating the "reinstall" report, we use the canonical URL rather than the verbatim URL. In making this change, I also learned that we don't apply any of the normalization passes to `file://` URLs. I inadvertently removed it in https://github.com/astral-sh/uv/pull/3010/commits/93d606aba20c39149390a9191879e82194ea4e91, since setting the password or URL on ` file://` URL errors -- but now suppress those errors anyway. Closes https://github.com/astral-sh/uv/issues/11082. ## Test Plan - Downloaded a [PyTorch wheel](https://download.pytorch.org/whl/cpu-cxx11-abi/torch-2.5.1%2Bcpu.cxx11.abi-cp39-cp39-linux_x86_64.whl) - `python3.9 -m pip install torch-2.5.1+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl --platform linux_x86_64 --target foo --no-deps` - `cargo run pip install torch-2.5.1+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl --python-platform linux --python-version 3.9 --target foo --no-deps` - Verified that the package had the `~` symbol for the reinstall.
Author
Parents
Loading