//python:py_exec_tools_toolchain.bzl — rules_python 0.0.0 documentation (original) (raw)
Toolchain for build-time tools.
rule py_exec_tools_toolchain(name, exec_interpreter='@rules_python//python/private:current_interpreter_executable', precompiler=None)
Provides a toolchain for build time tools.
This provides ToolchainInfo
with the following attributes:
exec_tools
: PyExecToolsInfotoolchain_label
: Label only present when--visibilefortesting=True
for internal testing. The rule’s label; this allows identifying what toolchain implmentation was selected for testing purposes.
Attributes:
- name – (Name)
A unique name for this target.
mandatory - exec_interpreter – (label) (default “@rules_python//python/private:current_interpreter_executable”)
An interpreter that is directly usable in the exec configuration
If not specified, the interpreter from //python:toolchain_type will be used.
To disable, specify the special target //python:none; the raw valueNone
will use the default.
Note
This is only useful forctx.actions.run
calls that directly invoke the interpreter, which is fairly uncommon and low level. It is better to use acfg="exec"
attribute that points to apy_binary
rule instead, which will handle all the necessary transitions and runtime setup to invoke a program.
See PyExecToolsInfo.exec_interpreter for further docs.
optional - precompiler – (label) (default None)
See PyExecToolsInfo.precompiler
optional