break: drop Python 3.8 (#2686)

This commit is contained in:
Matthieu Darbois
2026-05-10 21:19:36 -04:00
committed by GitHub
parent cbef1e8b89
commit 8bdb703302
30 changed files with 115 additions and 420 deletions
-6
View File
@@ -9,12 +9,6 @@ MOCK_PACKAGE_DIR = Path("some_package_dir")
def pytest_addoption(parser: pytest.Parser) -> None:
parser.addoption("--run-docker", action="store_true", default=False, help="run docker tests")
parser.addoption("--run-podman", action="store_true", default=False, help="run podman tests")
parser.addoption(
"--run-cp38-universal2",
action="store_true",
default=False,
help="macOS cp38 uses the universal2 installer",
)
@pytest.fixture
+10 -11
View File
@@ -28,16 +28,16 @@ def test_linux_container_split(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
archs = "x86_64 i686"
[[tool.cibuildwheel.overrides]]
select = "cp{38,39,310}-*"
select = "cp{39,310,311}-*"
manylinux-x86_64-image = "other_container_image"
manylinux-i686-image = "other_container_image"
[[tool.cibuildwheel.overrides]]
select = "cp39-*"
before-all = "echo 'a cp39-only command'"
select = "cp310-*"
before-all = "echo 'a cp310-only command'"
[[tool.cibuildwheel.overrides]]
select = "cp310-*"
select = "cp311-*"
container-engine = "docker; create_args: --privileged"
"""
)
@@ -69,17 +69,17 @@ def test_linux_container_split(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
default_container_engine = OCIContainerEngineConfig(name="docker")
assert build_steps[0].container_image == "other_container_image"
assert identifiers(build_steps[0]) == ["cp38-manylinux_x86_64"]
assert identifiers(build_steps[0]) == ["cp39-manylinux_x86_64"]
assert before_alls(build_steps[0]) == [""]
assert container_engines(build_steps[0]) == [default_container_engine]
assert build_steps[1].container_image == "other_container_image"
assert identifiers(build_steps[1]) == ["cp39-manylinux_x86_64"]
assert before_alls(build_steps[1]) == ["echo 'a cp39-only command'"]
assert identifiers(build_steps[1]) == ["cp310-manylinux_x86_64"]
assert before_alls(build_steps[1]) == ["echo 'a cp310-only command'"]
assert container_engines(build_steps[1]) == [default_container_engine]
assert build_steps[2].container_image == "other_container_image"
assert identifiers(build_steps[2]) == ["cp310-manylinux_x86_64"]
assert identifiers(build_steps[2]) == ["cp311-manylinux_x86_64"]
assert before_alls(build_steps[2]) == [""]
assert container_engines(build_steps[2]) == [
OCIContainerEngineConfig(name="docker", create_args=("--privileged",))
@@ -87,11 +87,10 @@ def test_linux_container_split(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
assert build_steps[3].container_image == "normal_container_image"
assert identifiers(build_steps[3]) == [
"cp311-manylinux_x86_64",
"cp312-manylinux_x86_64",
"cp313-manylinux_x86_64",
"cp314-manylinux_x86_64",
"cp314t-manylinux_x86_64",
]
assert before_alls(build_steps[3]) == [""] * 5
assert container_engines(build_steps[3]) == [default_container_engine] * 5
assert before_alls(build_steps[3]) == [""] * 4
assert container_engines(build_steps[3]) == [default_container_engine] * 4
+16 -11
View File
@@ -433,20 +433,26 @@ def test_config_settings(
],
)
@pytest.mark.parametrize(
"pattern",
("pattern", "series"),
[
"cp27-*",
"cp35-*",
"?p36-*",
"?p27*",
"?p2*",
"?p35*",
"cp313t*",
("cp27-*", 1),
("cp35-*", 1),
("?p36-*", 2),
("?p37-*", 2),
("?p38-*", 3),
("?p27*", 1),
("?p2*", 1),
("?p35*", 1),
("cp313t*", None),
],
)
@pytest.mark.usefixtures("platform", "intercepted_build_args", "allow_empty")
def test_build_selector_deprecated_error(
monkeypatch: pytest.MonkeyPatch, selector: str, pattern: str, capsys: pytest.CaptureFixture[str]
monkeypatch: pytest.MonkeyPatch,
selector: str,
pattern: str,
series: int,
capsys: pytest.CaptureFixture[str],
) -> None:
monkeypatch.setenv(selector, pattern)
monkeypatch.delenv("CIBW_ENABLE", raising=False)
@@ -463,8 +469,7 @@ def test_build_selector_deprecated_error(
if pattern == "cp313t*":
msg = "cibuildwheel 4.x no longer supports Python 3.13 free-threading. Please use the 3.x series or update"
else:
series = "2" if "6" in pattern else "1"
msg = f"cibuildwheel 3.x no longer supports Python < 3.8. Please use the {series}.x series or update"
msg = f"cibuildwheel 4.x no longer supports Python < 3.9. Please use the {series}.x series or update"
assert msg in stderr
+10 -14
View File
@@ -13,8 +13,8 @@ from cibuildwheel.__main__ import main
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 | {"pp38", "pp39", "pp310", "pp311", "gp311_242", "gp312_250"}
DEFAULT_IDS = {"cp39", "cp310", "cp311", "cp312", "cp313", "cp314", "cp314t"}
ALL_IDS = DEFAULT_IDS | {"pp39", "pp310", "pp311", "gp311_242", "gp312_250"}
@pytest.fixture
@@ -110,12 +110,12 @@ archs = ["auto64", "auto32"]
# Before Python 3.10, use manylinux2014
[[tool.cibuildwheel.overrides]]
select = "cp3?-*"
select = "cp3?-* cp310-*"
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
[[tool.cibuildwheel.overrides]]
select = "cp38-manylinux_x86_64"
select = "cp39-manylinux_x86_64"
before-all = "true"
"""
)
@@ -136,8 +136,8 @@ before-all = "true"
assert kwargs["container"]["oci_platform"] == OCIPlatform.AMD64
identifiers = {x.identifier for x in kwargs["platform_configs"]}
assert identifiers == {"cp38-manylinux_x86_64"}
assert kwargs["options"].build_options("cp38-manylinux_x86_64").before_all == "true"
assert identifiers == {"cp39-manylinux_x86_64"}
assert kwargs["options"].build_options("cp39-manylinux_x86_64").before_all == "true"
kwargs = build_in_container.call_args_list[1][1]
assert "quay.io/pypa/manylinux2014_x86_64" in kwargs["container"]["image"]
@@ -149,14 +149,12 @@ before-all = "true"
f"{x}-manylinux_x86_64"
for x in ALL_IDS
- {
"cp38",
"cp310",
"cp39",
"cp311",
"cp312",
"cp313",
"cp314",
"cp314t",
"pp38",
"pp39",
"pp310",
"pp311",
@@ -164,7 +162,7 @@ before-all = "true"
"gp312_250",
}
}
assert kwargs["options"].build_options("cp39-manylinux_x86_64").before_all == ""
assert kwargs["options"].build_options("cp310-manylinux_x86_64").before_all == ""
kwargs = build_in_container.call_args_list[2][1]
assert "quay.io/pypa/manylinux_2_28_x86_64" in kwargs["container"]["image"]
@@ -174,13 +172,11 @@ before-all = "true"
assert identifiers == {
f"{x}-manylinux_x86_64"
for x in [
"cp310",
"cp311",
"cp312",
"cp313",
"cp314",
"cp314t",
"pp38",
"pp39",
"pp310",
"pp311",
@@ -194,7 +190,7 @@ before-all = "true"
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
assert kwargs["container"]["oci_platform"] == OCIPlatform.i386
identifiers = {x.identifier for x in kwargs["platform_configs"]}
assert identifiers == {"cp38-manylinux_i686", "cp39-manylinux_i686"}
assert identifiers == {"cp39-manylinux_i686", "cp310-manylinux_i686"}
kwargs = build_in_container.call_args_list[4][1]
assert "quay.io/pypa/manylinux_2_28_i686" in kwargs["container"]["image"]
@@ -202,7 +198,7 @@ before-all = "true"
assert kwargs["container"]["oci_platform"] == OCIPlatform.i386
identifiers = {x.identifier for x in kwargs["platform_configs"]}
assert identifiers == {
f"{x}-manylinux_i686" for x in ALL_IDS - {"cp38", "cp39"} if "gp" not in x
f"{x}-manylinux_i686" for x in ALL_IDS - {"cp39", "cp310"} if "gp" not in x
}
kwargs = build_in_container.call_args_list[5][1]
+1 -15
View File
@@ -576,27 +576,13 @@ def test_get_build_frontend_extra_flags(
monkeypatch.setattr(Logger, "warning", mock_warning)
build_frontend = BuildFrontendConfig(frontend, ["-1"])
args = get_build_frontend_extra_flags(
build_frontend=build_frontend, verbosity_level=verbosity, config_settings="a b", py38=False
build_frontend=build_frontend, verbosity_level=verbosity, config_settings="a b"
)
assert args == result
mock_warning.assert_not_called()
@pytest.mark.parametrize("frontend", ["build", "build[uv]"])
def test_get_build_frontend_extra_flags_warning(
frontend: Literal["build", "build[uv]"], monkeypatch: pytest.MonkeyPatch
) -> None:
mock_warning = unittest.mock.MagicMock()
monkeypatch.setattr(Logger, "warning", mock_warning)
build_frontend = BuildFrontendConfig(frontend, ["-1"])
args = get_build_frontend_extra_flags(
build_frontend=build_frontend, verbosity_level=-1, config_settings="a b", py38=True
)
assert args == ["-Ca", "-Cb", "-1"]
mock_warning.assert_called_once()
@pytest.mark.parametrize(
("config_settings", "expected"),
[