refactor(pypi): extract the wheel without python by aignas · Pull Request #3430 · bazel-contrib/rules_python

@aignas mentioned this pull request

Nov 23, 2025

rickeylev

@rickeylev rickeylev changed the title feat(pipstar): extract the wheel without python refactor(pypi): extract the wheel without python

Nov 23, 2025

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>

@aignas

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.

@aignas

@aignas aignas marked this pull request as ready for review

November 24, 2025 06:35

@aignas

@aignas

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

aignas

@aignas

Removed 'python_interpreter_target' from the configuration.

@aignas aignas deleted the aignas.pipstar.extract_whl_starlark_2 branch

November 25, 2025 03:19