Register hermetic Python 3.12 toolchain#1010
Conversation
Use pythons_hub toolchains so Bazel py_test runs with the hermetic 3.12 runtime instead of the system Python.
|
Does Bazel download Python 3.12 if it is not installed? |
There was a problem hiding this comment.
Pull request overview
This pull request registers the hermetic Python 3.12 toolchain in Bazel to ensure py_test targets run with a consistent Python runtime instead of relying on the system Python installation.
Changes:
- Added
use_repoto exposepython_3_12andpythons_hubrepositories from the python extension - Registered the hermetic Python toolchains using
register_toolchains("@pythons_hub//:all")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Yes, it will. When using rules_python with bzlmod and a configured Python toolchain (e.g. This does not rely on the system Python and works even if Python 3.12 is not installed locally, as long as the toolchain is registered (e.g. via |
Use pythons_hub toolchains so Bazel py_test runs with the hermetic 3.12 runtime instead of the system Python.
Use pythons_hub toolchains so Bazel py_test runs with the hermetic 3.12 runtime instead of the system Python.