feat: drop EOL manylinux images (#2316)

* drop EOL manylinux images

* chore: use multi-arch manylinux images as a source for image tag

Using multi-arch images directly messes with parallel tests for now.
Using them as a source for image tag ensures that all architecture specific tags are pointing to the same tag for a given manylinux / musllinux policy.

* Apply review suggestion

Co-authored-by: Joe Rickerby <joerick@mac.com>

---------

Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
Matthieu Darbois
2025-03-22 12:26:38 -04:00
committed by GitHub
co-authored by Joe Rickerby
parent 3b9c8d4d22
commit 059d8ea25a
16 changed files with 128 additions and 252 deletions
@@ -80,24 +80,15 @@ def test_empty_selector(monkeypatch):
("architecture", "image", "full_image"),
[
("x86_64", None, "quay.io/pypa/manylinux2014_x86_64:*"),
("x86_64", "manylinux1", "quay.io/pypa/manylinux1_x86_64:*"),
("x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
("x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
("x86_64", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_x86_64:*"),
("x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_x86_64:*"),
("x86_64", "manylinux_2_34", "quay.io/pypa/manylinux_2_34_x86_64:*"),
("x86_64", "custom_image", "custom_image"),
("i686", None, "quay.io/pypa/manylinux2014_i686:*"),
("i686", "manylinux1", "quay.io/pypa/manylinux1_i686:*"),
("i686", "manylinux2010", "quay.io/pypa/manylinux2010_i686:*"),
("i686", "manylinux2014", "quay.io/pypa/manylinux2014_i686:*"),
("i686", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_i686:*"),
("i686", "custom_image", "custom_image"),
("pypy_x86_64", None, "quay.io/pypa/manylinux2014_x86_64:*"),
("pypy_x86_64", "manylinux1", "manylinux1"), # Does not exist
("pypy_x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
("pypy_x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
("pypy_x86_64", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_x86_64:*"),
("pypy_x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_x86_64:*"),
("pypy_x86_64", "manylinux_2_34", "quay.io/pypa/manylinux_2_34_x86_64:*"),
("pypy_x86_64", "custom_image", "custom_image"),
+3 -13
View File
@@ -28,14 +28,8 @@ from cibuildwheel.oci_container import (
# for these tests we use manylinux2014 images, because they're available on
# multi architectures and include python3.8
DEFAULT_IMAGE_TEMPLATE = "quay.io/pypa/manylinux2014_{machine}:2023-09-04-0828984"
DEFAULT_IMAGE = "quay.io/pypa/manylinux2014:2025.03.08-1"
pm = platform.machine()
if pm in {"x86_64", "ppc64le", "s390x"}:
DEFAULT_IMAGE = DEFAULT_IMAGE_TEMPLATE.format(machine=pm)
elif pm in {"aarch64", "arm64"}:
DEFAULT_IMAGE = DEFAULT_IMAGE_TEMPLATE.format(machine="aarch64")
else:
DEFAULT_IMAGE = ""
DEFAULT_OCI_PLATFORM = {
"AMD64": OCIPlatform.AMD64,
"x86_64": OCIPlatform.AMD64,
@@ -415,9 +409,7 @@ def test_create_args_volume(tmp_path: Path, container_engine: OCIContainerEngine
)
with OCIContainer(
engine=container_engine,
image=DEFAULT_IMAGE,
oci_platform=DEFAULT_OCI_PLATFORM,
engine=container_engine, image=DEFAULT_IMAGE, oci_platform=DEFAULT_OCI_PLATFORM
) as container:
assert container.call(["cat", "/test_mount/test_file.txt"], capture_output=True) == "1234"
@@ -497,9 +489,7 @@ def test_parse_engine_config(config, name, create_args, capsys):
@pytest.mark.skipif(pm != "x86_64", reason="Only runs on x86_64")
def test_enforce_32_bit(container_engine):
with OCIContainer(
engine=container_engine,
image=DEFAULT_IMAGE_TEMPLATE.format(machine="i686"),
oci_platform=OCIPlatform.i386,
engine=container_engine, image=DEFAULT_IMAGE, oci_platform=OCIPlatform.i386
) as container:
assert container.call(["uname", "-m"], capture_output=True).strip() == "i686"
container_args = subprocess.run(
+4 -17
View File
@@ -104,12 +104,11 @@ manylinux-x86_64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
enable = ["pypy", "cpython-freethreading"]
# Before Python 3.10, use manylinux2014, musllinux_1_1
# Before Python 3.10, use manylinux2014
[[tool.cibuildwheel.overrides]]
select = "cp3?-*"
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
musllinux-x86_64-image = "musllinux_1_1"
[[tool.cibuildwheel.overrides]]
select = "cp38-manylinux_x86_64"
@@ -124,7 +123,7 @@ before-all = "true"
build_in_container = typing.cast(mock.Mock, linux.build_in_container)
assert build_in_container.call_count == 7
assert build_in_container.call_count == 6
kwargs = build_in_container.call_args_list[0][1]
assert "quay.io/pypa/manylinux2014_x86_64" in kwargs["container"]["image"]
@@ -188,25 +187,13 @@ before-all = "true"
assert identifiers == {f"{x}-manylinux_i686" for x in ALL_IDS}
kwargs = build_in_container.call_args_list[4][1]
assert "quay.io/pypa/musllinux_1_1_x86_64" in kwargs["container"]["image"]
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
assert kwargs["container"]["oci_platform"] == OCIPlatform.AMD64
identifiers = {x.identifier for x in kwargs["platform_configs"]}
assert identifiers == {
f"{x}-musllinux_x86_64" for x in ALL_IDS & {"cp38", "cp39"} if "pp" not in x
}
kwargs = build_in_container.call_args_list[5][1]
assert "quay.io/pypa/musllinux_1_2_x86_64" in kwargs["container"]["image"]
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
assert kwargs["container"]["oci_platform"] == OCIPlatform.AMD64
identifiers = {x.identifier for x in kwargs["platform_configs"]}
assert identifiers == {
f"{x}-musllinux_x86_64" for x in ALL_IDS - {"cp38", "cp39"} if "pp" not in x
}
assert identifiers == {f"{x}-musllinux_x86_64" for x in ALL_IDS if "pp" not in x}
kwargs = build_in_container.call_args_list[6][1]
kwargs = build_in_container.call_args_list[5][1]
assert "quay.io/pypa/musllinux_1_2_i686" in kwargs["container"]["image"]
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
assert kwargs["container"]["oci_platform"] == OCIPlatform.i386
+23 -15
View File
@@ -26,7 +26,7 @@ environment = {FOO="BAR"}
test-command = "pyproject"
test-sources = ["test", "other dir"]
manylinux-x86_64-image = "manylinux1"
manylinux-x86_64-image = "manylinux_2_28"
environment-pass = ["EXAMPLE_ENV"]
@@ -36,7 +36,7 @@ test-requires = "else"
[[tool.cibuildwheel.overrides]]
select = "cp313-*"
test-command = "pyproject-override"
manylinux-x86_64-image = "manylinux2014"
manylinux-x86_64-image = "manylinux_2_34"
"""
@@ -76,13 +76,13 @@ def test_options_1(tmp_path, monkeypatch):
assert local.manylinux_images is not None
assert local.test_command == "pyproject"
assert local.test_sources == ["test", "other dir"]
assert local.manylinux_images["x86_64"] == pinned_x86_64_container_image["manylinux1"]
assert local.manylinux_images["x86_64"] == pinned_x86_64_container_image["manylinux_2_28"]
local = options.build_options("cp313-manylinux_x86_64")
assert local.manylinux_images is not None
assert local.test_command == "pyproject-override"
assert local.test_sources == ["test", "other dir"]
assert local.manylinux_images["x86_64"] == pinned_x86_64_container_image["manylinux2014"]
assert local.manylinux_images["x86_64"] == pinned_x86_64_container_image["manylinux_2_34"]
def test_passthrough(tmp_path, monkeypatch):
@@ -532,19 +532,22 @@ def test_dependency_versions_toml(
@pytest.mark.parametrize(
("image", "deprecated"),
("image", "deprecated", "raises"),
[
("manylinux1", True),
("manylinux2010", True),
("manylinux2014", False),
("manylinux_2_24", True),
("manylinux_2_28", False),
("manylinux_2_34", False),
("musllinux_1_1", True),
("musllinux_1_2", False),
("manylinux1", True, True),
("manylinux2010", True, True),
("manylinux2014", False, False),
("manylinux_2_24", True, True),
("manylinux_2_28", False, False),
("manylinux_2_34", False, False),
("musllinux_1_1", True, True),
("musllinux_1_2", False, False),
],
)
def test_deprecated_image(image: str, deprecated: bool, capsys: pytest.CaptureFixture[str]) -> None:
def test_deprecated_image(
image: str, deprecated: bool, raises: bool, capsys: pytest.CaptureFixture[str]
) -> None:
assert not raises or deprecated
args = CommandLineArguments.defaults()
env = {
"CIBW_ARCHS": "x86_64",
@@ -552,7 +555,12 @@ def test_deprecated_image(image: str, deprecated: bool, capsys: pytest.CaptureFi
"CIBW_MUSLLINUX_X86_64_IMAGE": image if image.startswith("musllinux") else "",
}
options = Options(platform="linux", command_line_arguments=args, env=env)
bo = options.build_options(None)
try:
bo = options.build_options(None)
assert not raises
except errors.DeprecationError:
assert raises
return
images = bo.manylinux_images if image.startswith("manylinux") else bo.musllinux_images
assert images is not None
resolved_image = images["x86_64"]
+2 -2
View File
@@ -24,7 +24,7 @@ test-extras = ["one", "two"]
test-groups = ["three", "four"]
test-sources = ["five", "six and seven"]
manylinux-x86_64-image = "manylinux1"
manylinux-x86_64-image = "manylinux_2_28"
[tool.cibuildwheel.macos]
test-requires = "else"
@@ -67,7 +67,7 @@ def test_simple_settings(tmp_path, platform, fname):
assert options_reader.get("test-extras", option_format=ListFormat(",")) == "one,two"
assert options_reader.get("test-groups", option_format=ListFormat(" ")) == "three four"
assert options_reader.get("manylinux-x86_64-image") == "manylinux1"
assert options_reader.get("manylinux-x86_64-image") == "manylinux_2_28"
assert options_reader.get("manylinux-i686-image") == "manylinux2014"
with pytest.raises(OptionsReaderError):