Remove bz/lzma/xz support from ZIP handling#18927
Conversation
| × Failed to download `futzed-bz2 @ https://github.com/astral-sh/futzed-wheels/releases/download/v2026.02.09.2/futzed_bz2-0.1.0-py3-none-any.whl` | ||
| ├─▶ Failed to read metadata: `https://github.com/astral-sh/futzed-wheels/releases/download/v2026.02.09.2/futzed_bz2-0.1.0-py3-none-any.whl` | ||
| ├─▶ Failed to read from zip file | ||
| ╰─▶ compression not supported: 12 |
There was a problem hiding this comment.
This error is pretty bad, but I'm not sure how much to invest in making it better -- we'd need to partially specialize each underlying zip crate's error for this. Maybe that's worth it, though.
There was a problem hiding this comment.
Can we downcast and match
for this? I do think it's important to show that this format is intentionally unsupported, that this error not a bug.
There was a problem hiding this comment.
Downcasting this was going to be a bit gnarly (since we have two separate error paths to unify, sync and async), so what I've done is switch from #[from] to #[source] and done an interposing From<...> for Error to perform the transformation on each error type as needed. Not sure if that passes our idiom smell test though 🙂
66df85e to
6437610
Compare
6437610 to
6a607c9
Compare
There was a problem hiding this comment.
Flagging: we effectively have (at least) four different zip pathways in uv at the moment: uv_extract with sync/async and uv_metadata with sync/async both have their own error variants, each of which captures the different Zip/AsyncZip member separately. Unifying them probably doesn't make sense with this PR in the interest of locality, but seems like a good long-term refactor (in the interests of single-sourcing the flow of archive handling through uv).
979eb5b to
8e8cfc8
Compare
84e19b8 to
fec0ee5
Compare
fec0ee5 to
a38cfe0
Compare
e85ba52 to
b4db6f7
Compare
|
Tracking that CI flake with #19633 |
eba669f to
a7f61e1
Compare
uv test inventory changesThis PR changes the tests when compared with the latest
|
ec6ec71 to
1d61dda
Compare
Signed-off-by: William Woodruff <william@astral.sh> Remove CompressionMethod APIs entirely Signed-off-by: William Woodruff <william@astral.sh> Tear out the rest of the deprecation pathways Signed-off-by: William Woodruff <william@astral.sh> Fix `cargo shear` Signed-off-by: William Woodruff <william@astral.sh> Bump snapshots Signed-off-by: William Woodruff <william@astral.sh> `cargo fmt` Signed-off-by: William Woodruff <william@astral.sh> Specialize error messages for unsupported compression methods in zip files Signed-off-by: William Woodruff <william@astral.sh> Simplify matches Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
1d61dda to
c05a300
Compare
Summary
WIP.This removes the bzip2/lzma/xz features from our backing ZIP dependencies, per our long term plans to not support these compression schemes (as they're not standard parts of Python packaging). This doesn't remove the similar paths from tarball handling, yet.
This is a breaking change, so it probably shouldn't be merged until we're ready to cut 0.12.
See #16911 for context.
Test Plan
Will update the snapshot tests.