Skip to content

Commit 31c984f

Browse files
authored
Merge pull request #130 from Point72/tkp/lowercase-wheel-tag
Lowercase the machine in wheel platform tags
2 parents 19dd006 + 0e383fa commit 31c984f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎hatch_cpp/plugin.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def _wheel_tag(platform: str, machine: str, version_major: int, version_minor: i
2828
os_name = "linux"
2929
else:
3030
os_name = "win"
31+
# platform.machine() reports AMD64/ARM64 on Windows, but PEP 425 platform tags are lowercase
32+
machine = machine.lower()
3133
abi = "abi3" if abi3 else f"cp{version_major}{version_minor}"
3234
return f"cp{version_major}{version_minor}-{abi}-{os_name}_{machine}"
3335

‎hatch_cpp/tests/test_structs.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ def test_pyodide_wheel_tag_requires_abi_version(self, monkeypatch: pytest.Monkey
8787
with pytest.raises(ValueError, match="PYODIDE_ABI_VERSION"):
8888
_wheel_tag("emscripten", "wasm32", 3, 14, False)
8989

90+
def test_wheel_tag_machine_is_lowercased(self):
91+
assert _wheel_tag("win32", "AMD64", 3, 11, False) == "cp311-cp311-win_amd64"
92+
assert _wheel_tag("win32", "ARM64", 3, 11, True) == "cp311-abi3-win_arm64"
93+
assert _wheel_tag("linux", "x86_64", 3, 11, False) == "cp311-cp311-linux_x86_64"
94+
9095
def test_pyodide_build_plan_compiles_objects_before_linking(self, monkeypatch: pytest.MonkeyPatch):
9196
monkeypatch.setenv("PYODIDE_ABI_VERSION", "2026_0")
9297
monkeypatch.setenv("CC", "/toolchain/cc")

0 commit comments

Comments
 (0)