From b34466fa7df05abb0d80b4c2ec866f5a085216ff Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Thu, 1 Aug 2024 13:35:29 +0100 Subject: [PATCH 1/5] Build CPython 3.13 by default Enable building with CPython 3.13 by default, no longer requiring prerelease_pythons flag to be set true. --- README.md | 2 +- cibuildwheel/util.py | 2 +- unit_test/build_selector_test.py | 6 +++--- unit_test/linux_build_steps_test.py | 3 ++- unit_test/option_prepare_test.py | 5 +++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a45b99213..b9069ddf7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ What does it do? ¹ PyPy is only supported for manylinux wheels.
² Windows arm64 support is experimental.
-³ CPython 3.13 is available using the [`CIBW_PRERELEASE_PYTHONS`](https://cibuildwheel.pypa.io/en/stable/options/#prerelease-pythons) option. Free-threaded mode requires opt-in.
+³ CPython 3.13 is built by default using Python RCs, starting with cibuildwheel 2.20.
⁴ Experimental, not yet supported on PyPI, but can be used directly in web deployment. Use `--platform pyodide` to build.
- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py index 555a914c7..31b3eaf86 100644 --- a/cibuildwheel/util.py +++ b/cibuildwheel/util.py @@ -248,7 +248,7 @@ class BuildSelector: requires_python: SpecifierSet | None = None # a pattern that skips prerelease versions, when include_prereleases is False. - PRERELEASE_SKIP: ClassVar[str] = "cp313-* cp313t-*" + PRERELEASE_SKIP: ClassVar[str] = "" prerelease_pythons: bool = False free_threaded_support: bool = False diff --git a/unit_test/build_selector_test.py b/unit_test/build_selector_test.py index 6066c82e8..27576f55f 100644 --- a/unit_test/build_selector_test.py +++ b/unit_test/build_selector_test.py @@ -13,7 +13,7 @@ def test_build(): assert build_selector("cp310-manylinux_x86_64") assert build_selector("cp311-manylinux_x86_64") assert build_selector("cp312-manylinux_x86_64") - assert not build_selector("cp313-manylinux_x86_64") + assert build_selector("cp313-manylinux_x86_64") assert build_selector("pp36-manylinux_x86_64") assert build_selector("pp37-manylinux_x86_64") assert build_selector("cp36-manylinux_i686") @@ -34,7 +34,7 @@ def test_build(): assert build_selector("cp310-win_amd64") assert build_selector("cp311-win_amd64") assert build_selector("cp312-win_amd64") - assert not build_selector("cp313-win_amd64") + assert build_selector("cp313-win_amd64") assert not build_selector("pp36-win_amd64") assert not build_selector("pp37-win_amd64") @@ -50,7 +50,7 @@ def test_build_filter_pre(): assert build_selector("cp313-manylinux_x86_64") assert build_selector("cp37-win_amd64") assert build_selector("cp313-win_amd64") - assert not build_selector("cp313t-manylinux_x86_64") + assert build_selector("cp313t-manylinux_x86_64") def test_skip(): diff --git a/unit_test/linux_build_steps_test.py b/unit_test/linux_build_steps_test.py index f285abec5..223a90d20 100644 --- a/unit_test/linux_build_steps_test.py +++ b/unit_test/linux_build_steps_test.py @@ -71,8 +71,9 @@ def container_engines(step): "cp36-manylinux_x86_64", "cp311-manylinux_x86_64", "cp312-manylinux_x86_64", + "cp313-manylinux_x86_64", ] - assert before_alls(build_steps[0]) == [""] * 3 + assert before_alls(build_steps[0]) == [""] * 4 assert container_engines(build_steps[0]) == [default_container_engine] * 3 assert build_steps[1].container_image == "other_container_image" diff --git a/unit_test/option_prepare_test.py b/unit_test/option_prepare_test.py index ce164012c..5dd415d0e 100644 --- a/unit_test/option_prepare_test.py +++ b/unit_test/option_prepare_test.py @@ -21,6 +21,7 @@ "cp310", "cp311", "cp312", + "cp313", "pp37", "pp38", "pp39", @@ -155,7 +156,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path): identifiers = {x.identifier for x in kwargs["platform_configs"]} assert identifiers == { f"{x}-manylinux_x86_64" - for x in ALL_IDS - {"cp36", "cp310", "cp311", "cp312", "pp37", "pp38", "pp39", "pp310"} + for x in ALL_IDS - {"cp36", "cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"} } assert kwargs["options"].build_options("cp37-manylinux_x86_64").before_all == "" @@ -166,7 +167,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path): identifiers = {x.identifier for x in kwargs["platform_configs"]} assert identifiers == { f"{x}-manylinux_x86_64" - for x in ["cp310", "cp311", "cp312", "pp37", "pp38", "pp39", "pp310"] + for x in ["cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"] } kwargs = build_in_container.call_args_list[3][1] From a75a7d0e89c566d5b82cf1b1a77e547c45d2afc6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:40:23 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unit_test/option_prepare_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unit_test/option_prepare_test.py b/unit_test/option_prepare_test.py index 5dd415d0e..97290eb2a 100644 --- a/unit_test/option_prepare_test.py +++ b/unit_test/option_prepare_test.py @@ -156,7 +156,8 @@ def test_build_with_override_launches(monkeypatch, tmp_path): identifiers = {x.identifier for x in kwargs["platform_configs"]} assert identifiers == { f"{x}-manylinux_x86_64" - for x in ALL_IDS - {"cp36", "cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"} + for x in ALL_IDS + - {"cp36", "cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"} } assert kwargs["options"].build_options("cp37-manylinux_x86_64").before_all == "" From ca017c6e5b500a4314c04437c2aa9c0a2c76b477 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Thu, 1 Aug 2024 23:06:16 +0200 Subject: [PATCH 3/5] README.md: Add note about free-threaded support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9069ddf7..38855e21e 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ What does it do? ¹ PyPy is only supported for manylinux wheels.
² Windows arm64 support is experimental.
-³ CPython 3.13 is built by default using Python RCs, starting with cibuildwheel 2.20.
+³ CPython 3.13 is built by default using Python RCs, starting with cibuildwheel 2.20. Free-threaded mode will still require opt-in using [`CIBW_FREE_THREADED_SUPPORT`](https://cibuildwheel.pypa.io/en/stable/options/#free-threaded-support).
⁴ Experimental, not yet supported on PyPI, but can be used directly in web deployment. Use `--platform pyodide` to build.
- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy From 56cbcb02efb9fc99edd80d422ee8cbdd4c9d0c4d Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Sat, 3 Aug 2024 18:33:11 +0200 Subject: [PATCH 4/5] build_selector_test.py: cp313t still behind flag Even with 3.13 being enabled by default, cp313t is still behind a flag for now. This commit updates the test accordingly. --- unit_test/build_selector_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_test/build_selector_test.py b/unit_test/build_selector_test.py index 27576f55f..f89222461 100644 --- a/unit_test/build_selector_test.py +++ b/unit_test/build_selector_test.py @@ -50,7 +50,7 @@ def test_build_filter_pre(): assert build_selector("cp313-manylinux_x86_64") assert build_selector("cp37-win_amd64") assert build_selector("cp313-win_amd64") - assert build_selector("cp313t-manylinux_x86_64") + assert not build_selector("cp313t-manylinux_x86_64") def test_skip(): From 93f093ef5555d4690dd071514562c9514322ccb8 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 3 Aug 2024 18:49:37 +0200 Subject: [PATCH 5/5] fix unit tests --- unit_test/linux_build_steps_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_test/linux_build_steps_test.py b/unit_test/linux_build_steps_test.py index 223a90d20..4a1d9e9b8 100644 --- a/unit_test/linux_build_steps_test.py +++ b/unit_test/linux_build_steps_test.py @@ -74,7 +74,7 @@ def container_engines(step): "cp313-manylinux_x86_64", ] assert before_alls(build_steps[0]) == [""] * 4 - assert container_engines(build_steps[0]) == [default_container_engine] * 3 + assert container_engines(build_steps[0]) == [default_container_engine] * 4 assert build_steps[1].container_image == "other_container_image" assert identifiers(build_steps[1]) == ["cp37-manylinux_x86_64", "cp38-manylinux_x86_64"]