Skip to content

Updates for Pyodide 0.28 release #2487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,6 @@ jobs:
env:
CIBW_PLATFORM: pyodide

- name: Run a sample build (GitHub Action) for an overridden Pyodide version
uses: ./
with:
package-dir: sample_proj
output-dir: wheelhouse
# In case this breaks at any point in time, switch to using the latest version
# available or any other version that is not the same as the default one set
# in cibuildwheel/resources/build-platforms.toml.
env:
CIBW_PLATFORM: pyodide
CIBW_BUILD: "cp312*"
CIBW_PYODIDE_VERSION: "0.27.6"

- name: Run tests with 'CIBW_PLATFORM' set to 'pyodide'
run: |
uv run --no-sync ./bin/run_tests.py
Expand Down
15 changes: 11 additions & 4 deletions cibuildwheel/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,17 @@ def __call__(self, build_id: str) -> bool:
return False
if EnableGroup.GraalPy not in self.enable and fnmatch(build_id, "gp*"):
return False
if EnableGroup.PyodidePrerelease not in self.enable and fnmatch(
build_id, "cp313-pyodide_*"
):
return False
# TODO: Re-enable this when we have Pyodide prereleases again (e.g., 0.29.0a1+)
# Python 3.13 support became stable in Pyodide 0.28.0, so it no longer needs a prerelease
# flag.
# Also update Pyodide tests in unit_test/build_selector_test.py accordingly.
# When re-enabling, update the pattern to match the experimental Python version in case
# it is bumped to Python 3.14 (likely cp314-pyodide_* but could remain as 3.13 as well).
# This depends on the CPython version being used in the Pyodide runtime at the time.
# if EnableGroup.PyodidePrerelease not in self.enable and fnmatch(
# build_id, "cp313-pyodide_*"
# ):
# return False
Comment on lines +102 to +112
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what the best way to handle this would be. We don't have a Pyodide 0.29.0 pre-release yet because it's too early to have one. We usually stay one year behind CPython version compatibility, allowing our packages to complete their upgrades. The cp313-pyodide_wasm32 identifier might stay for Pyodide 0.29, or it might not. The CPython version could even change between Pyodide 0.29 alphas (or 0.30 alphas, for that matter).

We currently say that "If there are pre-releases available for a newer Pyodide version, the pyodide-prerelease can be used to include pre-release versions." in the documentation.

We could document there that cibuildwheel can disable the pyodide-prerelease option when there are no pre-releases available?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm personally okay with the commenting approach above.

As for the other points, yeah, I can see that it might get a little awkward around alphas, but that's probably okay, that's what alphas are for :) @henryiii were discussing some ideas in #2448 about the possibility of being able to add new identifiers at runtime, which might help? Having said that, I think we're gonna continue to want the python version in the identifier to support the functionality of the requires-python feature.


should_build = selector_matches(self.build_config, build_id)
should_skip = selector_matches(self.skip_config, build_id)
Expand Down
16 changes: 8 additions & 8 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1288,22 +1288,22 @@ The available Pyodide versions are determined by the version of `pyodide-build`

```toml
[tool.cibuildwheel.pyodide]
# Build Pyodide wheels using Pyodide version 0.27.6
pyodide-version = "0.27.6"
# Build Pyodide wheels using Pyodide version 0.28.0
pyodide-version = "0.28.0"

[tool.cibuildwheel.pyodide]
# Build Pyodide wheels using a specific alpha release
pyodide-version = "0.28.0a2"
# Build Pyodide wheels using a specific, previously released alpha release of 0.28.0
pyodide-version = "0.28.0a3"
```

!!! tab examples "Environment variables"

```yaml
# Build Pyodide wheels using Pyodide version 0.27.6
CIBW_PYODIDE_VERSION: 0.27.6
# Build Pyodide wheels using Pyodide version 0.28.0
CIBW_PYODIDE_VERSION: 0.28.0

# Build Pyodide wheels using a specific alpha release
CIBW_PYODIDE_VERSION: 0.28.0a2
# Build Pyodide wheels using a specific, previously released alpha release of 0.28.0
CIBW_PYODIDE_VERSION: 0.28.0a3
```


Expand Down
2 changes: 1 addition & 1 deletion docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ You must target pyodide with `--platform pyodide` (or use `--only` on the identi

It is also possible to target a specific Pyodide version by setting the [`pyodide-version`](options.md#pyodide-version) option to the desired version. Users are responsible for setting an appropriate Pyodide version according to the `pyodide-build` version. A list is available in Pyodide's [cross-build environments metadata file](https://github.com/pyodide/pyodide/blob/main/pyodide-cross-build-environments.json), which can be viewed more easily by installing `pyodide-build` from PyPI and using `pyodide xbuildenv search --all` to see a compatibility table.

If there are pre-releases available for a newer Python version, the `pyodide-prerelease` [`enable`](options.md#enable) can be used to include pre-release versions.
If there are pre-releases available for a newer Pyodide version, the `pyodide-prerelease` [`enable`](options.md#enable) can be used to include pre-release versions.

### Running tests

Expand Down
4 changes: 1 addition & 3 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ def _expected_wheels(
musllinux_versions = ["musllinux_1_2"]

if platform == "pyodide" and python_abi_tags is None:
python_abi_tags = ["cp312-cp312"]
if EnableGroup.PyodidePrerelease in enable_groups:
python_abi_tags.append("cp313-cp313")
python_abi_tags = ["cp312-cp312", "cp313-cp313"]
elif platform == "ios" and python_abi_tags is None:
python_abi_tags = ["cp313-cp313"]
elif python_abi_tags is None:
Expand Down
2 changes: 1 addition & 1 deletion unit_test/build_selector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_build_filter_pyodide():
enable=frozenset(),
)
assert build_selector("cp312-pyodide_wasm32")
assert not build_selector("cp313-pyodide_wasm32")
assert build_selector("cp313-pyodide_wasm32")


def test_skip():
Expand Down
4 changes: 2 additions & 2 deletions unit_test/options_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
environment-pass = ["EXAMPLE_ENV"]
pyodide-version = "0.27.6"
pyodide-version = "0.28.0"
[tool.cibuildwheel.macos]
test-requires = "else"
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_options_1(tmp_path, monkeypatch):
assert local.manylinux_images["x86_64"] == pinned_x86_64_container_image["manylinux_2_34"]

local = options.build_options("cp312-pyodide_wasm32")
assert local.pyodide_version == "0.27.6"
assert local.pyodide_version == "0.28.0"


def test_passthrough(tmp_path, monkeypatch):
Expand Down