Skip to content

Support PEP 783 pyemscripten_*_wasm32 wheel platform tag#3163

Draft
messense wants to merge 1 commit intoPyO3:mainfrom
messense:feat/pep-783-emscripten
Draft

Support PEP 783 pyemscripten_*_wasm32 wheel platform tag#3163
messense wants to merge 1 commit intoPyO3:mainfrom
messense:feat/pep-783-emscripten

Conversation

@messense
Copy link
Copy Markdown
Member

The Emscripten platform-tag branch in get_platform_tag now resolves the wheel tag through a priority cascade so maturin produces installable wheels across the full Pyodide release spectrum:

  1. pyemscripten_<year>_<patch>_wasm32 (PEP 783, Pyodide >= 0.30 / Python 3.14+), driven by MATURIN_PYEMSCRIPTEN_PLATFORM_VERSION / PYEMSCRIPTEN_PLATFORM_VERSION or pyodide config get pyemscripten_platform_version.
  2. pyodide_<year>_<patch>_wasm32 (Pyodide 0.28 / 0.29), driven by MATURIN_PYODIDE_ABI_VERSION / PYODIDE_ABI_VERSION or pyodide config get pyodide_abi_version.
  3. Legacy emscripten_<emcc-version>_wasm32 (Pyodide <= 0.27), still driven by MATURIN_EMSCRIPTEN_VERSION / emcc -dumpversion. A warning notes that wheels in this format are not installable on PEP 783-compliant runtimes.

The cascade is implemented as a pure function over an EmscriptenVersionInputs struct so the per-Pyodide-version behaviour can be covered deterministically by unit tests, and version segments are validated against the PEP 783 [0-9]+_[0-9]+ regex so malformed inputs fail loudly instead of producing a tag that no installer accepts.

The generated GitHub Actions workflow (generate-ci) now also exports PYEMSCRIPTEN_PLATFORM_VERSION and PYODIDE_ABI_VERSION from pyodide config get, defaulting to empty so older Pyodide releases keep producing the legacy tag.

For real-Pyodide coverage, noxfile.py learns to parse pyodide-lock.json (info.platform, info.abi_version, and a future info.pyemscripten_platform_version) into the matching env vars plus an EXPECTED_PLATFORM_TAG that test-emscripten asserts against the produced wheel filename. The CI test-emscripten job is now a matrix over Pyodide 0.28 and 0.29, and tests/emscripten_runner.js was updated to match all three Emscripten tag families when locating the built wheel.

The Emscripten platform-tag branch in `get_platform_tag` now resolves the
wheel tag through a priority cascade so maturin produces installable wheels
across the full Pyodide release spectrum:

1. `pyemscripten_<year>_<patch>_wasm32` (PEP 783, Pyodide >= 0.30 / Python
   3.14+), driven by `MATURIN_PYEMSCRIPTEN_PLATFORM_VERSION` /
   `PYEMSCRIPTEN_PLATFORM_VERSION` or `pyodide config get
   pyemscripten_platform_version`.
2. `pyodide_<year>_<patch>_wasm32` (Pyodide 0.28 / 0.29), driven by
   `MATURIN_PYODIDE_ABI_VERSION` / `PYODIDE_ABI_VERSION` or `pyodide config
   get pyodide_abi_version`.
3. Legacy `emscripten_<emcc-version>_wasm32` (Pyodide <= 0.27), still
   driven by `MATURIN_EMSCRIPTEN_VERSION` / `emcc -dumpversion`. A warning
   notes that wheels in this format are not installable on PEP 783-compliant
   runtimes.

The cascade is implemented as a pure function over an
`EmscriptenVersionInputs` struct so the per-Pyodide-version behaviour can be
covered deterministically by unit tests, and version segments are validated
against the PEP 783 `[0-9]+_[0-9]+` regex so malformed inputs fail loudly
instead of producing a tag that no installer accepts.

The generated GitHub Actions workflow (`generate-ci`) now also exports
`PYEMSCRIPTEN_PLATFORM_VERSION` and `PYODIDE_ABI_VERSION` from `pyodide
config get`, defaulting to empty so older Pyodide releases keep producing
the legacy tag.

For real-Pyodide coverage, `noxfile.py` learns to parse `pyodide-lock.json`
(`info.platform`, `info.abi_version`, and a future
`info.pyemscripten_platform_version`) into the matching env vars plus an
`EXPECTED_PLATFORM_TAG` that `test-emscripten` asserts against the produced
wheel filename. The CI `test-emscripten` job is now a matrix over Pyodide
0.28 and 0.29, and `tests/emscripten_runner.js` was updated to match all
three Emscripten tag families when locating the built wheel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant