1:::{default-domain} bzl 2::: 3:::{bzl:currentfile} //python/runtime_env_toolchains:BUILD.bazel 4::: 5 6# //python/runtime_env_toolchains 7 8::::{target} all 9 10A set of toolchains that invoke `python3` from the runtime environment. 11 12Note that this toolchain provides no build-time information, which makes it of 13limited utility. This is because the invocation of `python3` is done when a 14program is run, not at build time. 15 16This is only provided to aid migration off the builtin Bazel toolchain 17(`@bazel_tools//python:autodetecting_toolchain`), and is largely only applicable 18to WORKSPACE builds. 19 20To use this target, register it as a toolchain in WORKSPACE or MODULE.bazel: 21 22::: 23register_toolchains("@rules_python//python/runtime_env_toolchains:all") 24::: 25 26The benefit of this target over the legacy targets is this defines additional 27toolchain types that rules_python needs. This prevents toolchain resolution from 28continuing to search elsewhere (e.g. potentially incurring a download of the 29hermetic runtimes when they won't be used). 30 31:::{deprecated} 0.34.0 32 33Switch to using a hermetic toolchain or manual toolchain configuration instead. 34::: 35 36:::{versionadded} 0.34.0 37::: 38:::: 39