From 40e3e39f41137b30afa046364c7674984ba630ee Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 18 Nov 2026 00:14:04 +0000 Subject: [PATCH] ci: migrate 6 workflows (with per-leg overrides) to needs.setup.outputs.matrix aplr, biom-format, boost-histogram, coreforecast, correctionlib and dimod each hardcoded their own python/libc matrix array plus an extra include: block layering a per-leg override (test_skip/test_requires) on top, the same stale-matrix bug class fixed in #4914/#4915 but compounded by that second override axis. Switch build_wheels in each file to matrix: { include: ${{ fromJSON(needs.setup.outputs.matrix) }} }, rename every remaining ${{ matrix.libc }}/hardcoded 'manylinux_riscv64' to ${{ matrix.platform }}, and convert each override into an inline ternary at its point of use (CIBW_TEST_SKIP/CIBW_TEST_REQUIRES), keyed on matrix.python exactly as the old include: block was. --- .github/workflows/build-aplr.yml | 16 ++++------- .github/workflows/build-biom-format.yml | 20 ++++++------- .github/workflows/build-boost-histogram.yml | 31 ++++++++++----------- .github/workflows/build-coreforecast.yml | 20 ++++++------- .github/workflows/build-correctionlib.yml | 29 ++++++++++--------- .github/workflows/build-dimod.yml | 24 ++++++++-------- 6 files changed, 63 insertions(+), 77 deletions(-) diff --git a/.github/workflows/build-aplr.yml b/.github/workflows/build-aplr.yml index 4695a99e176..79aa110669e 100644 --- a/.github/workflows/build-aplr.yml +++ b/.github/workflows/build-aplr.yml @@ -47,17 +47,12 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build aplr ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build aplr ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312", "cp313", "cp314", "cp314t"] - include: - # aplr imports pandas at module level; pypi.riseproject.dev has no cp314t pandas yet. - - python: "cp314t" - test_skip: "*" + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: APLR_VERSION: ${{ matrix.version }} @@ -77,13 +72,14 @@ jobs: - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 + only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,pandas,scipy,scikit-learn - CIBW_TEST_SKIP: ${{ matrix.test_skip }} + # aplr imports pandas at module level; pypi.riseproject.dev has no cp314t pandas yet. + CIBW_TEST_SKIP: ${{ matrix.python == 'cp314t' && '*' || '' }} # Upstream's `pip install scikit-learn || true` would silently skip the sklearn tests. CIBW_TEST_REQUIRES: pytest scikit-learn CIBW_TEST_SOURCES: "tests" @@ -104,7 +100,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: aplr-${{ env.APLR_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: aplr-${{ env.APLR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-biom-format.yml b/.github/workflows/build-biom-format.yml index ff7480523c2..38ab8c9e5ff 100644 --- a/.github/workflows/build-biom-format.yml +++ b/.github/workflows/build-biom-format.yml @@ -47,20 +47,13 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build biom-format ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build biom-format ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312", "cp313", "cp314", "cp314t"] - include: - # pandas (a hard runtime requirement) publishes no cp314t wheel on - # any platform or index, so the wheel itself builds fine but can't - # be installed for testing under cp314t; skip only the test phase. - - python: "cp314t" - test_skip: "*" + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: BIOM_FORMAT_VERSION: ${{ matrix.version }} @@ -87,7 +80,7 @@ jobs: uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 + only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} # numpy/scipy/pandas/h5py are build/runtime deps we ship on the @@ -98,11 +91,14 @@ jobs: CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy,pandas,h5py - CIBW_TEST_SKIP: ${{ matrix.test_skip }} + # pandas (a hard runtime requirement) publishes no cp314t wheel on + # any platform or index, so the wheel itself builds fine but can't + # be installed for testing under cp314t; skip only the test phase. + CIBW_TEST_SKIP: ${{ matrix.python == 'cp314t' && '*' || '' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: biom-format-${{ env.BIOM_FORMAT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: biom-format-${{ env.BIOM_FORMAT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-boost-histogram.yml b/.github/workflows/build-boost-histogram.yml index ef9b650052a..14c12ebcdc1 100644 --- a/.github/workflows/build-boost-histogram.yml +++ b/.github/workflows/build-boost-histogram.yml @@ -98,24 +98,14 @@ jobs: build_wheels: needs: [setup, build_sdist] if: needs.setup.outputs.versions != '[]' - name: Build boost-histogram ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build boost-histogram ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 runs-on: ubuntu-24.04-riscv permissions: contents: read strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312", "cp313", "cp314", "cp314t"] - include: - # hypothesis (a test dependency) ships no riscv64 wheel for PyPI's - # newest release on the free-threaded ABI; our own registry's older - # build does. Widening UV_ONLY_BINARY doesn't help - uv's resolver - # still picks the newest version first and tries to build its sdist - # (which needs a Rust toolchain riscv64 lacks) rather than falling - # back to a version with a usable wheel, so pin the version instead. - - python: "cp314t" - test_requires: "hypothesis==6.165.10" + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: BOOST_HISTOGRAM_VERSION: ${{ matrix.version }} @@ -135,11 +125,14 @@ jobs: with: package-dir: ${{ steps.sdist_path.outputs.path }} env: - CIBW_BUILD: ${{ matrix.python }}-* + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 CIBW_ARCHS: riscv64 # numpy (a hard runtime dependency) ships no musllinux riscv64 wheel # anywhere, so musllinux is dropped (workflow-anatomy.md: an accepted - # outcome). + # outcome). docs/packages/boost-histogram.yaml still has pending + # musllinux entries (CLAUDE.md gotcha-index: platform exclusion has + # no --python-exclude equivalent), so those matrix legs still get + # scheduled; this CIBW_SKIP then leaves them with nothing to build. CIBW_SKIP: '*-musllinux_*' CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} # CIBW_ENVIRONMENT replaces, rather than merges into, upstream's own @@ -155,11 +148,17 @@ jobs: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match - CIBW_TEST_REQUIRES: ${{ matrix.test_requires }} + # hypothesis (a test dependency) ships no riscv64 wheel for PyPI's + # newest release on the free-threaded ABI; our own registry's older + # build does. Widening UV_ONLY_BINARY doesn't help - uv's resolver + # still picks the newest version first and tries to build its sdist + # (which needs a Rust toolchain riscv64 lacks) rather than falling + # back to a version with a usable wheel, so pin the version instead. + CIBW_TEST_REQUIRES: ${{ matrix.python == 'cp314t' && 'hypothesis==6.165.10' || '' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: boost-histogram-${{ env.BOOST_HISTOGRAM_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: boost-histogram-${{ env.BOOST_HISTOGRAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: ./wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-coreforecast.yml b/.github/workflows/build-coreforecast.yml index dc892c71ddd..7eaa064c9af 100644 --- a/.github/workflows/build-coreforecast.yml +++ b/.github/workflows/build-coreforecast.yml @@ -47,7 +47,7 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build coreforecast ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build coreforecast ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 runs-on: ubuntu-24.04-riscv # 60m was too tight: the pybind11/Eigen build runs anywhere from ~50m to # over 60m depending on runner load, so this job was intermittently @@ -57,15 +57,8 @@ jobs: strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.setup.outputs.versions) }} # pybind11 links the version-specific ABI, no abi3 build. - python: ["cp312", "cp313", "cp314", "cp314t"] - include: - # pandas is a hard, unguarded test dependency in most test modules; - # pypi.riseproject.dev has no riscv64 cp314t pandas wheel yet (PyPI - # itself does), so the tests can't collect there. Build still runs. - - python: "cp314t" - test_skip: "*" + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: COREFORECAST_VERSION: ${{ matrix.version }} @@ -91,7 +84,7 @@ jobs: - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 + only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: >- @@ -105,7 +98,10 @@ jobs: CIBW_TEST_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,pandas - CIBW_TEST_SKIP: ${{ matrix.test_skip }} + # pandas is a hard, unguarded test dependency in most test modules; + # pypi.riseproject.dev has no riscv64 cp314t pandas wheel yet (PyPI + # itself does), so the tests can't collect there. Build still runs. + CIBW_TEST_SKIP: ${{ matrix.python == 'cp314t' && '*' || '' }} CIBW_TEST_REQUIRES: pandas pytest CIBW_TEST_COMMAND: python -m pytest {project}/tests -k "not efficiency" @@ -124,7 +120,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: coreforecast-${{ env.COREFORECAST_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: coreforecast-${{ env.COREFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-correctionlib.yml b/.github/workflows/build-correctionlib.yml index 0861b56b13a..073edc071ec 100644 --- a/.github/workflows/build-correctionlib.yml +++ b/.github/workflows/build-correctionlib.yml @@ -98,23 +98,14 @@ jobs: build_wheels: needs: [setup, build_sdist] if: needs.setup.outputs.versions != '[]' - name: Build correctionlib ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build correctionlib ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 runs-on: ubuntu-24.04-riscv permissions: contents: read strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.setup.outputs.versions) }} - python: ["cp312", "cp313", "cp314", "cp314t"] - include: - # pydantic (a hard runtime dependency) needs pandas+scipy's peer - # pydantic-core, which does publish a riscv64 cp314t wheel on PyPI - - # but pandas and scipy themselves (hard `test` dependency-group - # entries) publish no cp314t wheel for any platform yet, so the test - # env can't be installed. Build the wheel, skip only its tests. - - python: "cp314t" - test_skip: "*" + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: CORRECTIONLIB_VERSION: ${{ matrix.version }} @@ -134,17 +125,25 @@ jobs: with: package-dir: ${{ steps.sdist_path.outputs.path }} env: - CIBW_BUILD: ${{ matrix.python }}-* + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 CIBW_ARCHS: riscv64 # numpy (a hard runtime dependency) ships no musllinux riscv64 wheel # anywhere, so musllinux is dropped (workflow-anatomy.md: an accepted - # outcome). + # outcome). docs/packages/correctionlib.yaml still has pending + # musllinux entries (CLAUDE.md gotcha-index: platform exclusion has + # no --python-exclude equivalent), so those matrix legs still get + # scheduled; this CIBW_SKIP then leaves them with nothing to build. CIBW_SKIP: '*-musllinux_*' CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=:all: - CIBW_TEST_SKIP: ${{ matrix.test_skip }} + # pydantic (a hard runtime dependency) needs pandas+scipy's peer + # pydantic-core, which does publish a riscv64 cp314t wheel on PyPI - + # but pandas and scipy themselves (hard `test` dependency-group + # entries) publish no cp314t wheel for any platform yet, so the test + # env can't be installed. Build the wheel, skip only its tests. + CIBW_TEST_SKIP: ${{ matrix.python == 'cp314t' && '*' || '' }} # CIBW_TEST_REQUIRES adds to, not replaces, the pyproject `test-groups` # dependency group, so it has to be cleared here (empty string wins # over the inherited value, same as CIBW_BEFORE_BUILD: ''). @@ -177,7 +176,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: correctionlib-${{ env.CORRECTIONLIB_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: correctionlib-${{ env.CORRECTIONLIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: ./wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-dimod.yml b/.github/workflows/build-dimod.yml index a8a2cd16938..0310788b8b1 100644 --- a/.github/workflows/build-dimod.yml +++ b/.github/workflows/build-dimod.yml @@ -113,22 +113,18 @@ jobs: build_wheels: needs: [setup, build_sdist] if: needs.setup.outputs.versions != '[]' - name: Build dimod ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build dimod ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 runs-on: ubuntu-24.04-riscv permissions: contents: read strategy: fail-fast: false matrix: - version: ${{ fromJSON(needs.setup.outputs.versions) }} # From 0.12.23 upstream builds one cp312-abi3 wheel for CPython 3.12+ (the - # `cp31[!01]-*` override in pyproject.toml), so cp313/cp314 would only - # produce the same file name again; the free-threaded build stays separate. - python: ["cp312", "cp314t"] - include: - # pandas, a tests/requirements.txt dependency, has no riscv64 cp314t wheel yet. - - python: "cp314t" - test_skip: "*" + # `cp31[!01]-*` override in pyproject.toml); needs.setup.outputs.matrix + # already collapses cp313/cp314 onto that same cp312-abi3 leg, and keeps + # the free-threaded build separate. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: DIMOD_VERSION: ${{ matrix.version }} @@ -148,10 +144,13 @@ jobs: with: package-dir: ${{ steps.sdist_path.outputs.path }} env: - CIBW_BUILD: ${{ matrix.python }}-* + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 CIBW_ARCHS: riscv64 # Upstream itself skips musllinux (`skip = "pp* *musllinux*"` in pyproject.toml); # CIBW_BUILD overrides that config wholesale, so repeat the musllinux skip here. + # docs/packages/dimod.yaml never declares a musllinux entry, so + # needs.setup.outputs.matrix never emits a musllinux leg either; this + # stays purely as defense in depth. CIBW_SKIP: '*-musllinux_*' CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: >- @@ -162,7 +161,8 @@ jobs: UV_PREFER_BINARY=1 UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match - CIBW_TEST_SKIP: ${{ matrix.test_skip }} + # pandas, a tests/requirements.txt dependency, has no riscv64 cp314t wheel yet. + CIBW_TEST_SKIP: ${{ matrix.python == 'cp314t' && '*' || '' }} - name: Check the Cython extensions made it into the wheel run: | @@ -184,7 +184,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: dimod-${{ env.DIMOD_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: dimod-${{ env.DIMOD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: ./wheelhouse/*.whl if-no-files-found: error