Skip to content

Commit a7e9536

Browse files
committed
feat: move default manylinux build to manylinux_2_28
1 parent 462c995 commit a7e9536

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
@@ -788,10 +788,7 @@ def _compute_build_options(self, identifier: str | None) -> BuildOptions:
788788
f"manylinux-{build_platform}-image", ignore_empty=True
789789
)
790790

791-
if not config_value:
792-
# default to manylinux2014
793-
image = pinned_images["manylinux2014"]
794-
elif config_value in pinned_images:
791+
if config_value in pinned_images:
795792
self._check_pinned_image(config_value, pinned_images)
796793
image = pinned_images[config_value]
797794
else:
@@ -802,11 +799,11 @@ def _compute_build_options(self, identifier: str | None) -> BuildOptions:
802799
for build_platform in MUSLLINUX_ARCHS:
803800
pinned_images = all_pinned_container_images[build_platform]
804801

805-
config_value = self.reader.get(f"musllinux-{build_platform}-image")
802+
config_value = self.reader.get(
803+
f"musllinux-{build_platform}-image", ignore_empty=True
804+
)
806805

807-
if not config_value:
808-
image = pinned_images["musllinux_1_2"]
809-
elif config_value in pinned_images:
806+
if config_value in pinned_images:
810807
self._check_pinned_image(config_value, pinned_images)
811808
image = pinned_images[config_value]
812809
else:

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
@@ -1169,25 +1169,23 @@ Platform-specific environment variables are also available:<br/>
11691169
11701170
The available options are:
11711171

1172-
| Option | Default | Future default* |
1173-
|-----------------------------------|----------------------------------------------------------------|-----------------------------------------------------------------|
1174-
| 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) |
1175-
| CIBW_MANYLINUX_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) | |
1176-
| 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) |
1177-
| CIBW_MANYLINUX_AARCH64_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_aarch64) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1178-
| CIBW_MANYLINUX_PPC64LE_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_ppc64le) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_ppc64le) |
1179-
| CIBW_MANYLINUX_S390X_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_s390x) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_s390x) |
1180-
| CIBW_MANYLINUX_ARMV7L_IMAGE | [`manylinux_2_31`](https://quay.io/pypa/manylinux_2_31_armv7l) | |
1181-
| CIBW_MANYLINUX_PYPY_AARCH64_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_aarch64) | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1182-
| CIBW_MANYLINUX_PYPY_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) | |
1183-
| CIBW_MUSLLINUX_X86_64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_x86_64) | |
1184-
| CIBW_MUSLLINUX_I686_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_i686) | |
1185-
| CIBW_MUSLLINUX_AARCH64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_aarch64) | |
1186-
| CIBW_MUSLLINUX_PPC64LE_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_ppc64le) | |
1187-
| CIBW_MUSLLINUX_S390X_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_s390x) | |
1188-
| CIBW_MUSLLINUX_ARMV7L_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_armv7l) | |
1189-
1190-
<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>
1172+
| Option | Default |
1173+
|-----------------------------------|-----------------------------------------------------------------|
1174+
| CIBW_MANYLINUX_X86_64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_x86_64) |
1175+
| CIBW_MANYLINUX_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) |
1176+
| CIBW_MANYLINUX_PYPY_X86_64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_x86_64) |
1177+
| CIBW_MANYLINUX_AARCH64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1178+
| CIBW_MANYLINUX_PPC64LE_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_ppc64le) |
1179+
| CIBW_MANYLINUX_S390X_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_s390x) |
1180+
| CIBW_MANYLINUX_ARMV7L_IMAGE | [`manylinux_2_31`](https://quay.io/pypa/manylinux_2_31_armv7l) |
1181+
| CIBW_MANYLINUX_PYPY_AARCH64_IMAGE | [`manylinux_2_28`](https://quay.io/pypa/manylinux_2_28_aarch64) |
1182+
| CIBW_MANYLINUX_PYPY_I686_IMAGE | [`manylinux2014`](https://quay.io/pypa/manylinux2014_i686) |
1183+
| CIBW_MUSLLINUX_X86_64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_x86_64) |
1184+
| CIBW_MUSLLINUX_I686_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_i686) |
1185+
| CIBW_MUSLLINUX_AARCH64_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_aarch64) |
1186+
| CIBW_MUSLLINUX_PPC64LE_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_ppc64le) |
1187+
| CIBW_MUSLLINUX_S390X_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_s390x) |
1188+
| CIBW_MUSLLINUX_ARMV7L_IMAGE | [`musllinux_1_2`](https://quay.io/pypa/musllinux_1_2_armv7l) |
11911189

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

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

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

193232
if musllinux_versions is None:
194233
musllinux_versions = ["musllinux_1_2"]
@@ -206,30 +245,14 @@ def expected_wheels(
206245
"cp313-cp313t",
207246
]
208247

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

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

254277
if platform == "linux":
255-
architectures = [arch_name_for_linux(machine_arch)]
256-
257-
if not single_arch:
258-
if machine_arch == "x86_64":
259-
architectures.append("i686")
260-
elif (
261-
machine_arch == "aarch64"
262-
and sys.platform.startswith("linux")
263-
and not python_abi_tag.startswith("pp")
264-
and _AARCH64_CAN_RUN_ARMV7
265-
):
266-
architectures.append("armv7l")
267-
268278
if len(manylinux_versions) > 0:
269279
platform_tags = [
270280
".".join(
271-
f"{manylinux_version}_{architecture}"
281+
f"{manylinux_version}_{machine_arch}"
272282
for manylinux_version in manylinux_versions
273-
if (manylinux_version, architecture) != ("manylinux_2_31", "aarch64")
274283
)
275-
for architecture in architectures
276284
]
277285
if len(musllinux_versions) > 0 and not python_abi_tag.startswith("pp"):
278-
platform_tags.extend(
279-
[
280-
".".join(
281-
f"{musllinux_version}_{architecture}"
282-
for musllinux_version in musllinux_versions
283-
)
284-
for architecture in architectures
285-
]
286+
platform_tags.append(
287+
".".join(
288+
f"{musllinux_version}_{machine_arch}"
289+
for musllinux_version in musllinux_versions
290+
)
286291
)
287292

288293
elif platform == "windows":
289-
if python_abi_tag.startswith("pp"):
290-
platform_tags = ["win_amd64"]
291-
else:
292-
platform_tags = ["win32", "win_amd64"]
294+
platform_tags = ["win_amd64"] if machine_arch == "AMD64" else ["win32"]
293295

294296
elif platform == "macos":
295297
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
@@ -79,7 +79,7 @@ def test_empty_selector(monkeypatch):
7979
@pytest.mark.parametrize(
8080
("architecture", "image", "full_image"),
8181
[
82-
("x86_64", None, "quay.io/pypa/manylinux2014_x86_64:*"),
82+
("x86_64", None, "quay.io/pypa/manylinux_2_28_x86_64:*"),
8383
("x86_64", "manylinux1", "quay.io/pypa/manylinux1_x86_64:*"),
8484
("x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
8585
("x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
@@ -93,7 +93,7 @@ def test_empty_selector(monkeypatch):
9393
("i686", "manylinux2014", "quay.io/pypa/manylinux2014_i686:*"),
9494
("i686", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_i686:*"),
9595
("i686", "custom_image", "custom_image"),
96-
("pypy_x86_64", None, "quay.io/pypa/manylinux2014_x86_64:*"),
96+
("pypy_x86_64", None, "quay.io/pypa/manylinux_2_28_x86_64:*"),
9797
("pypy_x86_64", "manylinux1", "manylinux1"), # Does not exist
9898
("pypy_x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
9999
("pypy_x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),

unit_test/option_prepare_test.py

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

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

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)