Skip to content

Commit 9d023cf

Browse files
EwoutHpre-commit-ci[bot]mayeut
authored
Build CPython 3.13 by default (#1950)
* 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 <mayeut@users.noreply.github.com>
1 parent 8a69dbd commit 9d023cf

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ What does it do?
3939

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

4545
- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy

cibuildwheel/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class BuildSelector:
248248
requires_python: SpecifierSet | None = None
249249

250250
# a pattern that skips prerelease versions, when include_prereleases is False.
251-
PRERELEASE_SKIP: ClassVar[str] = "cp313-* cp313t-*"
251+
PRERELEASE_SKIP: ClassVar[str] = ""
252252
prerelease_pythons: bool = False
253253

254254
free_threaded_support: bool = False

unit_test/build_selector_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_build():
1313
assert build_selector("cp310-manylinux_x86_64")
1414
assert build_selector("cp311-manylinux_x86_64")
1515
assert build_selector("cp312-manylinux_x86_64")
16-
assert not build_selector("cp313-manylinux_x86_64")
16+
assert build_selector("cp313-manylinux_x86_64")
1717
assert build_selector("pp36-manylinux_x86_64")
1818
assert build_selector("pp37-manylinux_x86_64")
1919
assert build_selector("cp36-manylinux_i686")
@@ -34,7 +34,7 @@ def test_build():
3434
assert build_selector("cp310-win_amd64")
3535
assert build_selector("cp311-win_amd64")
3636
assert build_selector("cp312-win_amd64")
37-
assert not build_selector("cp313-win_amd64")
37+
assert build_selector("cp313-win_amd64")
3838
assert not build_selector("pp36-win_amd64")
3939
assert not build_selector("pp37-win_amd64")
4040

unit_test/linux_build_steps_test.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ def container_engines(step):
7171
"cp36-manylinux_x86_64",
7272
"cp311-manylinux_x86_64",
7373
"cp312-manylinux_x86_64",
74+
"cp313-manylinux_x86_64",
7475
]
75-
assert before_alls(build_steps[0]) == [""] * 3
76-
assert container_engines(build_steps[0]) == [default_container_engine] * 3
76+
assert before_alls(build_steps[0]) == [""] * 4
77+
assert container_engines(build_steps[0]) == [default_container_engine] * 4
7778

7879
assert build_steps[1].container_image == "other_container_image"
7980
assert identifiers(build_steps[1]) == ["cp37-manylinux_x86_64", "cp38-manylinux_x86_64"]

unit_test/option_prepare_test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"cp310",
2222
"cp311",
2323
"cp312",
24+
"cp313",
2425
"pp37",
2526
"pp38",
2627
"pp39",
@@ -155,7 +156,8 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
155156
identifiers = {x.identifier for x in kwargs["platform_configs"]}
156157
assert identifiers == {
157158
f"{x}-manylinux_x86_64"
158-
for x in ALL_IDS - {"cp36", "cp310", "cp311", "cp312", "pp37", "pp38", "pp39", "pp310"}
159+
for x in ALL_IDS
160+
- {"cp36", "cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"}
159161
}
160162
assert kwargs["options"].build_options("cp37-manylinux_x86_64").before_all == ""
161163

@@ -166,7 +168,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
166168
identifiers = {x.identifier for x in kwargs["platform_configs"]}
167169
assert identifiers == {
168170
f"{x}-manylinux_x86_64"
169-
for x in ["cp310", "cp311", "cp312", "pp37", "pp38", "pp39", "pp310"]
171+
for x in ["cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"]
170172
}
171173

172174
kwargs = build_in_container.call_args_list[3][1]

0 commit comments

Comments
 (0)