From e72425ce09f04b9c719a1853ef73d8c030fc19f6 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 11 Feb 2021 20:30:20 +0900 Subject: [PATCH] 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. --- .github/workflows/wheel.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 08afb218..44a7ed13 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -44,6 +44,8 @@ jobs: - 'cp39-*' arch: ['x86_64'] include: + - py: 'cp38-*' + arch: 'arm64' - py: 'cp39-*' arch: 'arm64' runs-on: 'macos-10.15' @@ -57,16 +59,35 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.8' + if: ${{ matrix.py != 'cp38-*' || matrix.arch != 'arm64' }} - uses: actions/checkout@v2 - name: Install Dependencies run: | pip install --require-hashes -r ci/requirements.macoswheels.txt + if: ${{ matrix.py != 'cp38-*' || matrix.arch != 'arm64' }} + + - name: Install Dependencies + run: | + /Applications/Xcode_12.2.app/Contents/Developer/usr/bin/pip3 install --user --require-hashes -r ci/requirements.macoswheels.txt + /Applications/Xcode_12.2.app/Contents/Developer/usr/bin/pip3 install --user wheel + if: ${{ matrix.py == 'cp38-*' && matrix.arch == 'arm64' }} - name: Build Wheel run: | cibuildwheel --output-dir dist + if: ${{ matrix.py != 'cp38-*' || matrix.arch != 'arm64' }} + + - name: Build Wheel + run: | + /Applications/Xcode_12.2.app/Contents/Developer/usr/bin/python3 setup.py bdist_wheel + env: + _PYTHON_HOST_PLATFORM: 'macosx-11.0-arm64' + ARCHFLAGS: '-arch arm64' + MACOSX_DEPLOYMENT_TARGET: '11.0' + SDKROOT: '/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk' + if: ${{ matrix.py == 'cp38-*' && matrix.arch == 'arm64' }} - name: Upload Wheel uses: actions/upload-artifact@v2