5252 "runfiles_root_path" ,
5353 "target_platform_has_any_constraint" ,
5454)
55+ load (":common_labels.bzl" , "labels" )
5556load (":flags.bzl" , "BootstrapImplFlag" , "VenvsUseDeclareSymlinkFlag" )
5657load (":precompile.bzl" , "maybe_precompile" )
5758load (":py_cc_link_params_info.bzl" , "PyCcLinkParamsInfo" )
@@ -61,19 +62,13 @@ load(":py_internal.bzl", "py_internal")
6162load (":py_runtime_info.bzl" , "DEFAULT_STUB_SHEBANG" , "PyRuntimeInfo" )
6263load (":reexports.bzl" , "BuiltinPyInfo" , "BuiltinPyRuntimeInfo" )
6364load (":rule_builders.bzl" , "ruleb" )
64- load (
65- ":toolchain_types.bzl" ,
66- "EXEC_TOOLS_TOOLCHAIN_TYPE" ,
67- "TARGET_TOOLCHAIN_TYPE" ,
68- TOOLCHAIN_TYPE = "TARGET_TOOLCHAIN_TYPE" ,
69- )
65+ load (":toolchain_types.bzl" , "EXEC_TOOLS_TOOLCHAIN_TYPE" , "TARGET_TOOLCHAIN_TYPE" , TOOLCHAIN_TYPE = "TARGET_TOOLCHAIN_TYPE" )
7066load (":transition_labels.bzl" , "TRANSITION_LABELS" )
7167load (":venv_runfiles.bzl" , "create_venv_app_files" )
7268
7369_py_builtins = py_internal
7470_EXTERNAL_PATH_PREFIX = "external"
7571_ZIP_RUNFILES_DIRECTORY_NAME = "runfiles"
76- _PYTHON_VERSION_FLAG = str (Label ("//python/config_settings:python_version" ))
7772
7873# Non-Google-specific attributes for executables
7974# These attributes are for rules that accept Python sources.
@@ -194,7 +189,7 @@ accepting arbitrary Python versions.
194189 default = "@bazel_tools//tools/allowlists/function_transition_allowlist" ,
195190 ),
196191 "_bootstrap_impl_flag" : lambda : attrb .Label (
197- default = "//python/config_settings:bootstrap_impl" ,
192+ default = labels . BOOTSTRAP_IMPL ,
198193 providers = [BuildSettingInfo ],
199194 ),
200195 "_bootstrap_template" : lambda : attrb .Label (
@@ -224,10 +219,10 @@ accepting arbitrary Python versions.
224219 default = TARGET_TOOLCHAIN_TYPE ,
225220 ),
226221 "_python_version_flag" : lambda : attrb .Label (
227- default = "//python/config_settings:python_version" ,
222+ default = labels . PYTHON_VERSION ,
228223 ),
229224 "_venvs_use_declare_symlink_flag" : lambda : attrb .Label (
230- default = "//python/config_settings:venvs_use_declare_symlink" ,
225+ default = labels . VENVS_USE_DECLARE_SYMLINK ,
231226 providers = [BuildSettingInfo ],
232227 ),
233228 "_windows_constraints" : lambda : attrb .LabelList (
@@ -1793,7 +1788,7 @@ def _transition_executable_impl(settings, attr):
17931788 apply_config_settings_attr (settings , attr )
17941789
17951790 if attr .python_version and attr .python_version not in ("PY2" , "PY3" ):
1796- settings [_PYTHON_VERSION_FLAG ] = attr .python_version
1791+ settings [labels . PYTHON_VERSION ] = attr .python_version
17971792 return settings
17981793
17991794def create_executable_rule (* , attrs , ** kwargs ):
@@ -1844,8 +1839,8 @@ def create_executable_rule_builder(implementation, **kwargs):
18441839 ],
18451840 cfg = dict (
18461841 implementation = _transition_executable_impl ,
1847- inputs = TRANSITION_LABELS + [_PYTHON_VERSION_FLAG ],
1848- outputs = TRANSITION_LABELS + [_PYTHON_VERSION_FLAG ],
1842+ inputs = TRANSITION_LABELS + [labels . PYTHON_VERSION ],
1843+ outputs = TRANSITION_LABELS + [labels . PYTHON_VERSION ],
18491844 ),
18501845 ** kwargs
18511846 )
0 commit comments