From cd9b48cb74a7f215d10ab74d9cf6a139f0279eec Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 13 Jul 2025 07:08:50 +0530 Subject: [PATCH] feat: Pyodide 0.28 release (#2487) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump testing version to 0.28.0 * Bump Pyodide constraints * Add Pyodide 0.28.0 identifier * Override to a different, alpha version for testing * Update docs for Pyodide versions everywhere * Add comment on using older Pyodide alpha version * Bump to `"cp313*"` for compatibility * Drop identifier for Pyodide 0.28.0a3 * Add back Pyodide 0.28.0a3 identifier * Add helpful comment about pyodide-prerelease option * Fix test and add a comment about it * Keep one Pyodide version per Python version * Fix docs for `pyodide-prerelease`; Python ➡️ Pyodide * Update utils.py * Drop CI test step for overridden Pyodide version Suggested-by: Joe Rickerby --------- Co-authored-by: Henry Schreiner --- .github/workflows/test.yml | 13 ------------- cibuildwheel/selector.py | 15 +++++++++++---- docs/options.md | 16 ++++++++-------- docs/platforms.md | 2 +- test/utils.py | 4 +--- unit_test/build_selector_test.py | 2 +- unit_test/options_test.py | 4 ++-- 7 files changed, 24 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b99ee74d..229bce92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/cibuildwheel/selector.py b/cibuildwheel/selector.py index 256e4fb0..f0bce928 100644 --- a/cibuildwheel/selector.py +++ b/cibuildwheel/selector.py @@ -99,10 +99,17 @@ class BuildSelector: 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 should_build = selector_matches(self.build_config, build_id) should_skip = selector_matches(self.skip_config, build_id) diff --git a/docs/options.md b/docs/options.md index ed2fadcb..d545adc1 100644 --- a/docs/options.md +++ b/docs/options.md @@ -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 ``` diff --git a/docs/platforms.md b/docs/platforms.md index 84a8cb50..17cc40a8 100644 --- a/docs/platforms.md +++ b/docs/platforms.md @@ -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 diff --git a/test/utils.py b/test/utils.py index 749e54dc..ccd467aa 100644 --- a/test/utils.py +++ b/test/utils.py @@ -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: diff --git a/unit_test/build_selector_test.py b/unit_test/build_selector_test.py index 601fe25f..4c723244 100644 --- a/unit_test/build_selector_test.py +++ b/unit_test/build_selector_test.py @@ -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(): diff --git a/unit_test/options_test.py b/unit_test/options_test.py index 8bf7e569..d1207aa1 100644 --- a/unit_test/options_test.py +++ b/unit_test/options_test.py @@ -35,7 +35,7 @@ manylinux-x86_64-image = "manylinux_2_28" environment-pass = ["EXAMPLE_ENV"] -pyodide-version = "0.27.6" +pyodide-version = "0.28.0" [tool.cibuildwheel.macos] test-requires = "else" @@ -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):