From f9cd1a51604ad19ff182703c83a1d0899695654c Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 13:51:25 -0500 Subject: [PATCH 01/20] ENH: Test wheels [wheels] --- .github/workflows/cibuildwheel.yml | 80 +++++++++++++++++++++++++++--- pyproject.toml | 7 ++- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 89d664b..edaa192 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,8 +1,6 @@ # Build wheels, sdist, and upload to PyPI # code adapted from antio and openmeeg -# TODO: once numpy 1 support is dropped, enable these jobs; set to only run on -# tagged releases, and only if the test.yml workflow is successful name: Build concurrency: @@ -10,17 +8,54 @@ concurrency: cancel-in-progress: true on: # yamllint disable-line rule:truthy workflow_dispatch: - release: - types: [published] + push: + tags: + - 'v*.*.*' + branches: + - main + pull_request: + branches: + - main jobs: + # Adapted from dipy (BSD) + check-commit: + name: Check [wheels] in commit message + runs-on: ubuntu-latest + outputs: + proceed: ${{ steps.commit-message.outputs.PROCEED }} + defaults: + run: + shell: bash -el {0} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 2 + - name: Check commit message for [wheels] + id: commit-message + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + MSG=$(git show -s --format=%s ${{ github.event.pull_request.head.sha }}) + echo "Got commit message: $MSG" + if echo "$MSG" | grep -iq '\[wheels\]'; then + PROCEED=true + else + PROCEED=false + fi + else + PROCEED=true + fi + echo "PROCEED=$PROCEED" | tee -a $GITHUB_OUTPUT + build_wheels: - if: false # disabeling until we can drop support for numpy 1 name: Wheels ${{ matrix.os }} ${{ matrix.arch }} + needs: [check-commit] + if: needs.check-commit.outputs.proceed == 'true' runs-on: ${{ matrix.os }} + timeout-minutes: 20 strategy: matrix: - os: [ubuntu-22.04, ubuntu-24.04, macos-14, macos-15, macos-15-intel] # windows-11 windows-11-arm + os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, macos-15-intel, windows-latest] # windows-11-arm arch: [native] # TODO: Someday this can be enabled, but need to add emulation and it's slow, # can use docker/setup-qemu-action @@ -38,9 +73,38 @@ jobs: CIBW_ARCHS: ${{ matrix.arch }} - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + name: cibw-wheels-${{ runner.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl + test_wheels: + needs: [build_wheels] + name: Test wheels + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + defaults: + run: + shell: bash -el {0} + strategy: + matrix: + os: [ubuntu-22.04, macos-14, macos-14-intel, windows-11] + python: [3.8, 3.14] # old, newest (including pip-prelease) + arch: [native] + steps: + - uses: actions/download-artifact@v5 + with: + pattern: cibw-wheels-* + merge-multiple: true + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + # Choose versions from 2022 (somewhat arbitrarily) + - run: python -m pip install numpy==1.23 scipy=1.8 nibabel pillow xxhash --only-binary="numpy,scipy,nibabel,pillow,xxhash" + if: matrix.python == '3.8' + - run: python -m pip install --pre --upgrade numpy scipy nibabel pillow xxhash --only-binary="numpy,scipy,nibabel,pillow,xxhash" --extra-index-url=https://pypi.anaconda.org/scipy-wheels-nightly/simple + if: matrix.python == '3.14' + - run: pip install --no-index --find-links=file://${PWD}/dist surfa + - run: python -c "import surfa; print(surfa.__version__)" + sdist: timeout-minutes: 10 name: Create sdist @@ -74,7 +138,7 @@ jobs: - run: twine check --strict dist/* publish: - if: ${{ github.repository == 'freesurfer/surfa' && github.event_name == 'release' }} + if: ${{ github.repository == 'freesurfer/surfa' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} needs: [check] name: publish PyPI runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 962f9f8..0f44255 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,13 @@ [build-system] -requires = ['setuptools', 'wheel', 'Cython>=3.0', 'numpy'] +# Cython 3.1+ needed for proper abi3 support +# Should change to `numpy >=2,<3` when NumPy 1.x support is dropped +requires = ['setuptools', 'wheel', 'Cython>=3.1', 'numpy'] [tool.cibuildwheel] build = ["cp3{8,9,10,11}-*"] +skip = [ + "cp38-*musl*", # no SciPy wheels, no need to make them for us +] archs = "native" before-build = "pip install abi3audit" test-command = "python -c \"import surfa; print(surfa.__version__)\"" From fc541f0c1ce261cacc7cad1818dc722cf9ff5e3a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:01:38 -0500 Subject: [PATCH 02/20] FIX: Name [wheels] --- .github/workflows/cibuildwheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index edaa192..f17558c 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -12,10 +12,10 @@ on: # yamllint disable-line rule:truthy tags: - 'v*.*.*' branches: - - main + - master pull_request: branches: - - main + - master jobs: # Adapted from dipy (BSD) From c2dd989fdde3f660a268992cd2938644069c0283 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:11:10 -0500 Subject: [PATCH 03/20] FIX: Faster [wheels] --- .github/workflows/cibuildwheel.yml | 33 +++++++++++++++--------------- pyproject.toml | 7 +++++-- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index f17558c..2d963b5 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -13,6 +13,8 @@ on: # yamllint disable-line rule:truthy - 'v*.*.*' branches: - master + # In a PR, needs "[wheels]" in the message to run + # In a PR, needs "[musl]" in the message to build musl wheels pull_request: branches: - master @@ -20,10 +22,11 @@ on: # yamllint disable-line rule:truthy jobs: # Adapted from dipy (BSD) check-commit: - name: Check [wheels] in commit message + name: Check [wheels] and [musl] in commit message runs-on: ubuntu-latest outputs: proceed: ${{ steps.commit-message.outputs.PROCEED }} + cibw_skip: ${{ steps.commit-message.outputs.CIBW_SKIP }} defaults: run: shell: bash -el {0} @@ -34,6 +37,8 @@ jobs: - name: Check commit message for [wheels] id: commit-message run: | + PROCEED=true + CIBW_SKIP="cp38-*musllinux* cp39-musllinux_aarch64" if [[ "${{ github.event_name }}" == "pull_request" ]]; then MSG=$(git show -s --format=%s ${{ github.event.pull_request.head.sha }}) echo "Got commit message: $MSG" @@ -42,13 +47,15 @@ jobs: else PROCEED=false fi - else - PROCEED=true + if ! echo "$MSG" | grep -iq '\[musl\]'; then + CIBW_SKIP="*musllinux*" + fi fi echo "PROCEED=$PROCEED" | tee -a $GITHUB_OUTPUT + echo "CIBW_SKIP=$CIBW_SKIP" | tee -a $GITHUB_OUTPUT build_wheels: - name: Wheels ${{ matrix.os }} ${{ matrix.arch }} + name: Wheels ${{ matrix.os }} needs: [check-commit] if: needs.check-commit.outputs.proceed == 'true' runs-on: ${{ matrix.os }} @@ -56,24 +63,15 @@ jobs: strategy: matrix: os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, macos-15-intel, windows-latest] # windows-11-arm - arch: [native] - # TODO: Someday this can be enabled, but need to add emulation and it's slow, - # can use docker/setup-qemu-action - # include: - # - os: ubuntu-latest - # arch: aarch64 fail-fast: false - steps: - uses: actions/checkout@v5 - uses: pypa/cibuildwheel@v3.2.0 - with: - output-dir: wheelhouse env: - CIBW_ARCHS: ${{ matrix.arch }} + CIBW_SKIP: ${{ needs.check-commit.outputs.cibw_skip }} - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ runner.os }}-${{ strategy.job-index }} + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl test_wheels: @@ -87,8 +85,9 @@ jobs: strategy: matrix: os: [ubuntu-22.04, macos-14, macos-14-intel, windows-11] - python: [3.8, 3.14] # old, newest (including pip-prelease) - arch: [native] + # oldest using oldest deps, newest using prerelease deps + python: ['3.8', '3.14'] + fail-fast: false steps: - uses: actions/download-artifact@v5 with: diff --git a/pyproject.toml b/pyproject.toml index 0f44255..91dec38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,13 @@ requires = ['setuptools', 'wheel', 'Cython>=3.1', 'numpy'] [tool.cibuildwheel] build = ["cp3{8,9,10,11}-*"] skip = [ - "cp38-*musl*", # no SciPy wheels, no need to make them for us + # no SciPy wheels, no need to make them for us + "cp38-*musllinux*", + "cp39-musllinux_aarch64" ] archs = "native" -before-build = "pip install abi3audit" +# Fail early if no binary wheels for the given platform +before-build = "pip install abi3audit numpy scipy --only-binary=\"numpy,scipy\"" test-command = "python -c \"import surfa; print(surfa.__version__)\"" [tool.cibuildwheel.linux] From 3f6793ebc0a70202ce0bd623e1e0ea6f26ea5aef Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:23:24 -0500 Subject: [PATCH 04/20] FIX: Unify [wheels] [musl] --- .github/workflows/cibuildwheel.yml | 19 ++++++++++++------- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 2d963b5..38a6259 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -84,9 +84,9 @@ jobs: shell: bash -el {0} strategy: matrix: - os: [ubuntu-22.04, macos-14, macos-14-intel, windows-11] - # oldest using oldest deps, newest using prerelease deps - python: ['3.8', '3.14'] + os: [ubuntu-22.04, macos-14, windows-2022] + # oldest using oldest deps, one with newest using prerelease deps + python: ['3.8', '3.11', '3.14'] fail-fast: false steps: - uses: actions/download-artifact@v5 @@ -97,10 +97,15 @@ jobs: with: python-version: ${{ matrix.python }} # Choose versions from 2022 (somewhat arbitrarily) - - run: python -m pip install numpy==1.23 scipy=1.8 nibabel pillow xxhash --only-binary="numpy,scipy,nibabel,pillow,xxhash" - if: matrix.python == '3.8' - - run: python -m pip install --pre --upgrade numpy scipy nibabel pillow xxhash --only-binary="numpy,scipy,nibabel,pillow,xxhash" --extra-index-url=https://pypi.anaconda.org/scipy-wheels-nightly/simple - if: matrix.python == '3.14' + - run: | + NUMPY_SCIPY="numpy scipy" + if [[ "${{ matrix.python }}" == "3.8" ]]; then + NUMPY_SCIPY="numpy==1.23 scipy==1.8" + elif [[ "${{ matrix.python }}" == "3.14" ]]; then + NUMPY_SCIPY="numpy scipy --pre --extra-index-url=https://pypi.anaconda.org/scipy-wheels-nightly/simple" + fi + set -x + python -m pip install $NUMPY_SCIPY nibabel pillow xxhash --only-binary=":all:" - run: pip install --no-index --find-links=file://${PWD}/dist surfa - run: python -c "import surfa; print(surfa.__version__)" diff --git a/pyproject.toml b/pyproject.toml index 91dec38..73153a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ repair-wheel-command = [ ] [tool.cibuildwheel.windows] -before-build = "pip install delvewheel abi3audit" +before-build = "pip install delvewheel abi3audit numpy scipy --only-binary=:all:\"numpy,scipy\"" repair-wheel-command = [ "delvewheel repair -w {dest_dir} {wheel}", "bash tools/audit_wheel.sh {wheel}", From bfe5f9a60db7026e3cb27c92a860f9231ab51caf Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:24:13 -0500 Subject: [PATCH 05/20] FIX: No explosion [wheels] [musl] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 38a6259..6b63b6b 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -86,7 +86,7 @@ jobs: matrix: os: [ubuntu-22.04, macos-14, windows-2022] # oldest using oldest deps, one with newest using prerelease deps - python: ['3.8', '3.11', '3.14'] + python: ['3.8', '3.14'] fail-fast: false steps: - uses: actions/download-artifact@v5 From cec03471d59d566ee3818b4b9f3ec3aabcebdf61 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:25:47 -0500 Subject: [PATCH 06/20] FIX: Name --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 6b63b6b..6b32068 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -125,7 +125,7 @@ jobs: check: needs: [build_wheels, sdist] timeout-minutes: 10 - name: run twine check + name: Twine check runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 From 60c9285ff58db9a5ccf84d7f4757e1dc1fb415ab Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:37:22 -0500 Subject: [PATCH 07/20] FIX: More [wheels] --- .github/workflows/cibuildwheel.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 6b32068..755d210 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -93,20 +93,29 @@ jobs: with: pattern: cibw-wheels-* merge-multiple: true + path: dist + - run: ls -alt dist/ - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} # Choose versions from 2022 (somewhat arbitrarily) - - run: | + - name: Triage env vars + run: | NUMPY_SCIPY="numpy scipy" if [[ "${{ matrix.python }}" == "3.8" ]]; then NUMPY_SCIPY="numpy==1.23 scipy==1.8" elif [[ "${{ matrix.python }}" == "3.14" ]]; then NUMPY_SCIPY="numpy scipy --pre --extra-index-url=https://pypi.anaconda.org/scipy-wheels-nightly/simple" fi - set -x - python -m pip install $NUMPY_SCIPY nibabel pillow xxhash --only-binary=":all:" - - run: pip install --no-index --find-links=file://${PWD}/dist surfa + echo "NUMPY_SCIPY=$NUMPY_SCIPY" | tee -a $GITHUB_ENV + if [[ "${{ runner.os }}" == "Windows"* ]]; then + FIND_LINKS="file://$(cygpath -w ${PWD})\dist" + else + FIND_LINKS="file://${PWD}/dist" + fi + echo "FIND_LINKS=$FIND_LINKS" | tee -a $GITHUB_ENV + - run: pip install $NUMPY_SCIPY nibabel pillow xxhash --only-binary=":all:" + - run: pip install --no-index $FIND_LINKS surfa - run: python -c "import surfa; print(surfa.__version__)" sdist: From 3a22428a3be136f9abd0ec2accef19f9adb77251 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:42:59 -0500 Subject: [PATCH 08/20] FIX: Try [wheels thin] --- .github/workflows/cibuildwheel.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 755d210..6f7be15 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -13,8 +13,10 @@ on: # yamllint disable-line rule:truthy - 'v*.*.*' branches: - master - # In a PR, needs "[wheels]" in the message to run - # In a PR, needs "[musl]" in the message to build musl wheels + # A PR's commit message: + # - Containing "[wheels]" will build all wheels + # - Containing "[wheels thin]" will build just the wheels required for testing + # Non-PR triggers build all wheels. pull_request: branches: - master @@ -44,12 +46,12 @@ jobs: echo "Got commit message: $MSG" if echo "$MSG" | grep -iq '\[wheels\]'; then PROCEED=true + elif echo "$MSG" | grep -iq '\[wheels thin\]'; then + PROCEED=true + CIBW_SKIP="*musllinux* cp39-* cp310-*" else PROCEED=false fi - if ! echo "$MSG" | grep -iq '\[musl\]'; then - CIBW_SKIP="*musllinux*" - fi fi echo "PROCEED=$PROCEED" | tee -a $GITHUB_OUTPUT echo "CIBW_SKIP=$CIBW_SKIP" | tee -a $GITHUB_OUTPUT @@ -65,11 +67,11 @@ jobs: os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, macos-15-intel, windows-latest] # windows-11-arm fail-fast: false steps: - - uses: actions/checkout@v5 - - uses: pypa/cibuildwheel@v3.2.0 + - uses: actions/checkout@v6 + - uses: pypa/cibuildwheel@v3.3.1 env: CIBW_SKIP: ${{ needs.check-commit.outputs.cibw_skip }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl @@ -89,7 +91,7 @@ jobs: python: ['3.8', '3.14'] fail-fast: false steps: - - uses: actions/download-artifact@v5 + - uses: actions/download-artifact@v6 with: pattern: cibw-wheels-* merge-multiple: true @@ -123,10 +125,10 @@ jobs: name: Create sdist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: astral-sh/setup-uv@v6 - run: uv build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: name: cibw-wheels-sdist path: ./dist/*.tar.gz @@ -137,8 +139,8 @@ jobs: name: Twine check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 - - uses: actions/download-artifact@v5 + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v6 with: pattern: cibw-wheels-* merge-multiple: true @@ -162,7 +164,7 @@ jobs: url: https://pypi.org/p/surfa timeout-minutes: 10 steps: - - uses: actions/download-artifact@v5 + - uses: actions/download-artifact@v6 with: pattern: cibw-wheels-* merge-multiple: true From 84dd9d3ca308a0883000a60f09b3a953f3733807 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:49:55 -0500 Subject: [PATCH 09/20] FIX: Faster [wheels thin] --- .github/workflows/cibuildwheel.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 6f7be15..1701424 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -7,6 +7,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} cancel-in-progress: true on: # yamllint disable-line rule:truthy + # Non-PR triggers build all wheels. workflow_dispatch: push: tags: @@ -15,8 +16,7 @@ on: # yamllint disable-line rule:truthy - master # A PR's commit message: # - Containing "[wheels]" will build all wheels - # - Containing "[wheels thin]" will build just the wheels required for testing - # Non-PR triggers build all wheels. + # - Containing "[wheels thin]" will build just the wheels required for testing (3.8, 3.11-abi3) pull_request: branches: - master @@ -24,7 +24,7 @@ on: # yamllint disable-line rule:truthy jobs: # Adapted from dipy (BSD) check-commit: - name: Check [wheels] and [musl] in commit message + name: Triage wheel build runs-on: ubuntu-latest outputs: proceed: ${{ steps.commit-message.outputs.PROCEED }} @@ -48,7 +48,8 @@ jobs: PROCEED=true elif echo "$MSG" | grep -iq '\[wheels thin\]'; then PROCEED=true - CIBW_SKIP="*musllinux* cp39-* cp310-*" + # We don't need the Intel macOS or Ubuntu aarch64 builds at all + CIBW_SKIP="*musllinux* cp39-* cp310-* cp*-macosx_*_x86_64" cp*-*linux*aarch64" else PROCEED=false fi @@ -71,6 +72,7 @@ jobs: - uses: pypa/cibuildwheel@v3.3.1 env: CIBW_SKIP: ${{ needs.check-commit.outputs.cibw_skip }} + CIBW_ALLOW_EMPTY: "True" - uses: actions/upload-artifact@v6 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} From 5e11dcbdb17ab40d3d112a2fc23418c4028f3b22 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:52:36 -0500 Subject: [PATCH 10/20] FIX: More [wheels thin] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 1701424..35ef41b 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -49,7 +49,7 @@ jobs: elif echo "$MSG" | grep -iq '\[wheels thin\]'; then PROCEED=true # We don't need the Intel macOS or Ubuntu aarch64 builds at all - CIBW_SKIP="*musllinux* cp39-* cp310-* cp*-macosx_*_x86_64" cp*-*linux*aarch64" + CIBW_SKIP="*musllinux* cp39-* cp310-* *-macosx_*_x86_64 *-*linux*aarch64" else PROCEED=false fi From 29e0098f37208c5837875146e2dd0aa75f355750 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 14:54:26 -0500 Subject: [PATCH 11/20] FIX: Sel [wheels thin] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 35ef41b..fc40f8c 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -49,7 +49,7 @@ jobs: elif echo "$MSG" | grep -iq '\[wheels thin\]'; then PROCEED=true # We don't need the Intel macOS or Ubuntu aarch64 builds at all - CIBW_SKIP="*musllinux* cp39-* cp310-* *-macosx_*_x86_64 *-*linux*aarch64" + CIBW_SKIP="*musllinux* cp39-* cp310-* *-macosx*x86_64 *-*linux*aarch64" else PROCEED=false fi From b4058a3a87fc392766a2e5ee91b40bce2315c840 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 15:01:03 -0500 Subject: [PATCH 12/20] FIX: Better [wheels thin] --- .github/workflows/cibuildwheel.yml | 8 ++++---- .github/workflows/test.yml | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index fc40f8c..d2a81a6 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -14,9 +14,9 @@ on: # yamllint disable-line rule:truthy - 'v*.*.*' branches: - master - # A PR's commit message: - # - Containing "[wheels]" will build all wheels - # - Containing "[wheels thin]" will build just the wheels required for testing (3.8, 3.11-abi3) + # A PR's commit message containing the following text will build: + # - "[wheels]" : all wheels + # - "[wheels thin]" : just the wheels required for the test_wheels jobs (3.8, 3.11-abi3) pull_request: branches: - master @@ -119,7 +119,7 @@ jobs: fi echo "FIND_LINKS=$FIND_LINKS" | tee -a $GITHUB_ENV - run: pip install $NUMPY_SCIPY nibabel pillow xxhash --only-binary=":all:" - - run: pip install --no-index $FIND_LINKS surfa + - run: pip install --no-index --find-links=$FIND_LINKS surfa - run: python -c "import surfa; print(surfa.__version__)" sdist: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d39e0aa..68e6a87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,10 @@ on: push: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} + cancel-in-progress: true + jobs: test: runs-on: ${{ matrix.os }} @@ -21,7 +25,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - + - name: Display python and system info run: | python -c "import sys; print(f'python {sys.version}')" From d938308af665c37dce7e94ff7aafde62edb6007e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 15:01:39 -0500 Subject: [PATCH 13/20] FIX: Better [wheels thin] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index d2a81a6..74e15d2 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -119,7 +119,7 @@ jobs: fi echo "FIND_LINKS=$FIND_LINKS" | tee -a $GITHUB_ENV - run: pip install $NUMPY_SCIPY nibabel pillow xxhash --only-binary=":all:" - - run: pip install --no-index --find-links=$FIND_LINKS surfa + - run: pip install --no-index --find-links="$FIND_LINKS" surfa - run: python -c "import surfa; print(surfa.__version__)" sdist: From a040ffeb00e9c0e0d5971fd0a6626871db9e8b7d Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 15:04:18 -0500 Subject: [PATCH 14/20] FIX: URL [wheels thin] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 74e15d2..4b51068 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -109,7 +109,7 @@ jobs: if [[ "${{ matrix.python }}" == "3.8" ]]; then NUMPY_SCIPY="numpy==1.23 scipy==1.8" elif [[ "${{ matrix.python }}" == "3.14" ]]; then - NUMPY_SCIPY="numpy scipy --pre --extra-index-url=https://pypi.anaconda.org/scipy-wheels-nightly/simple" + NUMPY_SCIPY="numpy scipy --pre --extra-index-url="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" fi echo "NUMPY_SCIPY=$NUMPY_SCIPY" | tee -a $GITHUB_ENV if [[ "${{ runner.os }}" == "Windows"* ]]; then From 3335cb77675e98c053f43d8a1ec2f72230816a73 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 15:15:27 -0500 Subject: [PATCH 15/20] FIX: URL [wheels thin] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 4b51068..6a7ca1b 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -109,7 +109,7 @@ jobs: if [[ "${{ matrix.python }}" == "3.8" ]]; then NUMPY_SCIPY="numpy==1.23 scipy==1.8" elif [[ "${{ matrix.python }}" == "3.14" ]]; then - NUMPY_SCIPY="numpy scipy --pre --extra-index-url="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" + NUMPY_SCIPY="numpy scipy --pre --extra-index-url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" fi echo "NUMPY_SCIPY=$NUMPY_SCIPY" | tee -a $GITHUB_ENV if [[ "${{ runner.os }}" == "Windows"* ]]; then From 54fedc421ac155b4f5ec552d3f2d2e2035a67f2d Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 15:34:49 -0500 Subject: [PATCH 16/20] FIX: Where [wheels thin] --- .github/workflows/cibuildwheel.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 6a7ca1b..b88883b 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -112,14 +112,8 @@ jobs: NUMPY_SCIPY="numpy scipy --pre --extra-index-url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" fi echo "NUMPY_SCIPY=$NUMPY_SCIPY" | tee -a $GITHUB_ENV - if [[ "${{ runner.os }}" == "Windows"* ]]; then - FIND_LINKS="file://$(cygpath -w ${PWD})\dist" - else - FIND_LINKS="file://${PWD}/dist" - fi - echo "FIND_LINKS=$FIND_LINKS" | tee -a $GITHUB_ENV - run: pip install $NUMPY_SCIPY nibabel pillow xxhash --only-binary=":all:" - - run: pip install --no-index --find-links="$FIND_LINKS" surfa + - run: pip install --no-index --find-links=dist/ surfa - run: python -c "import surfa; print(surfa.__version__)" sdist: From 89ff3b4c649a0e20499a0a9c3c62e5907b81d592 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 8 Jan 2026 15:37:01 -0500 Subject: [PATCH 17/20] FIX: Where [wheels thin] --- .github/workflows/cibuildwheel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index b88883b..6f64afa 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -93,15 +93,15 @@ jobs: python: ['3.8', '3.14'] fail-fast: false steps: + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} - uses: actions/download-artifact@v6 with: pattern: cibw-wheels-* merge-multiple: true path: dist - run: ls -alt dist/ - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} # Choose versions from 2022 (somewhat arbitrarily) - name: Triage env vars run: | From 06117bd171cbd3cd3d09e127cf755d58c72f6ddf Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 9 Jan 2026 09:26:59 -0500 Subject: [PATCH 18/20] FIX: Comment [wheels] --- .github/workflows/cibuildwheel.yml | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 6f64afa..4e25015 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -14,7 +14,8 @@ on: # yamllint disable-line rule:truthy - 'v*.*.*' branches: - master - # A PR's commit message containing the following text will build: + # By default, PRs do not build wheels (for speed/efficiency). However, + # a PR's commit message containing the following text will build: # - "[wheels]" : all wheels # - "[wheels thin]" : just the wheels required for the test_wheels jobs (3.8, 3.11-abi3) pull_request: diff --git a/pyproject.toml b/pyproject.toml index 73153a5..bae83f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ repair-wheel-command = [ ] [tool.cibuildwheel.windows] -before-build = "pip install delvewheel abi3audit numpy scipy --only-binary=:all:\"numpy,scipy\"" +before-build = "pip install delvewheel abi3audit numpy scipy --only-binary=\"numpy,scipy\"" repair-wheel-command = [ "delvewheel repair -w {dest_dir} {wheel}", "bash tools/audit_wheel.sh {wheel}", From 7d9587b7001fce684df0bef7fbf57599f4bde44f Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 9 Jan 2026 09:28:42 -0500 Subject: [PATCH 19/20] FIX: Better [wheels] --- .github/workflows/cibuildwheel.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 4e25015..995e543 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -150,7 +150,9 @@ jobs: - run: twine check --strict dist/* publish: - if: ${{ github.repository == 'freesurfer/surfa' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} + # once ready to cut wheels to PyPI (e.g., numpy 1 support is dropped), remove the + # "false &&" below + if: false && github.repository == 'freesurfer/surfa' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') needs: [check] name: publish PyPI runs-on: ubuntu-latest From e4c2234978c116acb01fe7fb0308869ef10d0bd6 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 9 Jan 2026 09:29:29 -0500 Subject: [PATCH 20/20] FIX: Better [wheels] --- .github/workflows/cibuildwheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 995e543..86ee386 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -66,7 +66,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - os: [ubuntu-latest, ubuntu-24.04-arm, macos-15, macos-15-intel, windows-latest] # windows-11-arm + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel, windows-latest] # windows-11-arm fail-fast: false steps: - uses: actions/checkout@v6