Skip to content

Commit

Permalink
Build CPython 3.13 by default (#1950)
Browse files Browse the repository at this point in the history
* Build CPython 3.13 by default

Enable building with CPython 3.13 by default, no longer requiring prerelease_pythons flag to be set true.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* README.md: Add note about free-threaded support

* 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.

* fix unit tests

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mayeut <[email protected]>
  • Loading branch information
3 people authored Aug 3, 2024
1 parent 8a69dbd commit 9d023cf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ What does it do?

<sup>¹ PyPy is only supported for manylinux wheels.</sup><br>
<sup>² Windows arm64 support is experimental.</sup><br>
<sup>³ 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.</sup><br>
<sup>³ 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).</sup><br>
<sup>⁴ Experimental, not yet supported on PyPI, but can be used directly in web deployment. Use `--platform pyodide` to build.</sup><br>

- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions unit_test/build_selector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

Expand Down
5 changes: 3 additions & 2 deletions unit_test/linux_build_steps_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ 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 container_engines(build_steps[0]) == [default_container_engine] * 3
assert before_alls(build_steps[0]) == [""] * 4
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"]
Expand Down
6 changes: 4 additions & 2 deletions unit_test/option_prepare_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"cp310",
"cp311",
"cp312",
"cp313",
"pp37",
"pp38",
"pp39",
Expand Down Expand Up @@ -155,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", "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 == ""

Expand All @@ -166,7 +168,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]
Expand Down

0 comments on commit 9d023cf

Please sign in to comment.