[8.3.0] feat: add support for .whl file extension in repository_ctx.download_and_extract#26323
Merged
Wyverald merged 1 commit intobazelbuild:release-8.3.0from Jun 17, 2025
Merged
Conversation
…ad_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 bazelbuild#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. Closes bazelbuild#26308. PiperOrigin-RevId: 772552704 Change-Id: Id21218bb7f13096e0e493745a18325a2575445ed
Wyverald
approved these changes
Jun 17, 2025
Merged
via the queue into
bazelbuild:release-8.3.0
with commit Jun 17, 2025
13ede51
47 checks passed
github-merge-queue bot
pushed a commit
to bazel-contrib/rules_python
that referenced
this pull request
Dec 11, 2025
Directly extracting .whl files is only supported in Bazel >=8.3.0 (see bazelbuild/bazel#26323). This change applies the workaround for Bazel <8.0.0 to all versions <9.0.0 for broader compatibility. Work towards #2948
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
download_and_extractfunction supported various archive formats, but did not recognize.whlas a valid file extension for archive extraction. Since wheel files are ZIP archives with a.whlextension (per PEP 427), this commit adds support for them by treating.whlfiles 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:
Fixes #26307
RELNOTES[NEW]:
repository_ctx.download_and_extractnow supports the.whlfile extension for Python wheel files, treating them as ZIP archives under PEP 427.Closes #26308.
PiperOrigin-RevId: 772552704
Change-Id: Id21218bb7f13096e0e493745a18325a2575445ed
Commit d9634ca