Skip to content

Commit 02453f2

Browse files
committed
do not use the wildcards in want_abis
1 parent 1e84e40 commit 02453f2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

python/private/pypi/whl_target_platforms.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ _OS_PREFIXES = {
4747
"win": "windows",
4848
} # buildifier: disable=unsorted-dict-items
4949

50-
def _get_priority(*, tag, values):
50+
def _get_priority(*, tag, values, allow_wildcard = True):
5151
for priority, wp in enumerate(values):
5252
# TODO @aignas 2025-06-16: move the matcher validation out of this
5353
# TODO @aignas 2025-06-21: test the 'cp*' matching
5454
head, sep, tail = wp.partition("*")
5555
if "*" in tail:
5656
fail("only a single '*' can be present in the matcher")
57+
if not allow_wildcard and sep:
58+
fail("'*' is not allowed in the matcher")
5759

5860
for p in tag.split("."):
5961
if not sep and p == head:
@@ -91,6 +93,7 @@ def select_whl(*, whls, python_version, platforms, want_abis, implementation = "
9193

9294
for whl in whls:
9395
parsed = parse_whl_name(whl.filename)
96+
9497
suffix = ""
9598
if parsed.abi_tag.startswith(implementation):
9699
v = parsed.abi_tag[2:]
@@ -147,6 +150,7 @@ def select_whl(*, whls, python_version, platforms, want_abis, implementation = "
147150
abi_priority = _get_priority(
148151
tag = parsed.abi_tag,
149152
values = want_abis,
153+
allow_wildcard = False,
150154
)
151155
if abi_priority == None:
152156
if logger:

tests/pypi/whl_target_platforms/select_whl_tests.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def _test_match_abi_and_not_py_version(env):
219219
got = _select_whl(
220220
whls = whls,
221221
platforms = platforms,
222-
want_abis = ["abi3", "cp*"],
222+
want_abis = ["abi3", "cp37m"],
223223
python_version = "3.7",
224224
)
225225
_match(
@@ -231,7 +231,7 @@ def _test_match_abi_and_not_py_version(env):
231231
got = _select_whl(
232232
whls = whls,
233233
platforms = platforms[::-1],
234-
want_abis = ["abi3", "cp*"],
234+
want_abis = ["abi3", "cp37m"],
235235
python_version = "3.7",
236236
)
237237
_match(
@@ -275,7 +275,7 @@ def _test_freethreaded_wheels(env):
275275
"any",
276276
"musllinux_*_x86_64",
277277
],
278-
want_abis = ["none", "abi3", "cp*", "cp*t"],
278+
want_abis = ["none", "abi3", "cp313", "cp313t"],
279279
python_version = "3.13",
280280
limit = 8,
281281
)

0 commit comments

Comments
 (0)