…s_python's
Generated interpreter repos now instantiate a rules_py py_runtime_toolchain
(py/private/interpreter/runtime.bzl, with a rules_py PyRuntimeInfo) instead of
rules_python's py_runtime + py_runtime_pair + py_exec_tools_toolchain. One
:runtime target per repo backs both toolchain registrations. Toolchain types
are unchanged (@bazel_tools python type; rules_python's exec_tools type, with
its exec_tools.exec_runtime/precompiler payload shape preserved), so
rules_python-provisioned interpreters still satisfy whl_install/site-merge and
rules_py still consumes user-registered rules_python py_runtime toolchains.
This shrinks each interpreter repo's rules_python loads from 31 .bzl files to
the 12 of the deliberately kept py_cc_toolchain chain, insulating provisioned
toolchains from rules_python implementation churn, and leaves the runtime
layer pinning no rules_python minimum version.
New coverage: e2e/rules-python-interop (isolated module) pins that a module
mixing both rulesets shares one rules_python-provisioned interpreter,
including a $(PYTHON3) location diff_test; e2e/cases/rules-python-consumers
pins that rules_python's own toolchain consumers (current_py_toolchain,
exec-tools readers) work against rules_py-backed toolchains.
Narrow breaks:
- Generated interpreter repo targets are renamed: @python_X//:py3_runtime,
:runtime_pair, and :exec_tools_toolchain are now a single @python_X//:runtime.
Only direct label references need updating; toolchain resolution is unaffected.
- rules_py-provisioned runtimes carry rules_py's PyRuntimeInfo, not
rules_python's. Provider-indexed access (target[PyRuntimeInfo] with
rules_python's symbol) on these targets or resolved toolchains breaks;
duck-typed field access keeps working. As a consequence, rules_python's
py_binary/py_test cannot execute on rules_py-provisioned toolchains (they
read provider fields rules_py does not carry) — the same one-way interop
direction #1231 establishes for PyInfo.
- The exec-tools toolchain rules_py registers provides precompiler = None;
enabling rules_python precompiling while @python_interpreters toolchains are
registered first is unsupported.
Generated interpreter repos now instantiate a rules_py py_runtime_toolchain (py/private/interpreter/runtime.bzl, with a rules_py PyRuntimeInfo) instead of rules_python's py_runtime + py_runtime_pair + py_exec_tools_toolchain. One :runtime target per repo backs both toolchain registrations. Toolchain types are unchanged (@bazel_tools python type; rules_python's exec_tools type, with its exec_tools.exec_runtime/precompiler payload shape preserved), so rules_python-provisioned interpreters still satisfy whl_install/site-merge and rules_py still consumes user-registered rules_python py_runtime toolchains.
This shrinks each interpreter repo's rules_python loads from 31 .bzl files to the 12 of the deliberately kept py_cc_toolchain chain, insulating provisioned toolchains from rules_python implementation churn, and leaves the runtime layer pinning no rules_python minimum version.
New coverage: e2e/rules-python-interop (isolated module) pins that a module mixing both rulesets shares one rules_python-provisioned interpreter, including a $(PYTHON3) location diff_test; e2e/cases/rules-python-consumers pins that rules_python's own toolchain consumers (current_py_toolchain, exec-tools readers) work against rules_py-backed toolchains.
Changes are visible to end-users: yes
Searched for relevant documentation and updated as needed: yes
Breaking change (forces users to change their own code or config): yes
Suggested release notes appear below: yes
Generated interpreter repo targets are renamed: @python_X//:py3_runtime, :runtime_pair, and :exec_tools_toolchain are now a single @python_X//:runtime. Only direct label references need updating; toolchain resolution is unaffected.
rules_py-provisioned runtimes carry rules_py's PyRuntimeInfo, not rules_python's. Provider-indexed access (target[PyRuntimeInfo] with rules_python's symbol) on these targets or resolved toolchains breaks; duck-typed field access keeps working. As a consequence, rules_python's py_binary/py_test cannot execute on rules_py-provisioned toolchains (they read provider fields rules_py does not carry) — the same one-way interop direction refactor: use simplified rules_py providers #1231 establishes for PyInfo.
The exec-tools toolchain rules_py registers provides precompiler = None; enabling rules_python precompiling while @python_interpreters toolchains are registered first is unsupported.
Test plan