From 7a67c6b5a9b98a3ac8c63ce05cbbf0665ea19ea7 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Mon, 22 Sep 2025 22:23:29 +0200 Subject: [PATCH] Add GraalPy 25 and remove workarounds for that version. (#2597) --- README.md | 1 + bin/update_pythons.py | 4 +++- cibuildwheel/platforms/windows.py | 12 ++++++------ cibuildwheel/resources/build-platforms.toml | 5 +++++ cibuildwheel/resources/pinned_docker_images.cfg | 1 - docs/options.md | 1 + test/test_abi_variants.py | 4 ++-- test/test_dependency_versions.py | 8 ++++---- test/utils.py | 6 ++++++ unit_test/option_prepare_test.py | 4 +++- 10 files changed, 31 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7f69fb5e..880cd201 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ While cibuildwheel itself requires a recent Python version to run (we support th | PyPy 3.10 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A | N/A | | PyPy 3.11 v7.3 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A | N/A | N/A | | GraalPy 3.11 v24.2 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | N/A | ✅¹ | N/A | N/A | N/A | N/A | N/A | N/A | +| GraalPy 3.12 v25.0 | ✅ | ✅ | ✅ | N/A | N/A | ✅¹ | N/A | ✅¹ | N/A | N/A | N/A | N/A | N/A | N/A | ¹ PyPy & GraalPy are only supported for manylinux wheels.
² Windows arm64 support is experimental.
diff --git a/bin/update_pythons.py b/bin/update_pythons.py index 3f186835..17f1b121 100755 --- a/bin/update_pythons.py +++ b/bin/update_pythons.py @@ -127,7 +127,9 @@ class GraalPyVersions: raise RuntimeError(msg) gpspec_str = identifier.split("-")[0].split("_")[1] - gpspec = Specifier("==24.2.*") if gpspec_str == "242" else Specifier(f"=={gpspec_str}.*") + if "." not in gpspec_str and len(gpspec_str) == 3: + gpspec_str = gpspec_str[:2] + "." + gpspec_str[-1] + gpspec = Specifier(f"=={gpspec_str}.*") releases = [r for r in self.releases if spec.contains(r["python_version"])] releases = [r for r in self.releases if gpspec.contains(r["graalpy_version"])] diff --git a/cibuildwheel/platforms/windows.py b/cibuildwheel/platforms/windows.py index ffc0d776..98c83b0f 100644 --- a/cibuildwheel/platforms/windows.py +++ b/cibuildwheel/platforms/windows.py @@ -339,11 +339,11 @@ def setup_python( setup_setuptools_cross_compile(tmp, python_configuration, python_libs_base, env) setup_rust_cross_compile(tmp, python_configuration, python_libs_base, env) - if implementation_id.startswith("gp"): - # GraalPy fails to discover compilers, setup the relevant environment + if implementation_id.startswith("gp311"): + # GraalPy 24 fails to discover compilers, setup the relevant environment # variables. Adapted from # https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt - # Remove when https://github.com/oracle/graalpython/issues/492 is fixed. + # Remove when GraalPy 24.x is dropped. vcpath = call( Path(os.environ["PROGRAMFILES(X86)"]) / "Microsoft Visual Studio" @@ -453,15 +453,15 @@ def build(options: Options, tmp_path: Path) -> None: ) if ( - config.identifier.startswith("gp") + config.identifier.startswith("gp311") and build_frontend.name == "build" and "--no-isolation" not in extra_flags and "-n" not in extra_flags ): - # GraalPy fails to discover its standard library when a venv is created + # GraalPy 24 fails to discover its standard library when a venv is created # from a virtualenv seeded executable. See # https://github.com/oracle/graalpython/issues/491 and remove this once - # fixed upstream. + # GraalPy 24 is dropped. log.notice( "Disabling build isolation to workaround GraalPy bug. If the build fails, consider using pip or build[uv] as build frontend." ) diff --git a/cibuildwheel/resources/build-platforms.toml b/cibuildwheel/resources/build-platforms.toml index 42700b50..7f7ce123 100644 --- a/cibuildwheel/resources/build-platforms.toml +++ b/cibuildwheel/resources/build-platforms.toml @@ -23,6 +23,7 @@ python_configurations = [ { identifier = "pp310-manylinux_x86_64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" }, { identifier = "pp311-manylinux_x86_64", version = "3.11", path_str = "/opt/python/pp311-pypy311_pp73" }, { identifier = "gp311_242-manylinux_x86_64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" }, + { identifier = "gp312_250-manylinux_x86_64", version = "3.12", path_str = "/opt/python/graalpy312-graalpy250_312_native" }, { identifier = "cp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/cp38-cp38" }, { identifier = "cp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/cp39-cp39" }, { identifier = "cp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/cp310-cp310" }, @@ -73,6 +74,7 @@ python_configurations = [ { identifier = "pp310-manylinux_aarch64", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" }, { identifier = "pp311-manylinux_aarch64", version = "3.11", path_str = "/opt/python/pp311-pypy311_pp73" }, { identifier = "gp311_242-manylinux_aarch64", version = "3.11", path_str = "/opt/python/graalpy311-graalpy242_311_native" }, + { identifier = "gp312_250-manylinux_aarch64", version = "3.12", path_str = "/opt/python/graalpy312-graalpy250_312_native" }, { identifier = "pp38-manylinux_i686", version = "3.8", path_str = "/opt/python/pp38-pypy38_pp73" }, { identifier = "pp39-manylinux_i686", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" }, { identifier = "pp310-manylinux_i686", version = "3.10", path_str = "/opt/python/pp310-pypy310_pp73" }, @@ -181,6 +183,8 @@ python_configurations = [ { identifier = "pp311-macosx_arm64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.20-macos_arm64.tar.bz2" }, { identifier = "gp311_242-macosx_x86_64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.2/graalpy-24.2.2-macos-amd64.tar.gz" }, { identifier = "gp311_242-macosx_arm64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.2/graalpy-24.2.2-macos-aarch64.tar.gz" }, + { identifier = "gp312_250-macosx_x86_64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.0/graalpy-25.0.0-macos-amd64.tar.gz" }, + { identifier = "gp312_250-macosx_arm64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.0/graalpy-25.0.0-macos-aarch64.tar.gz" }, ] [windows] @@ -216,6 +220,7 @@ python_configurations = [ { identifier = "pp310-win_amd64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.19-win64.zip" }, { identifier = "pp311-win_amd64", version = "3.11", url = "https://downloads.python.org/pypy/pypy3.11-v7.3.20-win64.zip" }, { identifier = "gp311_242-win_amd64", version = "3.11", url = "https://github.com/oracle/graalpython/releases/download/graal-24.2.2/graalpy-24.2.2-windows-amd64.zip" }, + { identifier = "gp312_250-win_amd64", version = "3.12", url = "https://github.com/oracle/graalpython/releases/download/graal-25.0.0/graalpy-25.0.0-windows-amd64.zip" }, ] [pyodide] diff --git a/cibuildwheel/resources/pinned_docker_images.cfg b/cibuildwheel/resources/pinned_docker_images.cfg index 35c61652..8072e4ea 100644 --- a/cibuildwheel/resources/pinned_docker_images.cfg +++ b/cibuildwheel/resources/pinned_docker_images.cfg @@ -50,4 +50,3 @@ musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2025.09.19-1 [riscv64] manylinux_2_39 = quay.io/pypa/manylinux_2_39_riscv64:2025.09.19-1 musllinux_1_2 = quay.io/pypa/musllinux_1_2_riscv64:2025.09.19-1 - diff --git a/docs/options.md b/docs/options.md index 34c082bc..b8072ea4 100644 --- a/docs/options.md +++ b/docs/options.md @@ -66,6 +66,7 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat | PyPy3.10 v7.3 | pp310-macosx_x86_64
pp310-macosx_arm64 | pp310-win_amd64 | pp310-manylinux_x86_64
pp310-manylinux_i686 | pp310-manylinux_aarch64 | | | | | PyPy3.11 v7.3 | pp311-macosx_x86_64
pp311-macosx_arm64 | pp311-win_amd64 | pp311-manylinux_x86_64
pp311-manylinux_i686 | pp311-manylinux_aarch64 | | | | | GraalPy 3.11 v24.2 | gp311_242-macosx_x86_64
gp311_242-macosx_arm64 | gp311_242-win_amd64 | gp311_242-manylinux_x86_64 | gp311_242-manylinux_aarch64 | | | +| GraalPy 3.12 v25.0 | gp312_250-macosx_x86_64
gp312_250-macosx_arm64 | gp312_250-win_amd64 | gp312_250-manylinux_x86_64 | gp312_250-manylinux_aarch64 | | | The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to cibuildwheel. The format is `python_tag-platform_tag`, with tags similar to those in [PEP 425](https://www.python.org/dev/peps/pep-0425/#details). diff --git a/test/test_abi_variants.py b/test/test_abi_variants.py index 2a849f3a..999323ae 100644 --- a/test/test_abi_variants.py +++ b/test/test_abi_variants.py @@ -41,7 +41,7 @@ def test_abi3(tmp_path): add_env={ # free_threaded, GraalPy, and PyPy do not have a Py_LIMITED_API equivalent, just build one of those # also limit the number of builds for test performance reasons - "CIBW_BUILD": "cp39-* cp310-* pp310-* gp311_242-* cp312-* cp313t-*", + "CIBW_BUILD": "cp39-* cp310-* pp310-* gp312_250-* cp312-* cp313t-*", "CIBW_ENABLE": "all", }, ) @@ -64,7 +64,7 @@ def test_abi3(tmp_path): "cp310-abi3", # <-- ABI3, works with 3.10 and 3.12 "cp313-cp313t", "pp310-pypy310_pp73", - "graalpy311-graalpy242_311_native", + "graalpy312-graalpy250_312_native", ], ) diff --git a/test/test_dependency_versions.py b/test/test_dependency_versions.py index 5aa84a50..ee022e10 100644 --- a/test/test_dependency_versions.py +++ b/test/test_dependency_versions.py @@ -140,11 +140,11 @@ def test_dependency_constraints(method, tmp_path, build_frontend_env_nouv): and method == "file" and build_frontend_env_nouv["CIBW_BUILD_FRONTEND"] == "build" ): - # GraalPy fails to discover its standard library when a venv is created + # GraalPy 24 fails to discover its standard library when a venv is created # from a virtualenv seeded executable. See # https://github.com/oracle/graalpython/issues/491 and remove this once - # fixed upstream. - build_frontend_env_nouv["CIBW_SKIP"] = "gp*" + # GraalPy 24 is dropped + build_frontend_env_nouv["CIBW_SKIP"] = "gp311*" for package_name, version in tool_versions.items(): env_name = f"EXPECTED_{package_name.upper()}_VERSION" @@ -172,6 +172,6 @@ def test_dependency_constraints(method, tmp_path, build_frontend_env_nouv): ): # See reference to https://github.com/oracle/graalpython/issues/491 # above - expected_wheels = [w for w in expected_wheels if "graalpy" not in w] + expected_wheels = [w for w in expected_wheels if "graalpy311" not in w] assert set(actual_wheels) == set(expected_wheels) diff --git a/test/utils.py b/test/utils.py index 5d565f2c..21fbb4f1 100644 --- a/test/utils.py +++ b/test/utils.py @@ -308,6 +308,7 @@ def _expected_wheels( if EnableGroup.GraalPy in enable_groups: python_abi_tags += [ "graalpy311-graalpy242_311_native", + "graalpy312-graalpy250_312_native", ] if machine_arch == "ARM64" and platform == "windows": @@ -367,6 +368,11 @@ def _expected_wheels( min_macosx = macosx_deployment_target else: min_macosx = _floor_macosx(macosx_deployment_target, "10.13") + elif python_abi_tag.startswith("graalpy"): + if python_abi_tag.startswith("graalpy311"): + min_macosx = macosx_deployment_target + else: + min_macosx = _floor_macosx(macosx_deployment_target, "10.13") else: min_macosx = macosx_deployment_target diff --git a/unit_test/option_prepare_test.py b/unit_test/option_prepare_test.py index 9412d085..e0a684b7 100644 --- a/unit_test/option_prepare_test.py +++ b/unit_test/option_prepare_test.py @@ -14,7 +14,7 @@ from cibuildwheel.oci_container import OCIPlatform from cibuildwheel.util import file DEFAULT_IDS = {"cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314", "cp314t"} -ALL_IDS = DEFAULT_IDS | {"cp313t", "pp38", "pp39", "pp310", "pp311", "gp311_242"} +ALL_IDS = DEFAULT_IDS | {"cp313t", "pp38", "pp39", "pp310", "pp311", "gp311_242", "gp312_250"} @pytest.fixture @@ -162,6 +162,7 @@ before-all = "true" "pp310", "pp311", "gp311_242", + "gp312_250", } } assert kwargs["options"].build_options("cp39-manylinux_x86_64").before_all == "" @@ -186,6 +187,7 @@ before-all = "true" "pp310", "pp311", "gp311_242", + "gp312_250", ] }