From 86ee46cd2fb5a54a34d54396da7ddb66aa90570b Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Thu, 5 Nov 2026 07:01:36 +0000 Subject: [PATCH] BLD: Build a single wheel in each Linux job Each ubuntu-latest job built three wheels for its Python version in a row: manylinux x86_64, manylinux aarch64 under QEMU emulation and musllinux x86_64. One job status covered all three wheels, and the Linux jobs of the run of 5 November took 35 to 66 minutes, against at most 24 minutes for all other jobs. - Build manylinux aarch64 natively on the ubuntu-24.04-arm runner and set CIBW_ARCHS_LINUX to native, so no wheel is built under emulation. The QEMU setup step is removed. - Add a variant dimension to the matrix. The musllinux variant of ubuntu-latest builds only the musllinux x86_64 wheel and all other jobs skip musllinux wheels, as before for aarch64. The set of wheels is unchanged. Tests are still skipped for aarch64. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/build-wheels.yml | 38 ++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index bd250ea..1a89ac1 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -10,7 +10,7 @@ on: jobs: build_wheels: - name: ${{ matrix.os }}, ${{matrix.python_impl }} ${{ matrix.python }} + name: ${{ matrix.os }}, ${{matrix.python_impl }} ${{ matrix.python }}${{ matrix.variant == 'musllinux' && ', musllinux' || '' }} runs-on: ${{ matrix.os }} defaults: run: @@ -18,9 +18,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel, windows-11-arm] + # Every job builds a single wheel. Linux x86_64 has two wheels for each + # Python (manylinux and musllinux), so it has two jobs; the musllinux + # job is the one with variant musllinux. Linux aarch64 is built natively + # on an ARM runner. See CIBW_SKIP and CIBW_ARCHS_LINUX below. + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-15-intel, windows-11-arm] python: [cp310, cp311, cp312, cp313, cp314, cp314t, cp315, cp315t] python_impl: [Python] + variant: [default, musllinux] include: - python: cp313 os: ubuntu-latest @@ -32,15 +37,30 @@ jobs: python: cp311 - os: windows-11-arm python: cp312 + # No musllinux wheels for aarch64 and no separate musllinux job + # outside of Linux x86_64 + - os: ubuntu-24.04-arm + variant: musllinux + - os: windows-latest + variant: musllinux + - os: macos-latest + variant: musllinux + - os: macos-15-intel + variant: musllinux + - os: windows-11-arm + variant: musllinux env: BUILD_COMMIT: "main" # or a specific version, e.g., v0.13.1 CIBW_BUILD: ${{ matrix.python }}-* CIBW_ENABLE: cpython-prerelease - CIBW_ARCHS_LINUX: "x86_64 aarch64" + # Build only for the architecture of the runner, so each job builds a + # single wheel and nothing runs under emulation + CIBW_ARCHS_LINUX: native CIBW_ARCHS_MACOS: native - # No support for musl or Win32 for 3.10+ - # Skip musl for 3.8 and 3.9 since no upstream wheels - CIBW_SKIP: "*-win32 *musllinux_aarch64*" + # No support for Win32 for 3.10+ + # The musllinux variant builds only musllinux wheels, all other jobs + # build no musllinux wheel (so there is no musllinux aarch64 wheel) + CIBW_SKIP: "*-win32 ${{ matrix.variant == 'musllinux' && '*manylinux*' || '*musllinux*' }}" CIBW_TEST_REQUIRES: pytest pytest-xdist pytest-randomly threadpoolctl pytest-run-parallel pandas<3.1 CIBW_TEST_COMMAND: python -c "import numpy; numpy.show_runtime(); import statsmodels; statsmodels.test(['-m','(not slow and not example)','-n','2','--randomly-dont-reset-seed'], exit=True)" # Avoid testing on emulated architectures and Pyodide @@ -59,12 +79,6 @@ jobs: submodules: recursive fetch-depth: 0 - - name: Set up QEMU - if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v4 - with: - platforms: all - - name: Build wheels (Default) uses: pypa/cibuildwheel@v4.3 if: (matrix.python_impl != 'Pyodide')