PyInfo

回報問題 查看來源 Nightly

封裝 Python 規則提供的資訊。

成員

PyInfo

PyInfo PyInfo(transitive_sources, uses_shared_libraries=False, imports=unbound, has_py2_only_sources=False, has_py3_only_sources=False)

PyInfo 建構函式。

參數

參數 說明
transitive_sources Filedepset;必要
新物件的 transitive_sources 欄位值。
uses_shared_libraries bool;預設值為 False
新物件的 uses_shared_libraries 欄位值。
imports 字串depset;預設為 unbound
新物件的 imports 欄位值。
has_py2_only_sources bool;預設值為 False
新物件的 has_py2_only_sources 欄位值。
has_py3_only_sources bool;預設值為 False
新物件的 has_py3_only_sources 欄位值。

has_py2_only_sources

bool PyInfo.has_py2_only_sources

此目標的任一遞移來源是否需要 Python 2 執行階段。

has_py3_only_sources

bool PyInfo.has_py3_only_sources

此目標的任一遞移來源是否需要 Python 3 執行階段。

imports

depset PyInfo.imports

要新增至可執行 Python 目標 PYTHONPATH 的匯入路徑字串解碼集。這些是從遞移 deps 累積的。

我們無法保證模式的呈現順序,而且日後可能會有變動。建議使用 default 順序 (預設值)。

transitive_sources

depset PyInfo.transitive_sources

出現在目標的 srcs 和目標遞移 deps 中的 .py 檔案 (與 postorder 相容) 的 depSet。srcs

uses_shared_libraries

bool PyInfo.uses_shared_libraries

這個目標的任何遞移 deps 是否有共用資料庫檔案 (例如 .so 檔案)。

這個欄位目前未在 Bazel 中使用,日後可能會消失。