PyRuntimeInfo
Contains information about a Python runtime, as returned by thepy_runtime
rule.A Python runtime describes 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 a File
that acts as the interpreter. In both cases, an "interpreter" is really 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.
PyRuntimeInfo
PyRuntimeInfo PyRuntimeInfo(interpreter_path=None, interpreter=None, files=None, python_version)The
PyRuntimeInfo
constructor.
Parameters
Parameter | Description |
---|---|
interpreter_path
|
The value for the new object's |
interpreter
|
The value for the new object's |
files
|
The value for the new object's |
python_version
|
The value for the new object's |
files
depset PyRuntimeInfo.filesIf this is an in-build runtime, this field is a
depset
of File
s that need to be added to the runfiles of an executable target that uses this runtime (in particular, files needed by interpreter
). The value of interpreter
need not be included in this field. If this is a platform runtime then this field is None
.
May return None
.
interpreter
File PyRuntimeInfo.interpreterIf this is an in-build runtime, this field is a
File
representing the interpreter. Otherwise, this is None
. Note that an in-build runtime can use either a prebuilt, checked-in interpreter or an interpreter built from source.
May return None
.
interpreter_path
string PyRuntimeInfo.interpreter_pathIf this is a platform runtime, this field is the absolute filesystem path to the interpreter on the target platform. Otherwise, this is
None
.
May return None
.
python_version
string PyRuntimeInfo.python_versionIndicates whether this runtime uses Python major version 2 or 3. Valid values are (only)
"PY2"
and "PY3"
.