Skip to content

Commit cbf4ae4

Browse files
committed
Make wheel build on OSX universal
1 parent 7def602 commit cbf4ae4

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/wheels.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build Wheel
3030
run: |
3131
cd python
32-
python -m build --wheel
32+
python -m build --wheel --config-setting=--plat-name=macosx_10_9_universal2
3333
- name: Delocate to bundle dynamic libs
3434
run: |
3535
cd python
@@ -116,10 +116,16 @@ jobs:
116116

117117
OSX-test:
118118
needs: ['OSX']
119-
runs-on: macos-latest
120119
strategy:
121120
matrix:
122121
python: [3.9, "3.10", 3.11, 3.12, 3.13]
122+
runner: [macos-13, macos-15]
123+
include:
124+
- runner: macos-13
125+
arch: x86_64
126+
- runner: macos-15
127+
arch: arm64
128+
runs-on: ${{ matrix.runner }}
123129
steps:
124130
- name: Download wheels
125131
uses: actions/[email protected]
@@ -129,12 +135,20 @@ jobs:
129135
uses: actions/[email protected]
130136
with:
131137
python-version: ${{ matrix.python }}
138+
- name: Verify architecture
139+
run: |
140+
arch_name=$(uname -m)
141+
echo "Running on architecture: $arch_name"
142+
if [[ "$arch_name" != "${{ matrix.arch }}" ]]; then
143+
echo "Error: Expected ${{ matrix.arch }} but got $arch_name"
144+
exit 1
145+
fi
132146
- name: Install wheel and test
133147
run: |
134148
python -VV
135149
# Install the local wheel
136150
pip install ./tskit-*.whl
137-
python -c "import tskit"
151+
python -c "import tskit; import platform; print(f'Running on {platform.machine()} architecture')"
138152
139153
windows-test:
140154
needs: ['windows']
@@ -193,7 +207,6 @@ jobs:
193207
pip install ./tskit-*-${{ matrix.wheel }}-*.whl
194208
python -c "import tskit"
195209
196-
197210
PyPI_Upload:
198211
runs-on: ubuntu-24.04
199212
environment: release

0 commit comments

Comments
 (0)