py_runtime 规则返回。Python 运行时描述了平台运行时或构建内运行时。平台运行时通过已知路径访问系统安装的解释器,而构建运行时指向充当解释器的 File。在这两种情况下,“口译员”是指能够运行在命令行中传递的 Python 脚本的任何可执行二进制文件或包装脚本,遵循与标准 CPython 解释器相同的约定。
成员
PyRuntimeInfo
PyRuntimeInfo PyRuntimeInfo(interpreter_path=None, interpreter=None, files=None, coverage_tool=None, coverage_files=None, python_version, stub_shebang='#!/usr/bin/env python3')
PyRuntimeInfo 构造函数。
          
      参数
| 参数 | 说明 | 
|---|---|
| interpreter_path | string; or None;
                                     默认 = 无新对象的 interpreter_path字段的值。如果您传入interpreter,请勿为此参数提供值。 | 
| interpreter | File; or None;
                                     默认 = 无新对象的 interpreter字段的值。如果您传入interpreter_path,请勿为此参数提供值。 | 
| files | depset of Files; or None;
                                     默认 = 无新对象的 files字段的值。如果您传入interpreter_path,请勿为此参数提供值。如果指定了interpreter且此参数为None,则files会变为空depset。 | 
| coverage_tool | File; or None;
                                     默认 = 无新对象的 coverage_tool字段的值。 | 
| coverage_files | depset of Files; or None;
                                     默认 = 无新对象的 coverage_files字段的值。如果您未也传入coverage_tool,则不要为此参数提供值。 | 
| python_version | 必需 新对象的 python_version字段的值。 | 
| stub_shebang | string;
                                     default = '#!/usr/bin/env python3'新对象的 stub_shebang字段的值。默认值为#!/usr/bin/env python3。 | 
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,需要添加到使用此运行时的可执行目标的 runfile(尤其是 interpreter 所需的文件)。无需在此字段中添加 interpreter 的值。如果这是一个平台运行时,则此字段为 None。
         可能会返回 None。
        翻译工具
File PyRuntimeInfo.interpreter
File。否则,该值为 None。请注意,build 运行时可以使用预构建的签入解释器,也可以使用基于源代码构建的解释器。
         可能会返回 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 桩脚本的表达式。不适用于 Windows。