feat: add support for `.whl` file extension in `repository_ctx.download_and_extract`
The download_and_extract function supported various archive formats, but did not recognize .whl as a valid file extension for archive extraction. Since wheel files are ZIP archives with a .whl extension (per PEP 427), this commit adds support for them by treating .whl files the same as other ZIP-based formats.
This enables using Python wheel files directly with rules_multitool and other tools without requiring workarounds, particularly useful for air-gapped environments with private PyPI repositories.
Changes:
- Add .whl to ZIP decompressor condition in DecompressorValue.java
- Update error message to include .whl in supported extensions list
- Update API documentation to include .whl as supported archive type
- Add test case for .whl file extension handling
Fixes #26307
RELNOTES[NEW]: repository_ctx.download_and_extract now supports the .whl file extension for Python wheel files, treating them as ZIP archives under PEP 427.
@meteorcloudy, can you please take a look whenever available? Thanks!
Can you please add a new RELNOTES[New]: <content> tag in the PR description?
@meteorcloudy done, thank you!
Quick question: To have it shipped on 8.3.0, I need to open another PR to https://github.com/bazelbuild/bazel/tree/release-8.3.0? I'm trying to understand https://github.com/bazelbuild/bazel/issues/25839. Thanks again!
@bazel-io fork 8.3.0
@fmeum Thanks Fabian!
Just wanted to point out that download_and_extract already has a type parameter, if you're blocked on this PR.