@@ -635,11 +635,11 @@ packages like aiohttp, Requests, Pydantic, cryptography, and orjson.
635635About 60 packages are also testing against Pyodide in their CI, including NumPy,
636636pandas, awkward-cpp, scikit-image, statsmodels, PyArrow, Hypothesis, and PyO3.
637637
638- Emscripten Wheel Format
639- ~~~~~~~~~~~~~~~~~~~~~~~
638+ Emscripten Wheel Tags
639+ ~~~~~~~~~~~~~~~~~~~~~
640640
641- Emscripten wheels will use either the format `` emscripten_<version>_wasm32 `` or
642- ``pyodide_<abi>_wasm32 ``. For example:
641+ Emscripten wheels will use as the platform tag either
642+ ``emscripten_<version>_wasm32 `` or `` pyodide_<abi>_wasm32 ``. For example:
643643
644644* ``emscripten_3_1_58_wasm32 ``
645645* ``pyodide_2025_0_wasm32 ``
@@ -651,6 +651,34 @@ depending on linker and compiler options. It is our intent that the
651651``pyodide_<abi> `` and ``emscripten_<version> `` is intended to be the same as the
652652relationship between ``manylinux<version> `` and ``linux ``.
653653
654+ For example, wheels with the following tags are compatible with Python 3.13
655+ Pyodide:
656+
657+ - ``cp13-cp13-emscripten_3_1_58_wasm32 ``
658+ - ``cp13-cp13-pyodide_2025_0_wasm32 ``
659+ - ``abi3-cp10-pyodide_2025_0_wasm32 ``
660+
661+ As well as all non platformed tags. To generate the list of compatible tags, one
662+ can use the following code:
663+
664+ .. code-block :: Python
665+
666+ from packaging.tags import cpython_tags, _generic_platforms
667+
668+ def _emscripten_platforms () -> Iterator[str ]:
669+ pyodide_abi_version = sysconfig.get_config_var(" PYODIDE_ABI_VERSION" )
670+ if pyodide_abi_version:
671+ yield f " pyodide_ { pyodide_abi_version} _wasm32 "
672+ yield from _generic_platforms()
673+
674+ emscripten_tags = cpython_tags(platforms = _emscripten_platforms())
675+
676+ `This code will be added to pypa/packaging
677+ <https://github.com/pypa/packaging/pull/804> `__.
678+
679+ Emscripten Wheel ABI
680+ ~~~~~~~~~~~~~~~~~~~~
681+
654682The specification of the ``pyodide_<abi> `` ABI includes:
655683
656684* Which version of the Emscripten compiler is used
@@ -674,6 +702,20 @@ with manylinux, there is no need for a Docker container to build the
674702``pyodide_<abi> `` wheels. All that is needed is a Linux machine and appropriate
675703versions of Python, Node.js, and Emscripten.
676704
705+ Dependency Specifier Markers
706+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
707+
708+ To check for the Emscripten platform in a dependency specifier, one can use
709+ `sys_platform == 'emscripten' ` (or its negation). Such checks are already in use
710+ in the wild and seem to be sufficient for the needs of the community.
711+
712+ Trove Classifier
713+ ~~~~~~~~~~~~~~~~
714+
715+ Packages that build and test Emscripten wheels can declare this by adding the
716+ ``Environment :: WebAssembly :: Emscripten ``. PyPI already accepts uploads of
717+ packages with this classifier.
718+
677719
678720PEP 11
679721------
@@ -767,7 +809,8 @@ partially-upstreamed features so that Pyodide can replace them with more
767809complete versions downstream.
768810
769811These backwards compatibility concerns impact not just the runtime but also the
770- packaging system.
812+ packaging system. Adding new platform tags should not affect existing packaging
813+ tools because tools ignore wheels with an unknown package tag.
771814
772815
773816Security Implications
@@ -790,8 +833,11 @@ to use them all at runtime. The documentation will cover this in a similar form
790833to the existing Windows embeddable package. In the short term, we will encourage
791834developers to use Pyodide if at all possible.
792835
793- Second, developers of packages with binary components need to know how to build
794- and release them for Emscripten (see Packaging).
836+ Second, maintainers of packages with binary components need to know how to
837+ build, test, label, and deploy them for Emscripten (see Packaging). The Pyodide
838+ documentation on `building and testing packages
839+ <https://pyodide.org/en/stable/development/building-and-testing-packages.html> `__
840+ is the best reference for this.
795841
796842
797843Reference Implementation
0 commit comments