2026-05-09 23:31:41 +05:30
# Maintaining Pyodide support
2026-08-04 14:41:22 -07:00
Last updated: August 2026
2026-05-09 23:31:41 +05:30
This page describes how to update cibuildwheel's Pyodide platform code when either:
- a new Pyodide alpha release arrives with support for a new [PyEmscripten Platform ](https://pyodide.org/en/latest/development/abi.html ) (which is tied to updates in Emscripten and CPython versions, compiler/linker flags, and so on), or
- when that alpha release graduates to a stable one.
## Background
Pyodide has three types of releases that matter to cibuildwheel:
2026-08-04 14:41:22 -07:00
- **Stable** – the most recent full Pyodide release.
This is enabled by default with no special `CIBW_ENABLE` flag needed.
- **Prerelease** – an alpha/beta/rc Pyodide release that uses the _next_ CPython
version. Users must opt in with `CIBW_ENABLE:
cpython-prerelease` to build against this version. This may or may not be
available at any given time, depending on the Pyodide release cycle.
- **End-of-life (EoL)** – older Pyodide stable releases that are no longer the
current stable. These are kept available behind `CIBW_ENABLE: pyodide-eol` so
that users who still need to build for older Pyodide versions can do so.
2026-05-09 23:31:41 +05:30
2026-08-04 14:41:22 -07:00
The guards in `cibuildwheel/selector.py` enforce this distinction. The
constraints files under `cibuildwheel/resources/` pin the exact tool versions
that go with each build.
2026-05-09 23:31:41 +05:30
---
## When a new Pyodide prerelease becomes available
2026-08-04 14:41:22 -07:00
For example, consider a scenario when Pyodide ships a new `315.0.0a1` with cp315
support.
2026-05-09 23:31:41 +05:30
### 1. Add the new Python configuration
In `cibuildwheel/resources/build-platforms.toml` , add an entry under `[pyodide]` :
```toml
2026-05-29 15:02:33 -04:00
{ identifier = "cp315-pyodide_wasm32" , version = "3.15" , default_pyodide_version = "315.0.0a1" , node_version = "v24" , sha256 = "SHA256" },
2026-05-09 23:31:41 +05:30
```
2026-08-04 14:41:22 -07:00
`version` is the CPython version string, `default_pyodide_version` is the
Pyodide release to use when the user does not pin one explicitly (use the latest
available alpha/beta for a prerelease entry), and `node_version` is the minimum
Node.js major required by that Pyodide release — check the
[pyodide-build FAQ ](https://pyodide-build.readthedocs.io/en/latest/faq.html#what-node-js-version-do-i-need )
for a rudimentary idea of what the correct value is. `sha256` is the checksum of
the Pyodide xbuildenv tarball.
2026-05-09 23:31:41 +05:30
2026-08-04 14:41:22 -07:00
### 2. Generate and pin a constraints file
2026-05-09 23:31:41 +05:30
2026-08-04 14:41:22 -07:00
Run the `update_constraints` `nox` session, which reads `build-platforms.toml`
and regenerates all Pyodide constraints files automatically:
2026-05-09 23:31:41 +05:30
```bash
nox -s update_constraints
```
2026-08-04 14:41:22 -07:00
### 3. Update tests
2026-05-09 23:31:41 +05:30
2026-08-04 14:41:22 -07:00
Update the unit tests so the new identifier is accepted by the selector with
`CPythonPrerelease` enabled and rejected without it. Pyodide-specific
integration tests may also need their hardcoded expected-wheel lists extended.
2026-05-09 23:31:41 +05:30
## When an old Pyodide version is to be moved to end-of-life
2026-08-04 14:41:22 -07:00
When a Pyodide version is superseded by a new stable release, move it behind the
`pyodide-eol` enable flag. We want to allow users who still build for older
Pyodide ABIs time to upgrade.
2026-05-09 23:31:41 +05:30
### 1. Add the `pyodide-eol` guard in the selector
2026-08-04 14:41:22 -07:00
In `cibuildwheel/selector.py` , add (or update) the `PyodideEoL` guard to include
the old identifier:
2026-05-09 23:31:41 +05:30
```python
if EnableGroup . PyodideEoL not in self . enable and fnmatch ( build_id , "cp312-pyodide_*" ):
return False
```
### 2. Update tests
2026-08-04 14:41:22 -07:00
Update the unit tests so the EoL identifier requires `PyodideEoL` to be included
in the enable set. The default (no `CIBW_ENABLE` ) should exclude it.
2026-05-09 23:31:41 +05:30
## When an old Pyodide version is to be fully retired
2026-08-04 14:41:22 -07:00
Retirement is not expected to happen on a routine basis. It is only warranted
when the Pyodide ecosystem itself has evolved to the point where an older ABI
version is considered obsolete – for example, if the surrounding toolchain,
packaging standards, or runtime infrastructure have moved on so substantially
that building for the older version no longer makes practical sense. Any
retirement is to be discussed and agreed upon by Pyodide maintainers before
proceeding.
2026-05-09 23:31:41 +05:30
### 1. Remove the Python configuration
2026-08-04 14:41:22 -07:00
Delete the entry from `build-platforms.toml` and remove the `PyodideEoL` guard
for that identifier in `selector.py` .
2026-05-09 23:31:41 +05:30
### 2. Delete the constraints file
Remove `cibuildwheel/resources/constraints-pyodideXYZ.txt` .
### 3. Update tests
2026-08-04 14:41:22 -07:00
Remove references to the old identifier from the unit tests, integration tests,
and drop any expected-wheel entries for it from the test helper.