refactor(exec_tools): hoist py_exec_tools_toolchain from rules_python, drop min version to 1.0.0#913
Merged
Merged
Conversation
jbedard
approved these changes
Apr 5, 2026
a0fa9cb to
396b640
Compare
|
486cc59 to
0194a3d
Compare
…, drop min version to 1.0.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0194a3d to
38d049a
Compare
|
|
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.

Summary
#903 bumped the minimum
rules_pythonversion from1.0.0to1.9.0to gain access toPyExecToolsInfo.exec_runtime(added in rules_python 1.9.0) and loadedpy_exec_tools_toolchainfromrules_python's private API. This PR reverses the version bump by hoisting the necessary code into rules_py and removes all imports fromrules_python/private.Changes
New
py/private/exec_tools/defs.bzl— hoisted from rules_python:PyExecToolsInfoprovider with only anexec_runtimefield. We own the provider so we can includeexec_runtime(the field added in 1.9.0) regardless of which rules_python version the user has.py_exec_tools_toolchainrule — instantiated in each PBS interpreter repo; derivesexec_runtimefromexec_interpreter[ToolchainInfo].py3_runtime(the pre-1.9.0 equivalent).current_interpreter_executablerule — resolvesPY_TOOLCHAINto create an exec-configured interpreter symlink; defaults for the above rule.py/private/toolchain/BUILD.bazel— addedexec_tools_toolchain_typetoolchain type. We declare our own type rather than reusing@rules_python//python:exec_tools_toolchain_type, so ourPyExecToolsInfonever needs to satisfy rules_python's internal interface (e.g. theprecompilerfield thatmaybe_precompilechecks for).py/private/toolchain/types.bzl—EXEC_TOOLS_TOOLCHAINnow points to@aspect_rules_py//py/private/toolchain:exec_tools_toolchain_type.py/private/interpreter/repository.bzl— generated interpreter BUILD files now loadpy_exec_tools_toolchainfrom@aspect_rules_py//py/private/exec_tools:defs.bzland register under our own toolchain type instead of@rules_python//python:exec_tools_toolchain_type.uv/private/whl_install/rule.bzl—EXEC_TOOLS_TOOLCHAINnow loaded from our owntypes.bzl.MODULE.bazel/e2e/MODULE.bazel—rules_pythonandrules_python_gazelle_plugindropped back to1.0.0.