Skip to content

Commit 61dd16d

Browse files
committed
more cleanup
1 parent 07eda23 commit 61dd16d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

python/private/pip_config_settings.bzl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,13 @@ def _dist_config_setting(*, name, is_pip_whl, is_python, python_version, native
291291
**kwargs: The kwargs passed to the config_setting rule. Visibility of
292292
the main alias target is also taken from the kwargs.
293293
"""
294-
name = "is_cp{}_{}".format(python_version, name) if python_version else "is_{}".format(name)
295-
if python_version:
296-
_name = name.replace("is_cp{}".format(python_version), "_is")
297-
else:
298-
_name = "_" + name
294+
_name = "_is_" + name
299295

300-
# First match by the python version
301296
visibility = kwargs.get("visibility")
302297
native.alias(
303-
name = name,
298+
name = "is_cp{}_{}".format(python_version, name) if python_version else "is_{}".format(name),
304299
actual = select({
300+
# First match by the python version
305301
is_python: _name,
306302
"//conditions:default": is_python,
307303
}),
@@ -313,7 +309,7 @@ def _dist_config_setting(*, name, is_pip_whl, is_python, python_version, native
313309
# `python_version` setting.
314310
return
315311

316-
config_setting_name = "_{}_setting".format(name)
312+
config_setting_name = _name + "_setting"
317313
native.config_setting(name = config_setting_name, **kwargs)
318314

319315
# Next match by the `pip_whl` flag value and then match by the flags that

0 commit comments

Comments
 (0)