py_runtime 规则返回)的信息。Python 运行时描述的是平台运行时还是内置运行时。平台运行时会访问已知路径中的系统安装的解释器,而内置运行时会指向充当解释器的 File。在这两种情况下,“解释器”实际上是指任何能够运行通过命令行传递的 Python 脚本的可执行二进制文件或封装脚本,并且遵循与标准 CPython 解释器相同的惯例。
成员
- PyRuntimeInfo
- bootstrap_template
- coverage_files
- coverage_tool
- 文件
- interpreter
- interpreter_path
- python_version
- stub_shebang
PyRuntimeInfo
PyRuntimeInfo PyRuntimeInfo(interpreter_path=None, interpreter=None, files=None, coverage_tool=None, coverage_files=None, python_version, stub_shebang=None, bootstrap_template=None)
PyRuntimeInfo 构造函数。
参数
| 参数 | 说明 |
|---|---|
interpreter_path
|
字符串;或 None;
默认值为 None新对象的 interpreter_path 字段的值。如果您传入 interpreter,请勿为此实参提供值。
|
interpreter
|
文件;或 None;
默认值为 None新对象的 interpreter 字段的值。如果您传入 interpreter_path,请勿为此实参提供值。
|
files
|
File 的 depset;或 None;
默认值为 None新对象的 files 字段的值。如果您传入 interpreter_path,请勿为此实参提供值。如果指定了 interpreter,且此实参为 None,则 files 会改为成为空的 depset。
|
coverage_tool
|
文件;或 None;
默认值为 None新对象的 coverage_tool 字段的值。
|
coverage_files
|
File 的 depset;或 None;
默认值为 None新对象的 coverage_files 字段的值。如果您未同时传入 coverage_tool,请勿为此实参提供值。
|
python_version
|
必需 新对象的 python_version 字段的值。
|
stub_shebang
|
string;
default is None新对象的 stub_shebang 字段的值。如果为 None 或未指定,则使用 #!/usr/bin/env python3。
|
bootstrap_template
|
文件;或 None;
默认值为 None |
bootstrap_template
File PyRuntimeInfo.bootstrap_template
coverage_files
depset PyRuntimeInfo.coverage_files
coverage_tool 时所需的运行时文件。如果未提供 coverage_tool,则为 None。
可能会返回 None。
coverage_tool
File PyRuntimeInfo.coverage_tool
File,表示用于从 Python 测试中收集代码覆盖率信息的工具。否则,此值为 None。
可能会返回 None。
文件
depset PyRuntimeInfo.files
File 的 depset(尤其是 interpreter 所需的文件)。interpreter 的值无需包含在此字段中。如果这是平台运行时,则此字段为 None。
可能会返回 None。
翻译
File PyRuntimeInfo.interpreter
File。否则,此值为 None。请注意,内置运行时可以使用预构建的已签入的解释器,也可以使用从源代码构建的解释器。
可能会返回 None。
interpreter_path
string PyRuntimeInfo.interpreter_path
None。
可能会返回 None。
python_version
string PyRuntimeInfo.python_version
"PY2" 和 "PY3"。
stub_shebang
string PyRuntimeInfo.stub_shebang
py_binary 目标时,附加到引导 Python 桩脚本的“Shebang”表达式。不适用于 Windows。