Skip to content

Fix Pyodide Emscripten platform tags#3191

Open
messense wants to merge 1 commit into
PyO3:mainfrom
messense:fix-pyodide-pep783-tags
Open

Fix Pyodide Emscripten platform tags#3191
messense wants to merge 1 commit into
PyO3:mainfrom
messense:fix-pyodide-pep783-tags

Conversation

@messense
Copy link
Copy Markdown
Member

Emit PEP 783 pyemscripten_* platform tags whenever maturin receives a Pyodide ABI/platform version, including the historical PYODIDE_ABI_VERSION path used for Python 3.13. This matches current Pyodide docs and avoids generating pyodide_2025_0_wasm32, which PyPI rejects.

@messense messense linked an issue May 19, 2026 that may be closed by this pull request
2 tasks
@messense messense force-pushed the fix-pyodide-pep783-tags branch from 6eb63d5 to c3f9510 Compare May 19, 2026 13:10
Emit PEP 783 `pyemscripten_*` platform tags whenever maturin receives a Pyodide ABI/platform version, including the historical `PYODIDE_ABI_VERSION` path used for Python 3.13. This matches current Pyodide docs and avoids generating `pyodide_2025_0_wasm32`, which PyPI rejects.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates maturin’s Emscripten/Pyodide platform-tag resolution to consistently emit PEP 783 pyemscripten_*_wasm32 tags whenever a Pyodide ABI/platform version is provided (including the historical PYODIDE_ABI_VERSION path). It also adjusts the Emscripten runtime smoke test to remain compatible with older Pyodide runtimes that still validate legacy pyodide_*_wasm32 wheel filenames.

Changes:

  • Update Emscripten platform-tag cascade to always produce pyemscripten_{year}_{patch}_wasm32 for both PEP 783 and historical Pyodide ABI inputs.
  • Adjust CI/nox/docs to reflect the new behavior and environment-variable expectations.
  • Add a runtime-test compatibility copy/rename for Pyodide 0.28/0.29 wheel filename validation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/emscripten_runner.js Adds runtime-aware wheel path selection and legacy filename compatibility for older Pyodide runtimes.
src/target/platform_tag.rs Changes tag cascade to always emit PEP 783 pyemscripten_* tags for Pyodide ABI/platform version inputs; updates/extends unit tests.
src/ci/github/render.rs Updates generated GitHub Actions Emscripten setup to export PEP 783 platform version when available, else fall back to historical key.
noxfile.py Aligns expected wheel tag and exported env vars with always-pyemscripten_* behavior.
guide/src/environment-variables.md Updates documentation to describe historical PYODIDE_ABI_VERSION mapping to PEP 783 pyemscripten_* tags.
.github/workflows/test.yml Updates CI comments to reflect the intended pyemscripten_* tags for current Pyodide versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to 4
const { copyFile, mkdtemp, opendir } = require("node:fs/promises");
const { tmpdir } = require("node:os");
const { join } = require("node:path");
const { loadPyodide } = require("pyodide");
This wheel will not be installable on PEP 783-compliant Pyodide runtimes. \
Set `MATURIN_PYEMSCRIPTEN_PLATFORM_VERSION` (PEP 783) or \
`MATURIN_PYODIDE_ABI_VERSION` (Pyodide 0.28+) to produce a portable tag."
`MATURIN_PYODIDE_ABI_VERSION` (legacy Pyodide config key) to produce a portable tag."
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.

Maturin uses outdated platform tag for Emscripten

2 participants