Skip to content

Commit e6eff86

Browse files
authored
feat: move default manylinux build to manylinux_2_28 (#2330)
1 parent 141e702 commit e6eff86

File tree

8 files changed

+100
-100
lines changed

8 files changed

+100
-100
lines changed

cibuildwheel/options.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -795,22 +795,19 @@ def _compute_build_options(self, identifier: str | None) -> BuildOptions:
795795
f"manylinux-{build_platform}-image", ignore_empty=True
796796
)
797797
self._check_pinned_image(config_value, pinned_images)
798-
if not config_value:
799-
# default to manylinux2014
800-
image = pinned_images["manylinux2014"]
801-
elif config_value in pinned_images:
798+
if config_value in pinned_images:
802799
image = pinned_images[config_value]
803800
else:
804801
image = config_value
805802
manylinux_images[build_platform] = image
806803

807804
for build_platform in MUSLLINUX_ARCHS:
808805
pinned_images = all_pinned_container_images[build_platform]
809-
config_value = self.reader.get(f"musllinux-{build_platform}-image")
806+
config_value = self.reader.get(
807+
f"musllinux-{build_platform}-image", ignore_empty=True
808+
)
810809
self._check_pinned_image(config_value, pinned_images)
811-
if not config_value:
812-
image = pinned_images["musllinux_1_2"]
813-
elif config_value in pinned_images:
810+
if config_value in pinned_images:
814811
image = pinned_images[config_value]
815812
else:
816813
image = config_value

cibuildwheel/resources/defaults.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ test-groups = []
2525

2626
container-engine = "docker"
2727

28-
manylinux-x86_64-image = "manylinux2014"
28+
manylinux-x86_64-image = "manylinux_2_28"
2929
manylinux-i686-image = "manylinux2014"
30-
manylinux-aarch64-image = "manylinux2014"
31-
manylinux-ppc64le-image = "manylinux2014"
32-
manylinux-s390x-image = "manylinux2014"
30+
manylinux-aarch64-image = "manylinux_2_28"
31+
manylinux-ppc64le-image = "manylinux_2_28"
32+
manylinux-s390x-image = "manylinux_2_28"
3333
manylinux-armv7l-image = "manylinux_2_31"
34-
manylinux-pypy_x86_64-image = "manylinux2014"
34+
manylinux-pypy_x86_64-image = "manylinux_2_28"
3535
manylinux-pypy_i686-image = "manylinux2014"
36-
manylinux-pypy_aarch64-image = "manylinux2014"
36+
manylinux-pypy_aarch64-image = "manylinux_2_28"
3737

3838
musllinux-x86_64-image = "musllinux_1_2"
3939
musllinux-i686-image = "musllinux_1_2"

docs/options.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,25 +1168,23 @@ Platform-specific environment variables are also available:<br/>
11681168
11691169
The available options are:
11701170

1171-
| Option | Default | Future default* |
1172-
|-----------------------------------|----------------------------------------------------------------|-----------------------------------------------------------------|
1173-
| CIBW_MANYLINUX_X86_64_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_x86_64) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_x86_64) |
1174-
| CIBW_MANYLINUX_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) | |
1175-
| CIBW_MANYLINUX_PYPY_X86_64_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_x86_64) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_x86_64) |
1176-
| CIBW_MANYLINUX_AARCH64_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_aarch64) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1177-
| CIBW_MANYLINUX_PPC64LE_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_ppc64le) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_ppc64le) |
1178-
| CIBW_MANYLINUX_S390X_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_s390x) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_s390x) |
1179-
| CIBW_MANYLINUX_ARMV7L_IMAGE | [`manylinux_2_31`](https://quay.io/pypa/manylinux_2_31_armv7l) | |
1180-
| CIBW_MANYLINUX_PYPY_AARCH64_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_aarch64) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1181-
| CIBW_MANYLINUX_PYPY_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) | |
1182-
| CIBW_MUSLLINUX_X86_64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_x86_64) | |
1183-
| CIBW_MUSLLINUX_I686_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_i686) | |
1184-
| CIBW_MUSLLINUX_AARCH64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_aarch64) | |
1185-
| CIBW_MUSLLINUX_PPC64LE_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_ppc64le) | |
1186-
| CIBW_MUSLLINUX_S390X_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_s390x) | |
1187-
| CIBW_MUSLLINUX_ARMV7L_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_armv7l) | |
1188-
1189-
<small>* The default is scheduled to change in a cibuildwheel release on or after 6th May 2025 - if you don't want the new default, you should set the value to `manylinux2014`.</small>
1171+
| Option | Default |
1172+
|-----------------------------------|-----------------------------------------------------------------|
1173+
| CIBW_MANYLINUX_X86_64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_x86_64) |
1174+
| CIBW_MANYLINUX_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) |
1175+
| CIBW_MANYLINUX_PYPY_X86_64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_x86_64) |
1176+
| CIBW_MANYLINUX_AARCH64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1177+
| CIBW_MANYLINUX_PPC64LE_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_ppc64le) |
1178+
| CIBW_MANYLINUX_S390X_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_s390x) |
1179+
| CIBW_MANYLINUX_ARMV7L_IMAGE | [`manylinux_2_31`](https://quay.io/pypa/manylinux_2_31_armv7l) |
1180+
| CIBW_MANYLINUX_PYPY_AARCH64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1181+
| CIBW_MANYLINUX_PYPY_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) |
1182+
| CIBW_MUSLLINUX_X86_64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_x86_64) |
1183+
| CIBW_MUSLLINUX_I686_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_i686) |
1184+
| CIBW_MUSLLINUX_AARCH64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_aarch64) |
1185+
| CIBW_MUSLLINUX_PPC64LE_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_ppc64le) |
1186+
| CIBW_MUSLLINUX_S390X_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_s390x) |
1187+
| CIBW_MUSLLINUX_ARMV7L_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_armv7l) |
11901188

11911189
Set the Docker image to be used for building [manylinux / musllinux](https://github.com/pypa/manylinux) wheels.
11921190

test/test_container_images.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ def test(tmp_path):
4343
)
4444

4545
# also check that we got the right wheels built
46+
manylinux_versions = ["manylinux_2_5", "manylinux1", "manylinux_2_17", "manylinux2014"]
4647
expected_wheels = [
4748
w
48-
for w in utils.expected_wheels("spam", "0.1.0", musllinux_versions=[])
49+
for w in utils.expected_wheels(
50+
"spam", "0.1.0", manylinux_versions=manylinux_versions, musllinux_versions=[]
51+
)
4952
if "-cp38-" in w or "-cp39-" in w
5053
]
5154
assert set(actual_wheels) == set(expected_wheels)

test/utils.py

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,57 @@ def expected_wheels(
163163
include_universal2: bool = False,
164164
single_python: bool = False,
165165
single_arch: bool = False,
166+
) -> list[str]:
167+
"""
168+
Returns a list of expected wheels from a run of cibuildwheel.
169+
"""
170+
if machine_arch is None:
171+
machine_arch = pm.machine()
172+
if platform == "linux":
173+
machine_arch = arch_name_for_linux(machine_arch)
174+
175+
architectures = [machine_arch]
176+
if not single_arch:
177+
if platform == "linux":
178+
if machine_arch == "x86_64":
179+
architectures.append("i686")
180+
elif (
181+
machine_arch == "aarch64"
182+
and sys.platform.startswith("linux")
183+
and _AARCH64_CAN_RUN_ARMV7
184+
):
185+
architectures.append("armv7l")
186+
elif platform == "windows" and machine_arch == "AMD64":
187+
architectures.append("x86")
188+
189+
wheels: list[str] = []
190+
for architecture in architectures:
191+
wheels.extend(
192+
_expected_wheels(
193+
package_name,
194+
package_version,
195+
architecture,
196+
manylinux_versions,
197+
musllinux_versions,
198+
macosx_deployment_target,
199+
python_abi_tags,
200+
include_universal2,
201+
single_python,
202+
)
203+
)
204+
return wheels
205+
206+
207+
def _expected_wheels(
208+
package_name: str,
209+
package_version: str,
210+
machine_arch: str,
211+
manylinux_versions: list[str] | None,
212+
musllinux_versions: list[str] | None,
213+
macosx_deployment_target: str,
214+
python_abi_tags: list[str] | None,
215+
include_universal2: bool,
216+
single_python: bool,
166217
) -> list[str]:
167218
"""
168219
Returns a list of expected wheels from a run of cibuildwheel.
@@ -172,24 +223,12 @@ def expected_wheels(
172223
# {python tag} and {abi tag} are closely related to the python interpreter used to build the wheel
173224
# so we'll merge them below as python_abi_tag
174225

175-
if machine_arch is None:
176-
machine_arch = pm.machine()
177-
if platform == "linux" and machine_arch.lower() == "arm64":
178-
# we're running linux tests from macOS/Windows arm64, override platform
179-
machine_arch = "aarch64"
180-
181226
if manylinux_versions is None:
182-
if machine_arch in ("armv7l", "aarch64"):
183-
manylinux_versions = ["manylinux_2_17", "manylinux2014", "manylinux_2_31"]
184-
elif machine_arch == "x86_64":
185-
manylinux_versions = [
186-
"manylinux_2_5",
187-
"manylinux1",
188-
"manylinux_2_17",
189-
"manylinux2014",
190-
]
191-
else:
192-
manylinux_versions = ["manylinux_2_17", "manylinux2014"]
227+
manylinux_versions = {
228+
"armv7l": ["manylinux_2_17", "manylinux2014", "manylinux_2_31"],
229+
"i686": ["manylinux_2_5", "manylinux1", "manylinux_2_17", "manylinux2014"],
230+
"x86_64": ["manylinux_2_5", "manylinux1", "manylinux_2_28"],
231+
}.get(machine_arch, ["manylinux_2_17", "manylinux2014", "manylinux_2_28"])
193232

194233
if musllinux_versions is None:
195234
musllinux_versions = ["musllinux_1_2"]
@@ -207,30 +246,14 @@ def expected_wheels(
207246
"cp313-cp313t",
208247
]
209248

210-
if machine_arch in ["x86_64", "AMD64", "x86", "aarch64"]:
249+
if machine_arch in ["x86_64", "i686", "AMD64", "aarch64", "arm64"]:
211250
python_abi_tags += [
212251
"pp38-pypy38_pp73",
213252
"pp39-pypy39_pp73",
214253
"pp310-pypy310_pp73",
215254
"pp311-pypy311_pp73",
216255
]
217256

218-
if platform == "macos" and machine_arch == "arm64":
219-
# arm64 macs are only supported by cp38+
220-
python_abi_tags = [
221-
"cp38-cp38",
222-
"cp39-cp39",
223-
"cp310-cp310",
224-
"cp311-cp311",
225-
"cp312-cp312",
226-
"cp313-cp313",
227-
"cp313-cp313t",
228-
"pp38-pypy38_pp73",
229-
"pp39-pypy39_pp73",
230-
"pp310-pypy310_pp73",
231-
"pp311-pypy311_pp73",
232-
]
233-
234257
if single_python:
235258
python_tag = "cp{}{}-".format(*SINGLE_PYTHON_VERSION)
236259
python_abi_tags = [
@@ -253,44 +276,23 @@ def expected_wheels(
253276
platform_tags = []
254277

255278
if platform == "linux":
256-
architectures = [arch_name_for_linux(machine_arch)]
257-
258-
if not single_arch:
259-
if machine_arch == "x86_64":
260-
architectures.append("i686")
261-
elif (
262-
machine_arch == "aarch64"
263-
and sys.platform.startswith("linux")
264-
and not python_abi_tag.startswith("pp")
265-
and _AARCH64_CAN_RUN_ARMV7
266-
):
267-
architectures.append("armv7l")
268-
269279
if len(manylinux_versions) > 0:
270280
platform_tags = [
271281
".".join(
272-
f"{manylinux_version}_{architecture}"
282+
f"{manylinux_version}_{machine_arch}"
273283
for manylinux_version in manylinux_versions
274-
if (manylinux_version, architecture) != ("manylinux_2_31", "aarch64")
275284
)
276-
for architecture in architectures
277285
]
278286
if len(musllinux_versions) > 0 and not python_abi_tag.startswith("pp"):
279-
platform_tags.extend(
280-
[
281-
".".join(
282-
f"{musllinux_version}_{architecture}"
283-
for musllinux_version in musllinux_versions
284-
)
285-
for architecture in architectures
286-
]
287+
platform_tags.append(
288+
".".join(
289+
f"{musllinux_version}_{machine_arch}"
290+
for musllinux_version in musllinux_versions
291+
)
287292
)
288293

289294
elif platform == "windows":
290-
if python_abi_tag.startswith("pp"):
291-
platform_tags = ["win_amd64"]
292-
else:
293-
platform_tags = ["win32", "win_amd64"]
295+
platform_tags = ["win_amd64"] if machine_arch == "AMD64" else ["win32"]
294296

295297
elif platform == "macos":
296298
if python_abi_tag.startswith("pp"):

unit_test/main_tests/main_options_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ def test_empty_selector(monkeypatch):
106106
@pytest.mark.parametrize(
107107
("architecture", "image", "full_image"),
108108
[
109-
("x86_64", None, "quay.io/pypa/manylinux2014_x86_64:*"),
109+
("x86_64", None, "quay.io/pypa/manylinux_2_28_x86_64:*"),
110110
("x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
111111
("x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_x86_64:*"),
112112
("x86_64", "manylinux_2_34", "quay.io/pypa/manylinux_2_34_x86_64:*"),
113113
("x86_64", "custom_image", "custom_image"),
114114
("i686", None, "quay.io/pypa/manylinux2014_i686:*"),
115115
("i686", "manylinux2014", "quay.io/pypa/manylinux2014_i686:*"),
116116
("i686", "custom_image", "custom_image"),
117-
("pypy_x86_64", None, "quay.io/pypa/manylinux2014_x86_64:*"),
117+
("pypy_x86_64", None, "quay.io/pypa/manylinux_2_28_x86_64:*"),
118118
("pypy_x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
119119
("pypy_x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_x86_64:*"),
120120
("pypy_x86_64", "manylinux_2_34", "quay.io/pypa/manylinux_2_34_x86_64:*"),

unit_test/option_prepare_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_build_default_launches(monkeypatch):
6060

6161
# In Python 3.8+, this can be simplified to [0].kwargs
6262
kwargs = build_in_container.call_args_list[0][1]
63-
assert "quay.io/pypa/manylinux2014_x86_64" in kwargs["container"]["image"]
63+
assert "quay.io/pypa/manylinux_2_28_x86_64" in kwargs["container"]["image"]
6464
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
6565
assert kwargs["container"]["oci_platform"] == OCIPlatform.AMD64
6666

unit_test/options_toml_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_environment_override_empty(tmp_path):
276276
assert options_reader.get("manylinux-i686-image") == ""
277277
assert options_reader.get("manylinux-aarch64-image") == "manylinux1"
278278

279-
assert options_reader.get("manylinux-x86_64-image", ignore_empty=True) == "manylinux2014"
279+
assert options_reader.get("manylinux-x86_64-image", ignore_empty=True) == "manylinux_2_28"
280280
assert options_reader.get("manylinux-i686-image", ignore_empty=True) == "manylinux1"
281281
assert options_reader.get("manylinux-aarch64-image", ignore_empty=True) == "manylinux1"
282282

0 commit comments

Comments
 (0)