Skip to content

Commit 0778363

Browse files
Fix: Handle multi-platform wheels and improve python version checking
Co-authored-by: daniel.szoke <[email protected]>
1 parent 0c4a4fc commit 0778363

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

tests/validate_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ def test_pythons_to_check_specific_cpython_tag():
6969
assert ret == ("python3.11",)
7070

7171

72+
def test_pythons_to_check_multi_platform_with_musllinux():
73+
"""Test that wheels with both manylinux and musllinux tags are accepted."""
74+
# Simulates a wheel like: py3-none-manylinux_2_17_x86_64.musllinux_1_2_x86_64
75+
tags = parse_tag("py3-none-manylinux_2_17_x86_64") | parse_tag("py3-none-musllinux_1_2_x86_64")
76+
ret = validate._pythons_to_check(tags)
77+
# Should succeed because at least one tag (manylinux) is compatible
78+
assert ret == ("python3.11", "python3.12", "python3.13")
79+
80+
7281
def test_top_imports_record(tmp_path):
7382
whl = tmp_path.joinpath("distlib.whl")
7483
with zipfile.ZipFile(whl, "w") as zipf:

validate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ def _pythons_to_check(tags: frozenset[Tag]) -> tuple[str, ...]:
5656
continue
5757
elif tag.interpreter.startswith("py3"):
5858
for py in PYTHONS:
59-
if tag not in packaging.tags.compatible_tags(py):
60-
raise AssertionError(f"{tag} is not compatible with python {py}")
61-
ret.update(_py_exe(*py) for py in PYTHONS)
59+
if tag in packaging.tags.compatible_tags(py):
60+
ret.add(_py_exe(*py))
6261
else:
6362
raise AssertionError(f"unexpected tag: {tag}")
6463

0 commit comments

Comments
 (0)