Skip to content

Commit 060d41d

Browse files
glandiumindygreg
authored andcommitted
ci: add wheels for Xcode's arm64 python 3.8
Upstream python only support arm64 starting from python 3.9, but Xcode ships with an arm64 python 3.8. As cibuildwheel doesn't support using Xcode's python, handle this case manually.
1 parent dae2aab commit 060d41d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/wheel.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
- 'cp39-*'
4545
arch: ['x86_64']
4646
include:
47+
- py: 'cp38-*'
48+
arch: 'arm64'
4749
- py: 'cp39-*'
4850
arch: 'arm64'
4951
runs-on: 'macos-10.15'
@@ -57,16 +59,35 @@ jobs:
5759
uses: actions/setup-python@v2
5860
with:
5961
python-version: '3.8'
62+
if: ${{ matrix.py != 'cp38-*' || matrix.arch != 'arm64' }}
6063

6164
- uses: actions/checkout@v2
6265

6366
- name: Install Dependencies
6467
run: |
6568
pip install --require-hashes -r ci/requirements.macoswheels.txt
69+
if: ${{ matrix.py != 'cp38-*' || matrix.arch != 'arm64' }}
70+
71+
- name: Install Dependencies
72+
run: |
73+
/Applications/Xcode_12.2.app/Contents/Developer/usr/bin/pip3 install --user --require-hashes -r ci/requirements.macoswheels.txt
74+
/Applications/Xcode_12.2.app/Contents/Developer/usr/bin/pip3 install --user wheel
75+
if: ${{ matrix.py == 'cp38-*' && matrix.arch == 'arm64' }}
6676

6777
- name: Build Wheel
6878
run: |
6979
cibuildwheel --output-dir dist
80+
if: ${{ matrix.py != 'cp38-*' || matrix.arch != 'arm64' }}
81+
82+
- name: Build Wheel
83+
run: |
84+
/Applications/Xcode_12.2.app/Contents/Developer/usr/bin/python3 setup.py bdist_wheel
85+
env:
86+
_PYTHON_HOST_PLATFORM: 'macosx-11.0-arm64'
87+
ARCHFLAGS: '-arch arm64'
88+
MACOSX_DEPLOYMENT_TARGET: '11.0'
89+
SDKROOT: '/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk'
90+
if: ${{ matrix.py == 'cp38-*' && matrix.arch == 'arm64' }}
7091

7192
- name: Upload Wheel
7293
uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)