Skip to content

Commit a19bb08

Browse files
committed
cleanup
1 parent 3ec5225 commit a19bb08

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

python/private/pypi/extension.bzl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,29 +429,30 @@ def _whl_repo(
429429
def _configure(config, *, platform, os_name, arch_name, config_settings, env = {}, whl_abi_tags, whl_platform_tags, override = False):
430430
"""Set the value in the config if the value is provided"""
431431
config.setdefault("platforms", {})
432-
if platform and (os_name or arch_name or config_settings or whl_platform_tags or env):
433-
if not override and config.get("platforms", {}).get(platform):
432+
if platform and (os_name or arch_name or config_settings or whl_abi_tags or whl_platform_tags or env):
433+
if not override and config["platforms"].get(platform):
434434
return
435435

436436
for key in env:
437437
if key not in _SUPPORTED_PEP508_KEYS:
438438
fail("Unsupported key in the PEP508 environment: {}".format(key))
439439

440+
# NOTE @aignas 2025-07-08: the least preferred is the first item in the list
440441
if whl_platform_tags and "any" not in whl_platform_tags:
441442
# the lowest priority one needs to be the first one
442443
whl_platform_tags = ["any"] + whl_platform_tags
443444

445+
whl_abi_tags = whl_abi_tags or ["abi3", "cp{major}{minor}"]
446+
if whl_abi_tags and "none" not in whl_abi_tags:
447+
# the lowest priority one needs to be the first one
448+
whl_abi_tags = ["none"] + whl_abi_tags
449+
444450
config["platforms"][platform] = struct(
445451
name = platform.replace("-", "_").lower(),
446452
os_name = os_name,
447453
arch_name = arch_name,
448454
config_settings = config_settings,
449-
whl_abi_tags = whl_abi_tags or [
450-
# NOTE @aignas 2025-07-08: the least preferred is the first item in the list
451-
"none",
452-
"abi3",
453-
"cp{major}{minor}",
454-
],
455+
whl_abi_tags = whl_abi_tags,
455456
whl_platform_tags = whl_platform_tags,
456457
env = {
457458
# default to this

0 commit comments

Comments
 (0)