@@ -131,23 +131,6 @@ jobs:
131
131
python : 312
132
132
platform_id : macosx_x86_64
133
133
134
- # MacOS arm64
135
- - os : macos-latest
136
- python : 38
137
- platform_id : macosx_arm64
138
- - os : macos-latest
139
- python : 39
140
- platform_id : macosx_arm64
141
- - os : macos-latest
142
- python : 310
143
- platform_id : macosx_arm64
144
- - os : macos-latest
145
- python : 311
146
- platform_id : macosx_arm64
147
- - os : macos-latest
148
- python : 312
149
- platform_id : macosx_arm64
150
-
151
134
steps :
152
135
- uses : actions/checkout@v4
153
136
with :
@@ -169,13 +152,14 @@ jobs:
169
152
python -m pip install -U pip
170
153
python -m pip install cibuildwheel>=2.16
171
154
172
- - name : Build wheels
155
+ - name : Build wheels (non-MacOS arm64)
173
156
env :
174
157
CIBW_BUILD : cp${{ matrix.python }}-${{ matrix.platform_id }}
175
158
CIBW_ARCHS : all
176
159
CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux_image }}
177
160
CIBW_MANYLINUX_I686_IMAGE : ${{ matrix.manylinux_image }}
178
161
CIBW_MANYLINUX_AARCH64_IMAGE : ${{ matrix.manylinux_image }}
162
+ CIBW_ARCHS_MACOS : x86_64
179
163
CIBW_BUILD_VERBOSITY : 1
180
164
run : |
181
165
python --version
@@ -187,9 +171,66 @@ jobs:
187
171
name : wheel-${{ matrix.python }}-${{ matrix.platform_id }}
188
172
path : ./dist
189
173
174
+ build-wheels-macos-arm64 :
175
+ name : Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
176
+ runs-on : ${{ matrix.os }}
177
+ strategy :
178
+ fail-fast : false
179
+ matrix :
180
+ include :
181
+ - os : macos-latest
182
+ python : 38
183
+ platform_id : macosx_arm64
184
+ - os : macos-latest
185
+ python : 39
186
+ platform_id : macosx_arm64
187
+ - os : macos-latest
188
+ python : 310
189
+ platform_id : macosx_arm64
190
+ - os : macos-latest
191
+ python : 311
192
+ platform_id : macosx_arm64
193
+ - os : macos-latest
194
+ python : 312
195
+ platform_id : macosx_arm64
196
+
197
+ steps :
198
+ - uses : actions/checkout@v4
199
+ with :
200
+ submodules : true
201
+
202
+ - uses : actions/setup-python@v5
203
+ name : Install Python
204
+ with :
205
+ python-version : ' 3.9'
206
+
207
+ - name : Install cibuildwheel
208
+ run : python -m pip install cibuildwheel==2.16.2 wheel==0.42
209
+
210
+ - name : Build wheels
211
+ env :
212
+ CIBW_BUILD : cp${{ matrix.python }}-*
213
+ CIBW_ARCHS_MACOS : arm64
214
+ CIBW_BUILD_VERBOSITY : 1
215
+ run : |
216
+ python -m cibuildwheel --output-dir dist
217
+
218
+ # Cross compiling wheels for arm64 with poetry creates wheels with wrong tag
219
+ # Update the wheel with the correct tag then remove the incorrect wheel
220
+ - name : Fix poetry mistagging
221
+ run : |
222
+ wheel tags --platform-tag macosx_12_0_arm64 ./dist/*-macosx_12_0_x86_64.whl
223
+ rm ./dist/*-macosx_12_0_x86_64.whl
224
+
225
+ - name : Store artifacts
226
+ uses : actions/upload-artifact@v4
227
+ with :
228
+ name : wheel-${{ matrix.python }}-${{ matrix.platform_id }}
229
+ path : ./dist/*.whl
230
+
190
231
test-package :
191
232
name : Test built package
192
- needs : [ build-wheels, build-sdist ]
233
+ needs : [ build-wheels, build-sdist, build-wheels-macos-arm64 ]
193
234
runs-on : ubuntu-latest
194
235
timeout-minutes : 30
195
236
strategy :
@@ -233,7 +274,6 @@ jobs:
233
274
python -m pytest --pyargs openjpeg.tests
234
275
deactivate
235
276
236
-
237
277
# The pypi upload fails with non-linux containers, so grab the uploaded
238
278
# artifacts and run using those
239
279
# See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
0 commit comments