Skip to main content

Rules

py_binary

View rule sourceopen_in_new

Arguments

py_library

View rule sourceopen_in_new
A library of Python code that can be depended upon. Default outputs: * The input Python sources * The precompiled artifacts from the sources. NOTE: Precompilation affects which of the default outputs are included in the resulting runfiles. See the precompile-related attributes and flags for more information. :::{versionchanged} 0.37.0 Source files are no longer added to the runfiles directly. :::

Arguments

py_test

View rule sourceopen_in_new

Arguments

py_runtime

View rule sourceopen_in_new
Represents a Python runtime used to execute Python code. A py_runtime target can represent either a *platform runtime* or an *in-build runtime*. A platform runtime accesses a system-installed interpreter at a known path, whereas an in-build runtime points to an executable target that acts as the interpreter. In both cases, an “interpreter” means any executable binary or wrapper script that is capable of running a Python script passed on the command line, following the same conventions as the standard CPython interpreter. A platform runtime is by its nature non-hermetic. It imposes a requirement on the target platform to have an interpreter located at a specific path. An in-build runtime may or may not be hermetic, depending on whether it points to a checked-in interpreter or a wrapper script that accesses the system interpreter. Example

Arguments