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
|
c05a300 to
21456a4
Compare
21456a4 to
838d75b
Compare
| (pre_extension, extension), | ||
| (_, "whl" | "tbz" | "txz" | "tlz" | "zip" | "tgz" | "tar") | ||
| | (Some("tar"), "bz2" | "xz" | "lz" | "lzma" | "gz") | ||
| (_, "whl" | "tbz" | "tlz" | "zip" | "tgz" | "tar") | (Some("tar"), "bz2" | "gz") |
There was a problem hiding this comment.
Noting: I don't actually remember if we wanted to remove bz/lzma/xz from the tar pathway in this PR as well. If so, it'd be pretty easy to remove the last few variants here.
There was a problem hiding this comment.
To me the goal is to remove the dependency on those compression algorithm implementations, so that's imho in scope.
There was a problem hiding this comment.
SG, I'll tweak this in a bit to complete the removal then.
386511a to
a253e75
Compare
2cd8782 to
edb6167
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> Remove xz support entirely (#19143) Signed-off-by: William Woodruff <william@astral.sh> Deconflict Signed-off-by: William Woodruff <william@yossarian.net> Remove WARN chaff Signed-off-by: William Woodruff <william@yossarian.net> Remove lingering bz2 pathway Signed-off-by: William Woodruff <william@yossarian.net> Fix some CI errors Signed-off-by: William Woodruff <william@yossarian.net> Revert "Remove lingering bz2 pathway" This reverts commit 92ae6d2. Reapply "Remove lingering bz2 pathway" This reverts commit ca35499. Remove lingering `.tlz` match Signed-off-by: William Woodruff <william@yossarian.net> Comment Signed-off-by: William Woodruff <william@yossarian.net> Remove untar_bz2 Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
d7b295f to
2a871db
Compare
Signed-off-by: William Woodruff <william@yossarian.net>
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.