77 - " *"
88
99jobs :
10- build_wheels :
11- name : Build wheels on ${{ matrix.os }}
12- runs-on : ${{ matrix.os }}
10+ build_linux_wheels :
11+ name : Build ${{ matrix.linux_tag }} wheels with cp ${{ matrix.python-version }}
12+ runs-on : ubuntu-latest
1313 strategy :
14- # https://github.com/actions/runner-images/tree/main
1514 matrix :
16- os :
17- [
18- ubuntu-latest,
19- windows-2019,
20- windows-2022,
21- macos-13,
22- macos-14,
23- ]
24-
15+ linux_tag : ["manylinux", "musllinux"]
16+ python-version : ["310", "311", "312", "313"]
2517 steps :
2618 - uses : actions/checkout@v4
27-
28- - name : Set up rust
29- if : matrix.os != 'ubuntu-20.04' && matrix.os != 'ubuntu-22.04' && matrix.os != 'ubuntu-24.04'
30- uses : dtolnay/rust-toolchain@stable
31- with :
32- toolchain : nightly
33-
34- - run : rustup target add aarch64-apple-darwin && rustup target add x86_64-apple-darwin
35- if : matrix.os == 'macos-13' || matrix.os == 'macos-14'
36-
37- - run : rustup toolchain install stable-i686-pc-windows-msvc
38- if : matrix.os == 'windows-2019' || matrix.os == 'windows-2022'
39-
40- - run : rustup target add i686-pc-windows-msvc
41- if : matrix.os == 'windows-2019' || matrix.os == 'windows-2022'
42-
4319 - name : Set up QEMU
44- if : matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'
4520 uses : docker/setup-qemu-action@v3
4621 with :
4722 platforms : all
48-
4923 - name : Build wheels
50245125 timeout-minutes : 720
5226 env :
53- CIBW_BUILD_VERBOSITY : 2
54- CIBW_BUILD : " cp310-* cp311-* cp312-* cp313-*"
27+ CIBW_BUILD : " cp${{ matrix.python-version }}-${{ matrix.linux_tag }}_*"
5528 CIBW_ARCHS_LINUX : " x86_64 i686 aarch64"
56- # CIBW_ARCHS_MACOS: "x86_64 arm64"
57- CIBW_ARCHS_MACOS : " universal2"
58- # We don't build ARM64 wheels yet because there's a Rust issue
59- CIBW_ARCHS_WINDOWS : " AMD64 x86"
60- # Rust nighlty doesn't seem to be available for musl linux on i686
6129 CIBW_SKIP : " *-musllinux_i686"
62-
63- # arm64 and universal2 wheels are tagged with x86_64 because there's an issue with Poetry
64- # More information here: https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile (CTRL + F "poetry")
65- # https://github.com/pypa/cibuildwheel/issues/1415
66- CIBW_REPAIR_WHEEL_COMMAND_MACOS : >
67- ls {dest_dir} &&
68- delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} &&
69- for file in {dest_dir}/*.whl ; do mv $file ${file//x86_64/universal2} ; done
70-
7130 CIBW_MANYLINUX_X86_64_IMAGE : " manylinux2014"
7231 CIBW_MANYLINUX_I686_IMAGE : " manylinux2014"
7332 CIBW_MANYLINUX_AARCH64_IMAGE : " manylinux2014"
74- CIBW_MANYLINUX_PYPY_X86_64_IMAGE : " manylinux2014"
75- CIBW_MANYLINUX_PYPY_I686_IMAGE : " manylinux2014"
76- CIBW_MANYLINUX_PYPY_AARCH64_IMAGE : " manylinux2014"
77-
7833 CIBW_MUSLLINUX_X86_64_IMAGE : " musllinux_1_1"
7934 CIBW_MUSLLINUX_I686_IMAGE : " musllinux_1_1"
8035 CIBW_MUSLLINUX_AARCH64_IMAGE : " musllinux_1_1"
81-
8236 CIBW_ENVIRONMENT : ' PATH="$HOME/.cargo/bin:$PATH"'
83- # Fix the following error: error: cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module -- --crate-type cdylibfailed with code -9
84- # You need to set a second environment variable CARGO_NET_GIT_FETCH_WITH_CLI="true" for linux environments
85- # Solutio found here: https://github.com/rust-lang/cargo/issues/10583
8637 CIBW_ENVIRONMENT_LINUX : ' PATH="$HOME/.cargo/bin:$PATH" CARGO_NET_GIT_FETCH_WITH_CLI="true"'
87- CIBW_ENVIRONMENT_WINDOWS : ' PATH="$UserProfile\.cargo\bin;$PATH"'
88-
8938 CIBW_BEFORE_BUILD : >
9039 rustup default nightly &&
9140 rustup show
9241 CIBW_BEFORE_BUILD_LINUX : >
9342 curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y &&
9443 rustup show
44+ - uses : actions/upload-artifact@v4
45+ with :
46+ name : artifact-${{ matrix.linux_tag }}-cp${{ matrix.python-version }}
47+ path : ./wheelhouse/*.whl
9548
96- # Fixes delocate.libsana.DelocationError:
97- # river/stats/_rust_stats.cpython-310-darwin.so has a minimum target of 10.12
49+ build_macos_wheels :
50+ name : Build wheels on ${{ matrix.os }}
51+ runs-on : ${{ matrix.os }}
52+ strategy :
53+ matrix :
54+ os : [macos-13, macos-14]
55+ steps :
56+ - uses : actions/checkout@v4
57+ - name : Set up rust
58+ uses : dtolnay/rust-toolchain@stable
59+ with :
60+ toolchain : nightly
61+ - run : rustup target add aarch64-apple-darwin && rustup target add x86_64-apple-darwin
62+ - name : Build wheels
63+ 64+ timeout-minutes : 720
65+ env :
66+ CIBW_BUILD : " cp310-* cp311-* cp312-* cp313-*"
67+ CIBW_ARCHS_MACOS : " universal2"
68+ # arm64 and universal2 wheels are tagged with x86_64 because there's an issue with Poetry
69+ # More information here: https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile (CTRL + F "poetry")
70+ # https://github.com/pypa/cibuildwheel/issues/1415
71+ CIBW_REPAIR_WHEEL_COMMAND_MACOS : >
72+ ls {dest_dir} &&
73+ delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} &&
74+ for file in {dest_dir}/*.whl ; do mv $file ${file//x86_64/universal2} ; done
75+ CIBW_ENVIRONMENT : ' PATH="$HOME/.cargo/bin:$PATH"'
76+ CIBW_BEFORE_BUILD : >
77+ rustup default nightly &&
78+ rustup show
9879 MACOSX_DEPLOYMENT_TARGET : 10.13
80+ - uses : actions/upload-artifact@v4
81+ with :
82+ name : artifact-${{ matrix.os }}
83+ path : ./wheelhouse/*.whl
9984
85+ build_windows_wheels :
86+ name : Build wheels on ${{ matrix.os }}
87+ runs-on : ${{ matrix.os }}
88+ strategy :
89+ matrix :
90+ os : [windows-2019, windows-2022]
91+ steps :
92+ - uses : actions/checkout@v4
93+ - name : Set up rust
94+ uses : dtolnay/rust-toolchain@stable
95+ with :
96+ toolchain : nightly
97+ - run : rustup toolchain install stable-i686-pc-windows-msvc
98+ - run : rustup target add i686-pc-windows-msvc
99+ - name : Build wheels
100+ 101+ timeout-minutes : 720
102+ env :
103+ CIBW_BUILD : " cp310-* cp311-* cp312-* cp313-*"
104+ CIBW_ARCHS_WINDOWS : " AMD64 x86"
105+ CIBW_ENVIRONMENT : ' PATH="$HOME/.cargo/bin:$PATH"'
106+ CIBW_ENVIRONMENT_WINDOWS : ' PATH="$UserProfile\.cargo\bin;$PATH"'
107+ CIBW_BEFORE_BUILD : >
108+ rustup default nightly &&
109+ rustup show
100110 - uses : actions/upload-artifact@v4
101111 with :
102112 name : artifact-${{ matrix.os }}
103113 path : ./wheelhouse/*.whl
104114
105115 build_sdist :
106116 name : Build source distribution
117+ # Can't use more than 12 jobs in parallel
118+ needs : [build_macos_wheels]
107119 runs-on : ubuntu-latest
108120 steps :
109121 - uses : actions/checkout@v4
@@ -123,7 +135,7 @@ jobs:
123135
124136 merge_artifacts :
125137 runs-on : ubuntu-latest
126- needs : [build_wheels , build_sdist]
138+ needs : [build_linux_wheels, build_macos_wheels, build_windows_wheels , build_sdist]
127139 steps :
128140 - name : Merge Artifacts
129141 uses : actions/upload-artifact/merge@v4
0 commit comments