Skip to content

Commit c9ee5a0

Browse files
committed
Fix tests for multiple pyodide wheels
1 parent 95dea1d commit c9ee5a0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

cibuildwheel/util/packaging.py

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> T | None:
165165
continue
166166
if not tag.platform.endswith(f"_{arch}"):
167167
continue
168+
elif platform.startswith("pyodide"):
169+
# each Pyodide version has its own platform tag
170+
continue
168171
else:
169172
# Windows should exactly match
170173
if tag.platform != platform:

test/test_abi_variants.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def test_abi3(tmp_path):
5454
expected_wheels = [
5555
w.replace(f"{single_python_tag}-{single_python_tag}", "cp310-abi3")
5656
for w in expected_wheels
57+
if single_python_tag in w
5758
]
5859
else:
5960
expected_wheels = [
@@ -194,7 +195,7 @@ def test_abi_none(tmp_path, capfd):
194195
captured = capfd.readouterr()
195196
assert "Building wheel..." in captured.out
196197
if utils.platform == "pyodide":
197-
# there's only 1 possible configuration for pyodide, we won't see the message expected on following builds
198+
# pyodide has a unique platform tag for each wheel, so they are not reused
198199
assert "Found previously built wheel" not in captured.out
199200
else:
200201
assert "Found previously built wheel" in captured.out

test/test_custom_repair_wheel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test(tmp_path, capfd):
4848
assert "Build failed because a wheel named" in captured.err
4949
assert exc_info.value.returncode == 6
5050
else:
51-
# We only produced one wheel (currently Pyodide)
51+
# We only produced one wheel (perhaps Pyodide)
5252
# check that it has the right name
5353
#
5454
# As far as I can tell, this is the only full test coverage for

0 commit comments

Comments
 (0)