From 4e38cc955148d4d5d4e18c2cc69a82fa3bf6395b Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 18 Nov 2026 00:10:58 +0000 Subject: [PATCH] build-rebound/munkres/vmprof: migrate to needs.setup.outputs.matrix All three still hard-coded their own python/libc matrix in build_wheels, duplicating docs/packages/.yaml and drifting out of sync with it - the exact bug already fixed once for each of these three in now-closed PRs #4911/#4912/#4913 (stale lists missing cp310/cp311/cp315). Converting to needs.setup.outputs.matrix (the pattern most other build-.yml files already use) fixes the coverage gap structurally instead of by widening a second, independently-maintained list that can drift again. rebound and munkres each layer a per-libc include: override (test environment/requires/command) on top of the hard-coded list; since the generated matrix entries carry no custom fields, rebound's three overrides move into a per-platform GITHUB_ENV heredoc step (verified byte-for-byte against the original values via a local bash simulation, including that the musllinux test-command's $(python -c ...) survives as literal text rather than being expanded early) and munkres's single test_requires override becomes an inline matrix.platform ternary. vmprof had no override to preserve, just a stale python list and a hard-coded 'manylinux' literal. Verified each via 'pending_versions.py --python-matrix' against its own docs/packages/.yaml before and after: vmprof now covers cp310-cp315 (all manylinux, matching the closed #4913), munkres covers cp310-cp314 across both platforms (matching #4912), rebound covers cp310-cp314t across both platforms (matching #4911) - all libc/matrix.libc references renamed to platform/matrix.platform to match the generated matrix's field name throughout. --- .github/workflows/build-munkres.yml | 22 +++----- .github/workflows/build-rebound.yml | 85 ++++++++++++++++------------- .github/workflows/build-vmprof.yml | 12 ++-- 3 files changed, 60 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build-munkres.yml b/.github/workflows/build-munkres.yml index 416c5f2147b..908a7d0fed4 100644 --- a/.github/workflows/build-munkres.yml +++ b/.github/workflows/build-munkres.yml @@ -49,22 +49,15 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build munkres ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + name: Build munkres ${{ 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) }} - # Upstream builds no free-threaded wheel and the extension declares no Py_mod_gil. - python: ["cp312", "cp313", "cp314"] - libc: [manylinux, musllinux] - include: - - libc: manylinux - test_requires: pytest hypothesis numpy scipy - # numpy/scipy have no musllinux riscv64 wheel anywhere; the suite importorskips them. - - libc: musllinux - test_requires: pytest hypothesis + # Upstream builds no free-threaded wheel and the extension declares no Py_mod_gil; + # docs/packages/munkres.yaml declares no `t` targets either. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: MUNKRES_VERSION: ${{ matrix.version }} @@ -88,14 +81,15 @@ jobs: - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: ${{ matrix.test_requires }} + # numpy/scipy have no musllinux riscv64 wheel anywhere; the suite importorskips them. + CIBW_TEST_REQUIRES: ${{ matrix.platform == 'musllinux' && 'pytest hypothesis' || 'pytest hypothesis numpy scipy' }} # pyproject's pytest `pythonpath = ["src"]` puts the checkout's pure-Python # package ahead of the wheel, so stage only the suite and its ini. CIBW_TEST_SOURCES: tests pyproject.toml @@ -105,7 +99,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: munkres-${{ env.MUNKRES_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64 + name: munkres-${{ env.MUNKRES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: ./wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-rebound.yml b/.github/workflows/build-rebound.yml index 17e28f03e12..e191f404fba 100644 --- a/.github/workflows/build-rebound.yml +++ b/.github/workflows/build-rebound.yml @@ -51,45 +51,13 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build rebound ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + name: Build rebound ${{ 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"] - libc: [manylinux, musllinux] - include: - - libc: manylinux - test-environment: PIP_ONLY_BINARY=numpy,matplotlib,contourpy,kiwisolver,pillow - test-requires: pytest multiprocess matplotlib numpy - test-command: >- - python -m unittest discover -v -s rebound.tests && - python {project}/python_examples/dragforce/problem.py && - python {project}/python_examples/megno_simple/problem.py && - python {project}/python_examples/orbital_elements/problem.py && - python {project}/python_examples/outersolarsystem/problem.py && - python {project}/python_examples/simple_orbit/problem.py && - python {project}/python_examples/longtermtest/problem.py && - python {project}/python_examples/megno/problem.py - # No numpy/matplotlib riscv64 musllinux wheels exist, so skip the tests and examples - # that import them. test_megno excluded too: TestMegno.test_chaotic compares the - # MEGNO chaos indicator between the IAS15 and WHFast integrators against a - # delta=0.3 tolerance (already loose, since chaotic systems are inherently - # numerically sensitive) -- it passes on every manylinux leg but overshoots to - # ~0.313 on every musllinux one, consistent with musl's libm giving slightly - # different rounding than glibc's across enough integration steps to matter here. - # unittest's CLI has no single-test deselect, so drop the whole module. - - libc: musllinux - test-environment: '' - test-requires: '' - test-command: >- - python -m unittest -v $(python -c "import pkgutil, rebound.tests as t; print(*('rebound.tests.' + m.name for m in pkgutil.iter_modules(t.__path__) if not m.name.startswith(('test_frequency_analysis', 'test_plotting', 'test_trace', 'test_megno'))))") && - python {project}/python_examples/dragforce/problem.py && - python {project}/python_examples/orbital_elements/problem.py && - python {project}/python_examples/outersolarsystem/problem.py && - python {project}/python_examples/simple_orbit/problem.py + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: REBOUND_VERSION: ${{ matrix.version }} @@ -102,23 +70,62 @@ jobs: ref: ${{ env.REBOUND_VERSION }} persist-credentials: false + # No numpy/matplotlib riscv64 musllinux wheels exist, so skip the tests and examples + # that import them. test_megno excluded too: TestMegno.test_chaotic compares the + # MEGNO chaos indicator between the IAS15 and WHFast integrators against a + # delta=0.3 tolerance (already loose, since chaotic systems are inherently + # numerically sensitive) -- it passes on every manylinux leg but overshoots to + # ~0.313 on every musllinux one, consistent with musl's libm giving slightly + # different rounding than glibc's across enough integration steps to matter here. + # unittest's CLI has no single-test deselect, so drop the whole module. + - name: Select per-platform test configuration + run: | + if [ "${{ matrix.platform }}" = musllinux ]; then + cat >> "$GITHUB_ENV" <<'ENVEOF' + TEST_ENVIRONMENT= + TEST_REQUIRES= + TEST_COMMAND<> "$GITHUB_ENV" <<'ENVEOF' + TEST_ENVIRONMENT=PIP_ONLY_BINARY=numpy,matplotlib,contourpy,kiwisolver,pillow + TEST_REQUIRES=pytest multiprocess matplotlib numpy + TEST_COMMAND<- FFP_CONTRACT_OFF=1 PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: ${{ matrix.test-environment }} - CIBW_TEST_REQUIRES: ${{ matrix.test-requires }} - CIBW_TEST_COMMAND: ${{ matrix.test-command }} + CIBW_TEST_ENVIRONMENT: ${{ env.TEST_ENVIRONMENT }} + CIBW_TEST_REQUIRES: ${{ env.TEST_REQUIRES }} + CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: rebound-${{ env.REBOUND_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64 + name: rebound-${{ env.REBOUND_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: ./wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-vmprof.yml b/.github/workflows/build-vmprof.yml index 6d87e13ed1a..69b87db894e 100644 --- a/.github/workflows/build-vmprof.yml +++ b/.github/workflows/build-vmprof.yml @@ -50,16 +50,16 @@ jobs: build_wheels: needs: [setup] if: needs.setup.outputs.versions != '[]' - name: Build vmprof ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + name: Build vmprof ${{ 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) }} # Upstream's own CIBW_SKIP drops cp3*t-*: vmprof does not support - # free-threaded CPython. - python: ["cp312", "cp313", "cp314"] + # free-threaded CPython. docs/packages/vmprof.yaml declares no `t` + # targets either, so the generated matrix never includes one. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: VMPROF_VERSION: ${{ matrix.version }} @@ -87,7 +87,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 }} # Upstream's before-build is a plain `dnf install -y libunwind-devel`, which @@ -135,7 +135,7 @@ jobs: - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: vmprof-${{ env.VMPROF_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + name: vmprof-${{ env.VMPROF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 path: ./wheelhouse/*.whl if-no-files-found: error