Skip to content

Commit cf62f7f

Browse files
committed
Add Pyodide compatibility
We are changing our wheel platform tag to pyodide_2024_0 so we need to teach packaging to map Emscripten platform to this.
1 parent 3e67fc7 commit cf62f7f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/packaging/tags.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,13 @@ def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
502502
yield f"linux_{arch}"
503503

504504

505+
def _emscripten_platforms() -> Iterator[str]:
506+
pyodide_abi_version = sysconfig.get_config_var("PYODIDE_ABI_VERSION")
507+
if pyodide_abi_version:
508+
yield f"pyodide_{pyodide_abi_version}_wasm32"
509+
yield from _generic_platforms()
510+
511+
505512
def _generic_platforms() -> Iterator[str]:
506513
yield _normalize_string(sysconfig.get_platform())
507514

@@ -514,6 +521,8 @@ def platform_tags() -> Iterator[str]:
514521
return mac_platforms()
515522
elif platform.system() == "Linux":
516523
return _linux_platforms()
524+
elif platform.system() == "Emscripten":
525+
return _emscripten_platforms()
517526
else:
518527
return _generic_platforms()
519528

0 commit comments

Comments
 (0)