Skip to content

Commit b4d80a7

Browse files
committed
Python 3.12 + musllinux_1_1_x86_64 wheel support
* misc CI updates
1 parent c42fa3b commit b4d80a7

File tree

3 files changed

+132
-85
lines changed

3 files changed

+132
-85
lines changed

.github/workflows/ci.yaml

+68-50
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# This is the CI workflow (not the artifact build/release workflow). The workflows
33
# are split because GHA doesn't support a dynamic/conditional matrix. This workflow
4-
# has slow jobs and jobs that require private GHA runners (eg, M1 Mac) commented out.defaults:
4+
# has slow jobs and jobs that require private GHA runners (eg, M1 Mac) commented out.
55
# Ensure changes are synced with manual_artifact_build.yaml.
66
name: PyYAML CI
77

@@ -21,10 +21,10 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout PyYAML
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525

2626
- name: Install a python
27-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v4
2828
with:
2929
python-version: 3.x
3030

@@ -61,7 +61,7 @@ jobs:
6161
python packaging/build/smoketest.py
6262
6363
- name: Upload sdist artifact
64-
uses: actions/upload-artifact@v2
64+
uses: actions/upload-artifact@v3
6565
with:
6666
name: dist
6767
path: dist/*.tar.gz
@@ -77,22 +77,23 @@ jobs:
7777
- { platform: manylinux2014, arch: x86_64 }
7878
# - { platform: manylinux2014, arch: aarch64 }
7979
# - { platform: manylinux2014, arch: s390x }
80+
- { platform: musllinux_1_1, arch: x86_64 }
8081
env:
8182
DOCKER_IMAGE: quay.io/pypa/${{matrix.cfg.platform}}_${{matrix.cfg.arch}}
8283
steps:
8384
- name: Check cached libyaml state
8485
id: cached_libyaml
85-
uses: actions/cache@v2
86+
uses: actions/cache@v3
8687
with:
8788
path: libyaml
8889
key: libyaml_${{matrix.cfg.platform}}_${{matrix.cfg.arch}}_${{env.LIBYAML_REF}}
8990

9091
- name: configure docker foreign arch support
91-
uses: docker/setup-qemu-action@v1
92+
uses: docker/setup-qemu-action@v2
9293
if: matrix.cfg.arch != 'x86_64' && steps.cached_libyaml.outputs.cache-hit != 'true'
9394

9495
- name: Checkout pyyaml
95-
uses: actions/checkout@v2
96+
uses: actions/checkout@v3
9697
if: steps.cached_libyaml.outputs.cache-hit != 'true'
9798

9899
- name: Build libyaml
@@ -124,43 +125,49 @@ jobs:
124125
# - { platform: manylinux1, arch: x86_64, spec: cp38 }
125126
# - { platform: manylinux1, arch: x86_64, spec: cp39 }
126127
# - { platform: manylinux2014, arch: x86_64, spec: cp310 }
127-
- { platform: manylinux2014, arch: x86_64, spec: cp311 }
128+
# - { platform: manylinux2014, arch: x86_64, spec: cp311 }
129+
- { platform: manylinux2014, arch: x86_64, spec: cp312 }
128130
# - { platform: manylinux2014, arch: aarch64, spec: cp36 }
129131
# - { platform: manylinux2014, arch: aarch64, spec: cp37 }
130132
# - { platform: manylinux2014, arch: aarch64, spec: cp38 }
131133
# - { platform: manylinux2014, arch: aarch64, spec: cp39 }
132134
# - { platform: manylinux2014, arch: aarch64, spec: cp310 }
133135
# - { platform: manylinux2014, arch: aarch64, spec: cp311 }
136+
# - { platform: manylinux2014, arch: aarch64, spec: cp312 }
134137
# - { platform: manylinux2014, arch: s390x, spec: cp36 }
135138
# - { platform: manylinux2014, arch: s390x, spec: cp37 }
136139
# - { platform: manylinux2014, arch: s390x, spec: cp38 }
137140
# - { platform: manylinux2014, arch: s390x, spec: cp39 }
138141
# - { platform: manylinux2014, arch: s390x, spec: cp310 }
139142
# - { platform: manylinux2014, arch: s390x, spec: cp311 }
143+
# - { platform: manylinux2014, arch: s390x, spec: cp312 }
144+
# - { platform: musllinux_1_1, arch: x86_64, spec: cp38 }
145+
# - { platform: musllinux_1_1, arch: x86_64, spec: cp39 }
146+
# - { platform: musllinux_1_1, arch: x86_64, spec: cp310 }
147+
# - { platform: musllinux_1_1, arch: x86_64, spec: cp311 }
148+
- { platform: musllinux_1_1, arch: x86_64, spec: cp312 }
140149

141150
steps:
142151
- name: Checkout PyYAML
143-
uses: actions/checkout@v2
152+
uses: actions/checkout@v3
144153

145154
- name: Fetch cached libyaml
146155
id: cached_libyaml
147-
uses: actions/cache@v2
156+
uses: actions/cache/restore@v3
148157
with:
149158
path: libyaml
150159
key: libyaml_${{matrix.platform}}_${{matrix.arch}}_${{env.LIBYAML_REF}}
151-
152-
- name: Ensure libyaml fetched
153-
run: exit 1
154-
if: steps.cached_libyaml.outputs.cache-hit != 'true'
160+
fail-on-cache-miss: true
155161

156162
- name: configure docker foreign arch support
157-
uses: docker/setup-qemu-action@v1
163+
uses: docker/setup-qemu-action@v2
158164
if: matrix.arch != 'x86_64'
159165

160166
- name: Build/Test/Package
161167
env:
162168
CIBW_ARCHS: all
163-
CIBW_BUILD: ${{matrix.spec}}-manylinux_${{matrix.arch}}
169+
# HACK: ick, maybe deconstruct the matrix a bit or query cibuildwheel for its default target *linux spec first?
170+
CIBW_BUILD: ${{matrix.spec}}-${{ contains(matrix.platform, 'musllinux') && 'musllinux' || 'manylinux' }}_${{matrix.arch}}
164171
CIBW_BUILD_VERBOSITY: 1
165172
# containerized Linux builds require explicit CIBW_ENVIRONMENT
166173
CIBW_ENVIRONMENT: >
@@ -177,7 +184,7 @@ jobs:
177184
python3 -m cibuildwheel --platform auto --output-dir dist .
178185
179186
- name: Upload artifacts
180-
uses: actions/upload-artifact@v2
187+
uses: actions/upload-artifact@v3
181188
with:
182189
name: dist
183190
path: dist/*.whl
@@ -201,13 +208,13 @@ jobs:
201208
steps:
202209
- name: Check cached libyaml state
203210
id: cached_libyaml
204-
uses: actions/cache@v2
211+
uses: actions/cache@v3
205212
with:
206213
path: libyaml
207214
key: libyaml_macos_${{matrix.arch}}_${{env.LIBYAML_REF}}
208215

209216
- name: Checkout PyYAML
210-
uses: actions/checkout@v2
217+
uses: actions/checkout@v3
211218
if: steps.cached_libyaml.outputs.cache-hit != 'true'
212219

213220
- name: Build libyaml
@@ -232,16 +239,18 @@ jobs:
232239
strategy:
233240
matrix:
234241
include:
235-
- spec: cp36-macosx_x86_64
236-
cibw_version: cibuildwheel==2.11.1
242+
# - spec: cp36-macosx_x86_64
243+
# cibw_version: cibuildwheel==2.11.1
237244
# - spec: cp37-macosx_x86_64
245+
# cibw_version: cibuildwheel==2.11.1
238246
# - spec: cp38-macosx_x86_64
247+
# cibw_version: cibuildwheel==2.11.1
239248
# - spec: cp39-macosx_x86_64
240249
# - spec: cp310-macosx_x86_64
241-
- spec: cp311-macosx_x86_64
250+
# - spec: cp311-macosx_x86_64
251+
- spec: cp312-macosx_x86_64
242252

243253
# # build for arm64 under a hacked macOS 12 self-hosted x86_64-on-arm64 runner until arm64 is fully supported
244-
# # FIXME: ? cp38-macosx_arm64 requires special handling and fails some test_zdist tests under cibw 2.1.2, skip it (so Apple's XCode python3 won't have a wheel)
245254
# - spec: cp39-macosx_arm64
246255
# deployment_target: '11.0'
247256
# runs_on: [self-hosted, macOS, arm64]
@@ -261,22 +270,26 @@ jobs:
261270
# runs_on: [self-hosted, macOS, arm64]
262271
# arch: arm64
263272
# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
273+
# sdkroot: macosx11.3
274+
#
275+
# - spec: cp312-macosx_arm64
276+
# deployment_target: '11.0'
277+
# runs_on: [self-hosted, macOS, arm64]
278+
# arch: arm64
279+
# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0}
264280
# sdkroot: macosx11.3
265281

266282
steps:
267283
- name: Checkout PyYAML
268-
uses: actions/checkout@v2
284+
uses: actions/checkout@v3
269285

270286
- name: Get cached libyaml state
271287
id: cached_libyaml
272-
uses: actions/cache@v2
288+
uses: actions/cache/restore@v3
273289
with:
274290
path: libyaml
275291
key: libyaml_macos_${{ matrix.arch || 'x86_64' }}_${{env.LIBYAML_REF}}
276-
277-
- name: Ensure libyaml fetched
278-
run: exit 1
279-
if: steps.cached_libyaml.outputs.cache-hit != 'true'
292+
fail-on-cache-miss: true
280293

281294
- name: Build/Test/Package
282295
env:
@@ -293,7 +306,7 @@ jobs:
293306
python3 -m cibuildwheel --platform auto --output-dir dist .
294307
295308
- name: Upload artifacts
296-
uses: actions/upload-artifact@v2
309+
uses: actions/upload-artifact@v3
297310
with:
298311
name: dist
299312
path: dist/*.whl
@@ -312,7 +325,7 @@ jobs:
312325
steps:
313326
- name: Get cached libyaml state
314327
id: cached_libyaml
315-
uses: actions/cache@v2
328+
uses: actions/cache@v3
316329
with:
317330
path: libyaml
318331
key: libyaml_${{matrix.platform}}_${{matrix.arch}}_${{env.LIBYAML_REF}}
@@ -347,10 +360,10 @@ jobs:
347360
strategy:
348361
matrix:
349362
include:
350-
- platform: windows-2019
351-
build_arch: x64
352-
python_arch: x64
353-
spec: 3.6
363+
# - platform: windows-2019
364+
# build_arch: x64
365+
# python_arch: x64
366+
# spec: 3.6
354367
# - platform: windows-2019
355368
# build_arch: x64
356369
# python_arch: x64
@@ -367,14 +380,18 @@ jobs:
367380
# build_arch: x64
368381
# python_arch: x64
369382
# spec: '3.10'
383+
# - platform: windows-2019
384+
# build_arch: x64
385+
# python_arch: x64
386+
# spec: '3.11'
370387
- platform: windows-2019
371388
build_arch: x64
372389
python_arch: x64
373-
spec: '3.11'
374-
- platform: windows-2019
375-
build_arch: win32
376-
python_arch: x86
377-
spec: 3.6
390+
spec: '3.12.0-rc.1'
391+
# - platform: windows-2019
392+
# build_arch: win32
393+
# python_arch: x86
394+
# spec: 3.6
378395
# - platform: windows-2019
379396
# build_arch: win32
380397
# python_arch: x86
@@ -391,10 +408,14 @@ jobs:
391408
# build_arch: win32
392409
# python_arch: x86
393410
# spec: '3.10'
411+
# - platform: windows-2019
412+
# build_arch: win32
413+
# python_arch: x86
414+
# spec: '3.11'
394415
- platform: windows-2019
395416
build_arch: win32
396417
python_arch: x86
397-
spec: '3.11'
418+
spec: '3.12.0-rc.1'
398419
steps:
399420
# autocrlf screws up tests under Windows
400421
- name: Set git to use LF
@@ -403,21 +424,18 @@ jobs:
403424
git config --global core.eol lf
404425
405426
- name: Checkout pyyaml
406-
uses: actions/checkout@v2
427+
uses: actions/checkout@v3
407428

408429
- name: Get cached libyaml state
409430
id: cached_libyaml
410-
uses: actions/cache@v2
431+
uses: actions/cache/restore@v3
411432
with:
412433
path: libyaml
413434
key: libyaml_${{matrix.platform}}_${{matrix.build_arch}}_${{env.LIBYAML_REF}}
414-
415-
- name: Ensure libyaml fetched
416-
run: exit 1
417-
if: steps.cached_libyaml.outputs.cache-hit != 'true'
435+
fail-on-cache-miss: true
418436

419437
- name: Install python ${{ matrix.spec }}
420-
uses: actions/setup-python@v2
438+
uses: actions/setup-python@v4
421439
with:
422440
architecture: ${{ matrix.python_arch }}
423441
python-version: ${{ matrix.spec }}
@@ -430,7 +448,7 @@ jobs:
430448
run: |
431449
set -eux
432450
python -V
433-
python -m pip install "Cython<3.0" wheel
451+
python -m pip install "Cython<3.0" setuptools wheel
434452
435453
python setup.py \
436454
--with-libyaml build_ext \
@@ -444,7 +462,7 @@ jobs:
444462
python tests/lib/test_all.py
445463
446464
- name: Upload artifacts
447-
uses: actions/upload-artifact@v2
465+
uses: actions/upload-artifact@v3
448466
with:
449467
name: dist
450468
path: dist/*.whl

0 commit comments

Comments
 (0)