Skip to content

Commit 8cfb43c

Browse files
authored
Merge pull request #3 from alecjacobson/alecjacobson/split-up-builds
Alecjacobson/split up builds
2 parents c3954ff + 80c67ef commit 8cfb43c

1 file changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,34 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
include:
35-
- runs-on: ubuntu-latest
36-
cibw-arch: manylinux_x86_64
37-
- runs-on: macos-latest
38-
cibw-arch: macosx_x86_64
39-
- runs-on: macos-latest
40-
cibw-arch: macosx_arm64
41-
- runs-on: windows-latest
42-
cibw-arch: win_amd64
43-
44-
name: Build wheels ${{ matrix.cibw-arch }}
45-
runs-on: ${{ matrix.runs-on }}
34+
# Launch separate job for each python. The build is so much longer than
35+
# machine configuration/setup, so parallel builds will be faster. More
36+
# importantly, github times out after 6 hours _per job_.
37+
cpversion: ["cp36", "cp37", "cp38", "cp39", "cp310", "cp311"]
38+
os: [ { runs-on: ubuntu-latest, cibw-arch: manylinux_x86_64}, { runs-on: macos-latest, cibw-arch: macosx_x86_64}, { runs-on: macos-latest, cibw-arch: macosx_arm64}, { runs-on: windows-latest, cibw-arch: win_amd64} ]
39+
exclude:
40+
- os: { runs-on: macos-latest, cibw-arch: macosx_arm64}
41+
cpversion: "cp36"
42+
- os: { runs-on: macos-latest, cibw-arch: macosx_arm64}
43+
cpversion: "cp37"
44+
45+
46+
47+
name: Build wheels ${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}
48+
runs-on: ${{ matrix.os.runs-on }}
4649

4750
env:
4851
CIBW_BUILD_VERBOSITY: 3
4952
# This is very dubious... It *may* work because these are just cpp libraries that should not depend on the python version. Still, super-dubious.
5053
CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel"
5154
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "python -m delvewheel repair --no-mangle-all --add-path build\\temp.win-amd64-3.6\\Release;build\\temp.win-amd64-3.6\\Release\\Release;build\\temp.win-amd64-3.6\\Release\\_deps\\gmp-src\\lib;build\\temp.win-amd64-3.6\\Release\\_deps\\mpfr-src\\lib -w {dest_dir} {wheel} "
52-
# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "cd C: && cmd //c tree //F"
53-
CIBW_SKIP: "*-win32 *_i686 pp* cp36* *musllinux*" # Skip 32-bit buildsa and PyPy, and 3.6(scipy) and *musllinux*(scipy)
5455
CIBW_TEST_COMMAND: "python {project}/tests/test_basic.py {project}/data/"
56+
CIBW_BUILD: "${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}"
5557
CIBW_TEST_SKIP: "*-macosx_arm64"
5658
CIBW_ENVIRONMENT: "MAX_JOBS=2"
59+
# Why universal2 here? It's not included above in CIBW_BUILD
60+
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
61+
CIBW_ENVIRONMENT_MACOS: "CMAKE_OSX_ARCHITECTURES=\"${{ matrix.os.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.os.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.os.cibw-arch == 'macosx_universal2' && 'arm64;x86_64' || '' }}\""
5762

5863

5964
steps:
@@ -70,19 +75,6 @@ jobs:
7075
run: |
7176
python -m pip install --upgrade pip
7277
python -m pip install cibuildwheel==2.12.0
73-
74-
# - name: Test
75-
# run: |
76-
# python -m pip install .
77-
78-
- name: Configure cibuildwheel
79-
shell: bash
80-
run: |
81-
CMAKE_ARCH="${{ matrix.cibw-arch == 'win32' && '-A Win32' || '' }}"
82-
CMAKE_OSX_ARCHITECTURES=${{ matrix.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.cibw-arch == 'macosx_universal2' && '"arm64;x86_64"' || '' }}
83-
echo "CIBW_ARCHS_MACOS=x86_64 arm64 universal2" >> $GITHUB_ENV
84-
echo "CIBW_BUILD=*-${{ matrix.cibw-arch }}" >> $GITHUB_ENV
85-
echo "CIBW_ENVIRONMENT_MACOS=CMAKE_OSX_ARCHITECTURES=\"$CMAKE_OSX_ARCHITECTURES\"" >> $GITHUB_ENV
8678
8779
- name: Build wheels
8880
run: |

0 commit comments

Comments
 (0)