diff --git a/src/packaging/tags.py b/src/packaging/tags.py index 6667d299..537115ed 100644 --- a/src/packaging/tags.py +++ b/src/packaging/tags.py @@ -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()) @@ -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()