From b44a015698327f338d05bea33bb2da70ea525614 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 14:38:22 +0000 Subject: [PATCH 1/2] qutip: Add version 5.3.1 --- .github/workflows/build-qutip.yml | 110 ++++++++++++++++++++++++++++++ docs/packages/qutip.yaml | 5 ++ 2 files changed, 115 insertions(+) create mode 100644 .github/workflows/build-qutip.yml create mode 100644 docs/packages/qutip.yaml diff --git a/.github/workflows/build-qutip.yml b/.github/workflows/build-qutip.yml new file mode 100644 index 000000000000..47ceda312f8b --- /dev/null +++ b/.github/workflows/build-qutip.yml @@ -0,0 +1,110 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `build_wheels` job of +# https://github.com/qutip/qutip/blob/v5.3.1/.github/workflows/build.yml +# and the test step of +# https://github.com/qutip/qutip/blob/v5.3.1/.github/workflows/tests.yml +name: Build qutip wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/qutip.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-qutip.yml' + - 'docs/packages/qutip.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-qutip.yml' + - 'docs/packages/qutip.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: qutip + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build qutip ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Upstream's CIBW_BUILD `cp3{11,12,13,14}-*` ships no free-threaded wheel. + python: ["cp312", "cp313", "cp314"] + env: + QUTIP_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout qutip ${{ env.QUTIP_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: qutip/qutip + ref: v${{ env.QUTIP_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_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,scipy,matplotlib + CIBW_TEST_ENVIRONMENT: MPLBACKEND=Agg + CIBW_TEST_REQUIRES: >- + pytest pytest-rerunfailures ipython loky!=3.5.0 tqdm mpmath + setuptools cython filelock matplotlib + # Coverage and --fail-slow dropped: the former feeds Coveralls, the latter's 300 s cap is tuned for x86 runners. + CIBW_TEST_COMMAND: >- + python -c "import qutip; qutip.about()" && + python -m pytest -Werror --strict-config --strict-markers + --durations=0 --durations-min=1.0 --verbosity=1 --color=yes + "$(python -c 'import os, qutip; print(os.path.dirname(qutip.__file__))')/tests" + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: qutip-${{ env.QUTIP_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish qutip ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: qutip-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/qutip.yaml b/docs/packages/qutip.yaml new file mode 100644 index 000000000000..2bfef917a4af --- /dev/null +++ b/docs/packages/qutip.yaml @@ -0,0 +1,5 @@ +package-name: qutip +source-code: https://github.com/qutip/qutip +license: BSD-3-Clause +versions: +- version: 5.3.1 From 69beabfb894046d0eb35a175a1aa615550c04236 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 30 Sep 2026 20:33:27 +0000 Subject: [PATCH 2/2] qutip: Bound hung tests with pytest-timeout The cp313 test run stopped producing output at 54% twice, on different runners, while cp312 and cp314 passed. A per-test thread-method timeout dumps every thread's stack and exits, so the next run names the hung test instead of idling until the job timeout. --- .github/workflows/build-qutip.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-qutip.yml b/.github/workflows/build-qutip.yml index 47ceda312f8b..52855a985e6c 100644 --- a/.github/workflows/build-qutip.yml +++ b/.github/workflows/build-qutip.yml @@ -75,14 +75,16 @@ jobs: CIBW_ENVIRONMENT: >- PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy,matplotlib - CIBW_TEST_ENVIRONMENT: MPLBACKEND=Agg + CIBW_TEST_ENVIRONMENT: MPLBACKEND=Agg PYTHONUNBUFFERED=1 CIBW_TEST_REQUIRES: >- - pytest pytest-rerunfailures ipython loky!=3.5.0 tqdm mpmath + pytest pytest-rerunfailures pytest-timeout ipython loky!=3.5.0 tqdm mpmath setuptools cython filelock matplotlib # Coverage and --fail-slow dropped: the former feeds Coveralls, the latter's 300 s cap is tuned for x86 runners. + # cp313 hung silently at 54% twice; the thread-method timeout dumps every stack and exits (gotcha 565). CIBW_TEST_COMMAND: >- python -c "import qutip; qutip.about()" && python -m pytest -Werror --strict-config --strict-markers + --timeout=900 --timeout-method=thread --durations=0 --durations-min=1.0 --verbosity=1 --color=yes "$(python -c 'import os, qutip; print(os.path.dirname(qutip.__file__))')/tests"