deprecation: cp313t (#2787)

Free-Threading Python 3.13 was experimental.
Now that Python 3.14 has been released with explicit support, we can schedule removal of Python 3.13 free-threading.
This commit is contained in:
Matthieu Darbois
2026-04-02 14:39:47 +01:00
committed by GitHub
parent 097806b6b1
commit 54b8a010d0
6 changed files with 90 additions and 10 deletions
+74
View File
@@ -1,3 +1,4 @@
import os
import sys
import tomllib
from collections.abc import Mapping
@@ -167,6 +168,78 @@ def test_empty_selector(monkeypatch: pytest.MonkeyPatch) -> None:
assert e.value.code == 3
@pytest.mark.usefixtures("platform", "intercepted_build_args")
def test_cp313t_warning1(
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
) -> None:
monkeypatch.setenv("CIBW_ENABLE", "cpython-freethreading")
main()
_, err = capsys.readouterr()
print(err)
assert "'cpython-freethreading' enable is deprecated" in err
@pytest.mark.usefixtures("platform", "intercepted_build_args")
def test_cp313t_warning2(
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
) -> None:
local_path = tmp_path / "tmp_project"
os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already
local_path.joinpath("setup.py").touch()
monkeypatch.setattr(
sys, "argv", ["cibuildwheel", "--only", "cp313t-manylinux_x86_64", str(local_path)]
)
monkeypatch.setenv("CIBW_ENABLE", "cpython-freethreading")
main()
_, err = capsys.readouterr()
print(err)
assert "'cpython-freethreading' enable is deprecated" in err
@pytest.mark.usefixtures("platform", "intercepted_build_args")
def test_cp313t_warning3(
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
) -> None:
local_path = tmp_path / "tmp_project"
os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already
local_path.joinpath("setup.py").touch()
monkeypatch.setattr(
sys, "argv", ["cibuildwheel", "--only", "cp313t-manylinux_x86_64", str(local_path)]
)
main()
_, err = capsys.readouterr()
print(err)
assert "'cpython-freethreading' enable is deprecated" in err
@pytest.mark.usefixtures("platform", "intercepted_build_args")
def test_cp313t_warning4(
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], tmp_path: Path
) -> None:
local_path = tmp_path / "tmp_project"
os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already
local_path.joinpath("setup.py").touch()
monkeypatch.setattr(
sys, "argv", ["cibuildwheel", "--only", "cp313t-manylinux_x86_64", str(local_path)]
)
monkeypatch.setenv("CIBW_ENABLE", "all")
main()
_, err = capsys.readouterr()
print(err)
assert "'cpython-freethreading' enable is deprecated" in err
@pytest.mark.parametrize(
("architecture", "image", "full_image"),
[
@@ -579,6 +652,7 @@ def test_enable_all(
intercepted_build_args: "ArgsInterceptor", monkeypatch: pytest.MonkeyPatch
) -> None:
monkeypatch.setattr(sys, "argv", [*sys.argv, "--enable", "all"])
monkeypatch.delenv("CIBW_ENABLE", raising=False)
main()