Skip to content

Commit df6f886

Browse files
authored
feat: add manylinux armv7l (#2052)
1 parent 6f21f84 commit df6f886

12 files changed

+92
-44
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ What does it do?
2424

2525
While cibuildwheel itself requires a recent Python version to run (we support the last three releases), it can target the following versions to build wheels:
2626

27-
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | musllinux armv7l | Pyodide |
27+
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | manylinux<br/>musllinux armv7l | Pyodide |
2828
|----------------|----|-----|-----|-----|-----|----|-----|----|-----|-----|---|-----|
29-
| CPython 3.6 || N/A ||| N/A ||||||| N/A |
30-
| CPython 3.7 || N/A ||| N/A ||||||| N/A |
31-
| CPython 3.8 ||||| N/A ||||||| N/A |
32-
| CPython 3.9 ||||| ✅² ||||||| N/A |
33-
| CPython 3.10 ||||| ✅² ||||||| N/A |
34-
| CPython 3.11 ||||| ✅² ||||||| N/A |
35-
| CPython 3.12 ||||| ✅² ||||||| ✅⁴ |
36-
| CPython 3.13³ ||||| ✅² ||||||| N/A |
29+
| CPython 3.6 || N/A ||| N/A |||||| | N/A |
30+
| CPython 3.7 || N/A ||| N/A |||||| | N/A |
31+
| CPython 3.8 ||||| N/A |||||| | N/A |
32+
| CPython 3.9 ||||| ✅² |||||| | N/A |
33+
| CPython 3.10 ||||| ✅² |||||| | N/A |
34+
| CPython 3.11 ||||| ✅² |||||| | N/A |
35+
| CPython 3.12 ||||| ✅² |||||| | ✅⁴ |
36+
| CPython 3.13³ ||||| ✅² |||||| | N/A |
3737
| PyPy 3.7 v7.3 || N/A || N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
3838
| PyPy 3.8 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
3939
| PyPy 3.9 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
@@ -43,6 +43,7 @@ While cibuildwheel itself requires a recent Python version to run (we support th
4343
<sup>² Windows arm64 support is experimental.</sup><br>
4444
<sup>³ Free-threaded mode requires opt-in using [`CIBW_FREE_THREADED_SUPPORT`](https://cibuildwheel.pypa.io/en/stable/options/#free-threaded-support).</sup><br>
4545
<sup>⁴ Experimental, not yet supported on PyPI, but can be used directly in web deployment. Use `--platform pyodide` to build.</sup><br>
46+
<sup>⁵ manylinux armv7l support is experimental. As there are no RHEL based image for this architecture, it's using an Ubuntu based image instead.</sup><br>
4647

4748
- Builds manylinux, musllinux, macOS 10.9+ (10.13+ for Python 3.12+), and Windows wheels for CPython and PyPy
4849
- Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, GitLab CI, and Cirrus CI

bin/generate_schema.py

+3
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
manylinux-aarch64-image:
128128
type: string
129129
description: Specify alternative manylinux / musllinux container images
130+
manylinux-armv7l-image:
131+
type: string
132+
description: Specify alternative manylinux / musllinux container images
130133
manylinux-i686-image:
131134
type: string
132135
description: Specify alternative manylinux / musllinux container images

bin/update_docker.py

+18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pathlib import Path
77

88
import requests
9+
from packaging.version import Version
910

1011
DIR = Path(__file__).parent.resolve()
1112
RESOURCES = DIR.parent / "cibuildwheel/resources"
@@ -53,6 +54,8 @@ class Image:
5354
Image("manylinux_2_28", "s390x", "quay.io/pypa/manylinux_2_28_s390x", None),
5455
Image("manylinux_2_28", "pypy_x86_64", "quay.io/pypa/manylinux_2_28_x86_64", None),
5556
Image("manylinux_2_28", "pypy_aarch64", "quay.io/pypa/manylinux_2_28_aarch64", None),
57+
# manylinux_2_31 images
58+
Image("manylinux_2_31", "armv7l", "ghcr.io/mayeut/manylinux_2_31", None),
5659
# musllinux_1_1 images
5760
Image("musllinux_1_1", "x86_64", "quay.io/pypa/musllinux_1_1_x86_64", None),
5861
Image("musllinux_1_1", "i686", "quay.io/pypa/musllinux_1_1_i686", None),
@@ -91,6 +94,21 @@ class Image:
9194
for (name, info) in tags_dict.items()
9295
if info["manifest_digest"] == latest_tag["manifest_digest"]
9396
)
97+
elif image.image_name.startswith("ghcr.io/"):
98+
repository = image.image_name[8:]
99+
response = requests.get(
100+
"https://ghcr.io/token", params={"scope": f"repository:{repository}:pull"}
101+
)
102+
response.raise_for_status()
103+
token = response.json()["token"]
104+
response = requests.get(
105+
f"https://ghcr.io/v2/{repository}/tags/list",
106+
headers={"Authorization": f"Bearer {token}"},
107+
)
108+
response.raise_for_status()
109+
ghcr_tags = [(Version(tag), tag) for tag in response.json()["tags"] if tag != "latest"]
110+
ghcr_tags.sort(reverse=True)
111+
tag_name = ghcr_tags[0][1]
94112
else:
95113
response = requests.get(f"https://hub.docker.com/v2/repositories/{image.image_name}/tags")
96114
response.raise_for_status()

cibuildwheel/logger.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"manylinux_aarch64": "manylinux aarch64",
2424
"manylinux_ppc64le": "manylinux ppc64le",
2525
"manylinux_s390x": "manylinux s390x",
26+
"manylinux_armv7l": "manylinux armv7l",
2627
"musllinux_x86_64": "musllinux x86_64",
2728
"musllinux_i686": "musllinux i686",
2829
"musllinux_aarch64": "musllinux aarch64",

cibuildwheel/resources/build-platforms.toml

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ python_configurations = [
4949
{ identifier = "cp312-manylinux_s390x", version = "3.12", path_str = "/opt/python/cp312-cp312" },
5050
{ identifier = "cp313-manylinux_s390x", version = "3.13", path_str = "/opt/python/cp313-cp313" },
5151
{ identifier = "cp313t-manylinux_s390x", version = "3.13", path_str = "/opt/python/cp313-cp313t" },
52+
{ identifier = "cp36-manylinux_armv7l", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
53+
{ identifier = "cp37-manylinux_armv7l", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
54+
{ identifier = "cp38-manylinux_armv7l", version = "3.8", path_str = "/opt/python/cp38-cp38" },
55+
{ identifier = "cp39-manylinux_armv7l", version = "3.9", path_str = "/opt/python/cp39-cp39" },
56+
{ identifier = "cp310-manylinux_armv7l", version = "3.10", path_str = "/opt/python/cp310-cp310" },
57+
{ identifier = "cp311-manylinux_armv7l", version = "3.11", path_str = "/opt/python/cp311-cp311" },
58+
{ identifier = "cp312-manylinux_armv7l", version = "3.12", path_str = "/opt/python/cp312-cp312" },
59+
{ identifier = "cp313-manylinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313" },
60+
{ identifier = "cp313t-manylinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313t" },
5261
{ identifier = "pp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
5362
{ identifier = "pp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/pp38-pypy38_pp73" },
5463
{ identifier = "pp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/pp39-pypy39_pp73" },

cibuildwheel/resources/cibuildwheel.schema.json

+11
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@
296296
"description": "Specify alternative manylinux / musllinux container images",
297297
"title": "CIBW_MANYLINUX_AARCH64_IMAGE"
298298
},
299+
"manylinux-armv7l-image": {
300+
"type": "string",
301+
"description": "Specify alternative manylinux / musllinux container images",
302+
"title": "CIBW_MANYLINUX_ARMV7L_IMAGE"
303+
},
299304
"manylinux-i686-image": {
300305
"type": "string",
301306
"description": "Specify alternative manylinux / musllinux container images",
@@ -562,6 +567,9 @@
562567
"manylinux-aarch64-image": {
563568
"$ref": "#/properties/manylinux-aarch64-image"
564569
},
570+
"manylinux-armv7l-image": {
571+
"$ref": "#/properties/manylinux-armv7l-image"
572+
},
565573
"manylinux-i686-image": {
566574
"$ref": "#/properties/manylinux-i686-image"
567575
},
@@ -656,6 +664,9 @@
656664
"manylinux-aarch64-image": {
657665
"$ref": "#/properties/manylinux-aarch64-image"
658666
},
667+
"manylinux-armv7l-image": {
668+
"$ref": "#/properties/manylinux-armv7l-image"
669+
},
659670
"manylinux-i686-image": {
660671
"$ref": "#/properties/manylinux-i686-image"
661672
},

cibuildwheel/resources/defaults.toml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ manylinux-i686-image = "manylinux2014"
3030
manylinux-aarch64-image = "manylinux2014"
3131
manylinux-ppc64le-image = "manylinux2014"
3232
manylinux-s390x-image = "manylinux2014"
33+
manylinux-armv7l-image = "manylinux_2_31"
3334
manylinux-pypy_x86_64-image = "manylinux2014"
3435
manylinux-pypy_i686-image = "manylinux2014"
3536
manylinux-pypy_aarch64-image = "manylinux2014"

cibuildwheel/resources/pinned_docker_images.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-12-26-0d38463
5353
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2024.11.10-1
5454

5555
[armv7l]
56+
manylinux_2_31 = ghcr.io/mayeut/manylinux_2_31:2024.11.10-1
5657
musllinux_1_2 = quay.io/pypa/musllinux_1_2_armv7l:2024.11.10-1
5758

cibuildwheel/util.py

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class EnableGroups(enum.Enum):
8686
"aarch64",
8787
"ppc64le",
8888
"s390x",
89+
"armv7l",
8990
"pypy_aarch64",
9091
"pypy_i686",
9192
)

docs/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: Tips and tricks
1010

1111
Linux wheels are built in [`manylinux`/`musllinux` containers](https://github.com/pypa/manylinux) to provide binary compatible wheels on Linux, according to [PEP 600](https://www.python.org/dev/peps/pep-0600/) / [PEP 656](https://www.python.org/dev/peps/pep-0656/). Because of this, when building with `cibuildwheel` on Linux, a few things should be taken into account:
1212

13-
- Programs and libraries are not installed on the CI runner host, but rather should be installed inside the container - using `yum` for `manylinux2010` or `manylinux2014`, `apt-get` for `manylinux_2_24`, `dnf` for `manylinux_2_28` and `apk` for `musllinux_1_1` or `musllinux_1_2`, or manually. The same goes for environment variables that are potentially needed to customize the wheel building.
13+
- Programs and libraries are not installed on the CI runner host, but rather should be installed inside the container - using `yum` for `manylinux2010` or `manylinux2014`, `apt-get` for `manylinux_2_24`/`manylinux_2_31`, `dnf` for `manylinux_2_28` and `apk` for `musllinux_1_1` or `musllinux_1_2`, or manually. The same goes for environment variables that are potentially needed to customize the wheel building.
1414

1515
`cibuildwheel` supports this by providing the [`CIBW_ENVIRONMENT`](options.md#environment) and [`CIBW_BEFORE_ALL`](options.md#before-all) options to setup the build environment inside the running container.
1616

0 commit comments

Comments
 (0)