Skip to content

Commit 569f738

Browse files
xavier2k6arvidn
authored andcommitted
cibuildwheel: Add macOS arm64 support
1 parent dd1114c commit 569f738

File tree

2 files changed

+50
-31
lines changed

2 files changed

+50
-31
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: cibuildwheel
66
# sample.
77

88
# The full list of cibuildwheel's build targets can be found here:
9-
# https://github.com/pypa/cibuildwheel/blob/v2.16.5/cibuildwheel/resources/build-platforms.toml
9+
# https://github.com/pypa/cibuildwheel/blob/v2.21.3/cibuildwheel/resources/build-platforms.toml
1010

1111
# Notes on build targets we (don't) support:
1212
# - pypy: libtorrent doesn't build with pypy as of writing
@@ -45,22 +45,31 @@ jobs:
4545
MATRIX_PULL_REQUEST: |
4646
{
4747
"include": [
48-
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-manylinux_*", "CIBW_ARCHS": "x86_64"},
49-
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-musllinux_*", "CIBW_ARCHS": "x86_64"},
50-
{"os": "macos-12", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "x86_64"},
51-
{"os": "windows-2022", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "AMD64"}
48+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"},
49+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"},
50+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"},
51+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"},
52+
{"os": "macos-12", "CIBW_BUILD": "cp39-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"},
53+
{"os": "macos-13", "CIBW_BUILD": "cp39-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"},
54+
{"os": "macos-14", "CIBW_BUILD": "cp39-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"},
55+
{"os": "macos-15", "CIBW_BUILD": "cp39-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"},
56+
{"os": "windows-latest", "CIBW_BUILD": "cp39-win32", "CIBW_ARCHS_WINDOWS": "x86"},
57+
{"os": "windows-latest", "CIBW_BUILD": "cp39-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"}
5258
]
5359
}
5460
MATRIX_WORKFLOW_DISPATCH: |
5561
{
5662
"include": [
57-
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_*", "CIBW_ARCHS": "x86_64"},
58-
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_*", "CIBW_ARCHS": "aarch64"},
59-
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_*", "CIBW_ARCHS": "x86_64"},
60-
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_*", "CIBW_ARCHS": "aarch64"},
61-
{"os": "macos-12", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86_64"},
62-
{"os": "windows-2022", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86"},
63-
{"os": "windows-2022", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "AMD64"}
63+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"},
64+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"},
65+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"},
66+
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"},
67+
{"os": "macos-12", "CIBW_BUILD": "cp*-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"},
68+
{"os": "macos-13", "CIBW_BUILD": "cp*-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"},
69+
{"os": "macos-14", "CIBW_BUILD": "cp*-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"},
70+
{"os": "macos-15", "CIBW_BUILD": "cp*-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"},
71+
{"os": "windows-latest", "CIBW_BUILD": "cp*-win32", "CIBW_ARCHS_WINDOWS": "x86"},
72+
{"os": "windows-latest", "CIBW_BUILD": "cp*-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"}
6473
]
6574
}
6675
@@ -87,7 +96,11 @@ jobs:
8796
env:
8897
CIBW_BUILD_VERBOSITY: 1
8998
CIBW_BUILD: ${{ matrix.CIBW_BUILD }}
90-
CIBW_ARCHS: ${{ matrix.CIBW_ARCHS }}
99+
CIBW_ARCHS_LINUX: ${{ matrix.CIBW_ARCHS_LINUX }}
100+
CIBW_ARCHS_WINDOWS: ${{ matrix.CIBW_ARCHS_WINDOWS }}
101+
CIBW_ARCHS_MACOS: ${{ matrix.CIBW_ARCHS_MACOS }}
102+
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MACOSX_DEPLOYMENT_TARGET }}
103+
CIBW_SKIP: pp*
91104
CIBW_TEST_SKIP: "*-win32"
92105

93106
steps:
@@ -101,50 +114,57 @@ jobs:
101114
id: cache-wheel
102115
with:
103116
path: wheelhouse
104-
key: wheel-${{ matrix.CIBW_BUILD }}-${{ matrix.CIBW_ARCHS }}-${{ github.sha }}
117+
key: wheel-${{ matrix.os }}-${{ matrix.CIBW_BUILD }}
105118

106119
- uses: docker/setup-qemu-action@v3
107120
if: steps.cache-wheel.outputs.cache-hit != 'true' && runner.os == 'Linux'
108121

109-
- uses: pypa/[email protected]
122+
- name: Install OpenSSL (win32)
123+
if: ${{ endsWith(matrix.CIBW_BUILD, 'win32') }}
124+
run: |
125+
Remove-Item -Path "C:\Program Files\OpenSSL" -Force -Recurse
126+
vcpkg install openssl:x86-windows
127+
New-Item -Path "C:\Program Files\OpenSSL" -ItemType SymbolicLink -Value "C:\vcpkg\packages\openssl_x86-windows\"
128+
129+
- uses: pypa/[email protected]
110130
if: steps.cache-wheel.outputs.cache-hit != 'true'
111131

112-
- uses: actions/upload-artifact@v3
132+
- uses: actions/upload-artifact@v4
113133
with:
114134
path: wheelhouse/*.whl
115-
name: wheels
135+
name: wheels-${{ matrix.os }}-${{ matrix.CIBW_BUILD }}
116136

117137
upload_pypi:
118138
needs: build_wheels
119139
runs-on: ubuntu-latest
120140
if: needs.build_wheels.result == 'success' && github.event.inputs.publish == 'PUBLISH'
121141

122142
steps:
123-
- uses: actions/download-artifact@v3
143+
- uses: actions/download-artifact@v4
124144
with:
125-
name: wheels
145+
name: wheels-${{ matrix.os }}-${{ matrix.CIBW_BUILD }}
126146
path: wheelhouse
127147

128148
- uses: pypa/gh-action-pypi-publish@release/v1
129149
with:
130150
password: ${{ secrets.PYPI_API_TOKEN }}
131-
packages_dir: wheelhouse
132-
skip_existing: true
151+
packages-dir: wheelhouse
152+
skip-existing: true
133153

134154
upload_pypi_test:
135155
needs: build_wheels
136156
runs-on: ubuntu-latest
137157
if: needs.build_wheels.result == 'success' && github.event.inputs.publish_test == 'PUBLISH_TEST'
138158

139159
steps:
140-
- uses: actions/download-artifact@v3
160+
- uses: actions/download-artifact@v4
141161
with:
142-
name: wheels
162+
name: wheels-${{ matrix.os }}-${{ matrix.CIBW_BUILD }}
143163
path: wheelhouse
144164

145165
- uses: pypa/gh-action-pypi-publish@release/v1
146166
with:
147167
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
148-
packages_dir: wheelhouse
149-
skip_existing: true
168+
packages-dir: wheelhouse
169+
skip-existing: true
150170
repository_url: https://test.pypi.org/legacy/

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
requires-python = ">=3.7"
2+
requires-python = ">=3.9"
33

44
[tool.cibuildwheel]
55
skip = "{pp*,}"
@@ -17,8 +17,7 @@ test-command = [
1717
[tool.cibuildwheel.macos.environment]
1818
BOOST_BUILD_PATH = "/tmp/boost/tools/build"
1919
BOOST_ROOT = "/tmp/boost"
20-
BOOST_VERSION = "1.81.0"
21-
MACOSX_DEPLOYMENT_TARGET = "12"
20+
BOOST_VERSION = "1.83.0"
2221
PATH = "/tmp/boost:$PATH"
2322

2423
[[tool.cibuildwheel.overrides]]
@@ -38,7 +37,7 @@ test-command = [
3837
[tool.cibuildwheel.overrides.environment] # sub-table of previous block!
3938
BOOST_BUILD_PATH = "/tmp/boost/tools/build"
4039
BOOST_ROOT = "/tmp/boost"
41-
BOOST_VERSION = "1.81.0"
40+
BOOST_VERSION = "1.83.0"
4241
PATH = "/usr/local/ccache/bin:/tmp/boost:$PATH"
4342

4443
[[tool.cibuildwheel.overrides]]
@@ -57,7 +56,7 @@ test-command = [
5756
[tool.cibuildwheel.overrides.environment] # sub-table of previous block!
5857
BOOST_BUILD_PATH = "/tmp/boost/tools/build"
5958
BOOST_ROOT = "/tmp/boost"
60-
BOOST_VERSION = "1.81.0"
59+
BOOST_VERSION = "1.83.0"
6160
PATH = "/usr/lib/ccache/bin:/tmp/boost:$PATH"
6261

6362
[[tool.cibuildwheel.overrides]]
@@ -78,7 +77,7 @@ test-command = '''bash -c "cd '{project}/bindings/python' && python test.py"'''
7877
[tool.cibuildwheel.windows.environment]
7978
BOOST_BUILD_PATH = 'c:/boost/tools/build'
8079
BOOST_ROOT = 'c:/boost'
81-
BOOST_VERSION = "1.81.0"
80+
BOOST_VERSION = "1.83.0"
8281
PATH = 'c:/boost;$PATH'
8382

8483
[tool.isort]

0 commit comments

Comments
 (0)