Skip to content

Commit 9149449

Browse files
authored
cibuildwheel with macOS (#17)
* Use cibuildwheel for all three: Linux, macOS and Windows * Disable building for PyPy on macOS because it passes an unrecognised flag to the Apple linker * Disable unit testing with cibuildwheel because PyPy does not support getting the reference count * The unit tests should eventually be modified to check the reference counts only on CPython. * Then test workflow can be removed and unit testing can be done with cibuildwheel.
1 parent bbff73c commit 9149449

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

.github/workflows/package.yml

+8-30
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,28 @@ name: package
22
on: [push, workflow_dispatch]
33

44
jobs:
5-
# The Apple linker does not understand one of the flags cibuildwheel passes
6-
# to it. Hence, use Hatch: it generates universal wheels.
7-
build_macos:
5+
build:
86
strategy:
97
matrix:
10-
os: ['macos-14']
11-
python: ['3.10', '3.11', '3.12', '3.13']
12-
name: build on ${{ matrix.os }} with ${{ matrix.python }}
13-
runs-on: ${{ matrix.os }}
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v5
17-
id: sp
18-
with:
19-
python-version: ${{ matrix.python }}
20-
- run: pipx install hatch
21-
- run: hatch build
22-
env:
23-
HATCH_PYTHON: ${{ steps.sp.outputs.python-path }}
24-
- uses: actions/upload-artifact@v4
25-
with:
26-
name: wheel-${{ matrix.os }}-${{ matrix.python }}
27-
path: dist/*.whl
28-
29-
# Hatch builds Linux wheels with a platform tag not permitted by PyPI. Hence,
30-
# use cibuildwheel.
31-
build_ubuntu_windows:
32-
strategy:
33-
matrix:
34-
os: ['ubuntu-22.04', 'windows-2022']
8+
os: ['macos-13', 'macos-14', 'ubuntu-22.04', 'windows-2022']
359
name: build on ${{ matrix.os }}
3610
runs-on: ${{ matrix.os }}
3711
steps:
3812
- uses: actions/checkout@v4
3913
- run: pipx install cibuildwheel==2.21.3
4014
- run: cibuildwheel --output-dir wheelhouse
15+
env:
16+
# The Apple linker does not recognise one of the flags passed to it
17+
# while building for PyPy. Skip it.
18+
CIBW_SKIP: pp*-macosx*
4119
- uses: actions/upload-artifact@v4
4220
with:
43-
name: wheel-${{ matrix.os }}-${{ strategy.job-index }}
21+
name: wheels-${{ matrix.os }}-${{ strategy.job-index }}
4422
path: wheelhouse/*.whl
4523

4624
release:
4725
if: github.ref_type == 'tag'
48-
needs: [build_macos, build_ubuntu_windows]
26+
needs: [build]
4927
runs-on: ubuntu-22.04
5028
permissions: write-all
5129
steps:

0 commit comments

Comments
 (0)