Skip to content

Commit

Permalink
Add Pyodide compatibility
Browse files Browse the repository at this point in the history
We are changing our wheel platform tag to pyodide_2024_0 so we need to teach
packaging to map Emscripten platform to this.
  • Loading branch information
hoodmane committed May 21, 2024
1 parent 3e67fc7 commit f57f98a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/packaging/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@ def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
yield f"linux_{arch}"


def _emscripten_platforms() -> Iterator[str]:
pyodide_abi_version = sysconfig.get_config_var("PYODIDE_ABI_VERSION")
if pyodide_abi_version:
yield "pyodide_" + pyodide_abi_version
yield from _generic_platforms()

def _generic_platforms() -> Iterator[str]:
yield _normalize_string(sysconfig.get_platform())

Expand All @@ -514,6 +520,8 @@ def platform_tags() -> Iterator[str]:
return mac_platforms()
elif platform.system() == "Linux":
return _linux_platforms()
elif platform.system() == "Emscripten":
return _emscripten_platforms()
else:
return _generic_platforms()

Expand Down

0 comments on commit f57f98a

Please sign in to comment.