Skip to content

Warn on unexpected ZIP compression methods#17885

Merged
woodruffw merged 7 commits into
mainfrom
ww/deprecate-compression-kinds
Feb 9, 2026
Merged

Warn on unexpected ZIP compression methods#17885
woodruffw merged 7 commits into
mainfrom
ww/deprecate-compression-kinds

Conversation

@woodruffw

@woodruffw woodruffw commented Feb 5, 2026

Copy link
Copy Markdown
Member

Summary

This adds warnings to both our steam and sync ZIP handling on ZIP entries that aren't "well-known." For now, "well-known" means stored (i.e. no compression), DEFLATE, or zstd.

In practice we have duplicated codepaths for this check: one for the "sync" (pre-downloaded) path, and one for the streaming path.

See #16911 and #17467 for context.

Test Plan

Will update snapshots if/when they change. I'll also add a ZIP test for this.

(Upd: added some "futzed" wheels for the ZIP tests.)

@woodruffw woodruffw self-assigned this Feb 5, 2026
@woodruffw

Copy link
Copy Markdown
Member Author

Somewhat (?) surprisingly, nothing in the current tests triggers these warnings. So I'll contrive a ZIP that does.

@woodruffw woodruffw force-pushed the ww/deprecate-compression-kinds branch from 90150a6 to ff11640 Compare February 6, 2026 20:50
/// `source_hint` is used for warning messages, to identify the source of the ZIP archive
/// beneath the reader. It might be a URL, a file path, or something else.
pub async fn unzip<D: Display, R: tokio::io::AsyncRead + Unpin>(
source_hint: D,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This required updating a lot of callsites, as can be seen in the diff. But this is the core change here!

Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw force-pushed the ww/deprecate-compression-kinds branch from 9cbf5bf to 2b9b4e1 Compare February 9, 2026 14:52
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw marked this pull request as ready for review February 9, 2026 16:00
}

#[test]
fn warn_on_lzma_wheel() {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging: this was kind of surprising -- we already didn't support lzma wheels, at least in the streaming pathway. I think this means I can probably just drop the lzma extra from async-zip.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#13310 explains this error.

@woodruffw woodruffw requested review from konstin and zanieb February 9, 2026 16:03
@codspeed-hq

codspeed-hq Bot commented Feb 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.23%

⚡ 1 improved benchmark
✅ 4 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation resolve_warm_jupyter 80.8 ms 72.6 ms +11.23%

Comparing ww/deprecate-compression-kinds (1036396) with main (efdb584)

Open in CodSpeed

3 similar comments
@codspeed-hq

codspeed-hq Bot commented Feb 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.23%

⚡ 1 improved benchmark
✅ 4 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation resolve_warm_jupyter 80.8 ms 72.6 ms +11.23%

Comparing ww/deprecate-compression-kinds (1036396) with main (efdb584)

Open in CodSpeed

@codspeed-hq

codspeed-hq Bot commented Feb 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.23%

⚡ 1 improved benchmark
✅ 4 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation resolve_warm_jupyter 80.8 ms 72.6 ms +11.23%

Comparing ww/deprecate-compression-kinds (1036396) with main (efdb584)

Open in CodSpeed

@codspeed-hq

codspeed-hq Bot commented Feb 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 11.23%

⚡ 1 improved benchmark
✅ 4 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation resolve_warm_jupyter 80.8 ms 72.6 ms +11.23%

Comparing ww/deprecate-compression-kinds (1036396) with main (efdb584)

Open in CodSpeed

@woodruffw woodruffw merged commit 5c74d31 into main Feb 9, 2026
284 of 296 checks passed
@woodruffw woodruffw deleted the ww/deprecate-compression-kinds branch February 9, 2026 17:53
woodruffw added a commit that referenced this pull request Feb 9, 2026
woodruffw added a commit that referenced this pull request Feb 9, 2026
pull Bot pushed a commit to dpprdan/uv that referenced this pull request Feb 9, 2026
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 this pull request may close these issues.

1 participant