refactor(pypi): extract the wheel without python#3430
Merged
aignas merged 6 commits intobazel-contrib:mainfrom Nov 25, 2025
Merged
refactor(pypi): extract the wheel without python#3430aignas merged 6 commits intobazel-contrib:mainfrom
aignas merged 6 commits intobazel-contrib:mainfrom
Conversation
aca42c3 to
d8b1274
Compare
rickeylev
approved these changes
Nov 23, 2025
Collaborator
|
Nice. A bonus of this is it'll make it easier to use an alternative extractor (it can just extract instead of having to deal with wheel format details) |
Collaborator
|
I would trigger merge, but this is set as draft -- overall it LGTM. Is there some edge case the python code handles that a plain extract doesn't? |
Collaborator
|
I renamed the title; this is purely internal and I don't see why it would be user-notable |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 23, 2025
This is a small utility function to get us Python free when wheels are extracted in the repository phase. Next is to extract the wheel using `repository_ctx.extract` (#3430). Whereas patching the wheel after extracting is more involved to be done without Python because we need to rezip the wheel and that has to be done with Python for a few reasons (to stay sane). If we want to remove this, then we would have to create a `whl` file in the build phase, which could work, but will need to be an exercise for the reader. Nevertheless, this moves us towards removing any side-effects from Python interpreter, so changing the default interpreter would not cause us to refetch everything. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
With this we start extracting the wheel without Python and it becomes a requirement only when patching (we will extract the wheel without Python, patch it and then re-compress it which makes a very inefficient process). This should result in much faster executions.
d8b1274 to
034653b
Compare
Collaborator
Author
|
OK, I updated the Let me know what kind of extra tests we should have here. |
5 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 25, 2025
With this we start extracting the wheel without Python and it becomes a requirement only when patching (we will extract the wheel without Python, patch it and then re-compress it which makes a very inefficient process). This should result in much faster executions because we can start extracting wheels even before we fetch the entire Python toolchain and we don't need to fetch it in a wheel-only setup until we are actually building/executing tests. What is more bazel is faster in extracting everything. Work towards #2948
aignas
commented
Nov 25, 2025
Removed 'python_interpreter_target' from the configuration.
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.
With this we start extracting the wheel without Python and
it becomes a requirement only when patching (we will extract
the wheel without Python, patch it and then re-compress it
which makes a very inefficient process).
This should result in much faster executions because we can start
extracting wheels even before we fetch the entire Python toolchain
and we don't need to fetch it in a wheel-only setup until we are
actually building/executing tests. What is more bazel is faster
in extracting everything.
Work towards #2948