feat(toolchains): let local toolchains point to a label (#3304) Currently, the local toolchain code requires using a path (or program name) to find the Python interpreter. This comes up short when using Bazel to download an arbitrary runtime (or otherwise manage the creation of it, e.g. downloading Python and building it from source in a repo rule). In such cases, the file system location of the interpreter isn't known (it'll be in some Bazel cache directory). To fix, add the `interpreter_target` attribute to `local_runtime_repo`, which it looks up the path for, then continues on as normal. As an example, the test uses a custom repository rule to download a particular version of Python appropriate to the OS.
This repository is the home of the core Python rules -- py_library, py_binary, py_test, py_proto_library, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.