From 9fcaedfddb176a9972d1e67d7a86d8856831834f Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Wed, 13 May 2026 15:19:04 +0900 Subject: [PATCH 01/10] Remove Python 3.10 jobs; add pip upgrade (best practices); minor refactoring --- .github/workflows/test.yml | 67 ++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14185e3..15f94cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,60 +6,74 @@ jobs: cases: name: ${{ matrix.os }}, python${{ matrix.python-version }}, ${{ matrix.case-name }} runs-on: ${{ matrix.os }} + strategy: matrix: include: - - case-name: ubuntu-python3.10 - os: ubuntu-latest - qutip-version: "@master" - python-version: "3.10" - - case-name: macOs-python3.10 - os: macOS-latest - qutip-version: "@master" - python-version: "3.10" - - case-name: windows-python3.10 - os: windows-latest - qutip-version: "@master" - python-version: "3.10" - case-name: ubuntu-python3.11 os: ubuntu-latest qutip-version: "@master" python-version: "3.11" + - case-name: macOs-python3.11 os: macOS-latest qutip-version: "@master" python-version: "3.11" + - case-name: windows-python3.11 os: windows-latest qutip-version: "@master" python-version: "3.11" + - case-name: ubuntu-python3.12 os: ubuntu-latest qutip-version: "@master" python-version: "3.12" + - case-name: macOs-python3.12 os: macOS-latest qutip-version: "@master" python-version: "3.12" + - case-name: windows-python3.12 os: windows-latest qutip-version: "@master" python-version: "3.12" + - case-name: ubuntu-python3.13 + os: ubuntu-latest + qutip-version: "@master" + python-version: "3.13" + + - case-name: macOs-python3.13 + os: macOS-latest + qutip-version: "@master" + python-version: "3.13" + + - case-name: windows-python3.13 + os: windows-latest + qutip-version: "@master" + python-version: "3.13" + steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + - name: Install QuTiP from GitHub - if: ${{ matrix.qutip-version == '@master'}} + if: ${{ matrix.qutip-version == '@master' }} run: | python -m pip install 'git+https://github.com/qutip/qutip.git${{ matrix.qutip-version }}' - name: Install qutip-qtrl from GitHub - if: ${{ matrix.qutip-version == '@master'}} + if: ${{ matrix.qutip-version == '@master' }} run: | python -m pip install 'git+https://github.com/qutip/qutip-qtrl.git' @@ -68,7 +82,7 @@ jobs: python -m pip install 'jax==0.4.28' 'jaxlib==0.4.28' - name: Install qutip-jax from GitHub - if: ${{ matrix.qutip-version == '@master'}} + if: ${{ matrix.qutip-version == '@master' }} run: | python -m pip install 'git+https://github.com/qutip/qutip-jax.git' @@ -80,28 +94,39 @@ jobs: - name: Test with pytest and generate coverage report run: | pip install pytest-cov coveralls - pytest tests --strict-markers --cov=qutip_qoc --cov-report= --color=yes + pytest tests \ + --strict-markers \ + --cov=qutip_qoc \ + --cov-report= \ + --color=yes - name: Upload to Coveralls env: GITHUB_TOKEN: ${{ secrets.github_token }} COVERALLS_PARALLEL: true - run: coveralls --service=github + run: | + coveralls --service=github doctest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" - - name: Install dependencies + python-version: "3.11" + + - name: Upgrade pip run: | python -m pip install --upgrade pip - python -mpip install -r doc/requirements.txt + + - name: Install dependencies + run: | + python -m pip install -r doc/requirements.txt pip install . + - name: Test code snippets in the documentation run: | cd doc @@ -111,7 +136,9 @@ jobs: name: Finalise coverage reporting needs: [cases] runs-on: ubuntu-latest + container: python:3-slim + steps: - name: Finalise coverage reporting env: From 83314501001612cf474b6e093e3dc16d9a82b12d Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Wed, 13 May 2026 15:24:44 +0900 Subject: [PATCH 02/10] Remove Python 3.13 for now --- .github/workflows/test.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15f94cc..5009a93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,22 +39,6 @@ jobs: os: windows-latest qutip-version: "@master" python-version: "3.12" - - - case-name: ubuntu-python3.13 - os: ubuntu-latest - qutip-version: "@master" - python-version: "3.13" - - - case-name: macOs-python3.13 - os: macOS-latest - qutip-version: "@master" - python-version: "3.13" - - - case-name: windows-python3.13 - os: windows-latest - qutip-version: "@master" - python-version: "3.13" - steps: - uses: actions/checkout@v4 From 47fb28373c80409415f0ef4c4a9e54def4bccac2 Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 15:23:14 +0900 Subject: [PATCH 03/10] Upgrade actions; consistent usage of python -m pip install --- .github/workflows/test.yml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5009a93..ccce4ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,18 +39,15 @@ jobs: os: windows-latest qutip-version: "@master" python-version: "3.12" + steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - name: Install QuTiP from GitHub if: ${{ matrix.qutip-version == '@master' }} run: | @@ -71,25 +68,19 @@ jobs: python -m pip install 'git+https://github.com/qutip/qutip-jax.git' - name: Install qutip-qoc - # Installing in-place so that coveralls can locate the source code. run: | - pip install -e .[full] + python -m pip install -e .[full] - name: Test with pytest and generate coverage report run: | - pip install pytest-cov coveralls - pytest tests \ - --strict-markers \ - --cov=qutip_qoc \ - --cov-report= \ - --color=yes + python -m pip install pytest-cov coveralls + pytest tests --strict-markers --cov=qutip_qoc --cov-report= --color=yes - name: Upload to Coveralls env: GITHUB_TOKEN: ${{ secrets.github_token }} COVERALLS_PARALLEL: true - run: | - coveralls --service=github + run: coveralls --service=github doctest: runs-on: ubuntu-latest @@ -98,18 +89,15 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - name: Install dependencies run: | + python -m pip install --upgrade pip python -m pip install -r doc/requirements.txt - pip install . + python -m pip install . - name: Test code snippets in the documentation run: | @@ -127,6 +115,7 @@ jobs: - name: Finalise coverage reporting env: GITHUB_TOKEN: ${{ secrets.github_token }} + run: | python -m pip install coveralls coveralls --service=github --finish From 0aeee2bd75b65567c5337c127a851a6fa41e0681 Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 15:43:24 +0900 Subject: [PATCH 04/10] Upgrade actions to v6 --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ccce4ea..4c14796 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,10 +41,10 @@ jobs: python-version: "3.12" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -86,10 +86,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" From 238deb74160ebd86544c1f4ea5704be02a498296 Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 15:48:55 +0900 Subject: [PATCH 05/10] Upgrade actions used for building wheels and publishing distribution package; remove Python 3.10 support; force testing workflows for Node 24 compatibility --- .github/workflows/build.yml | 54 +++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 188545d..5152bbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,66 +6,80 @@ on: confirm_ref: description: "Confirm chosen branch name to deploy to PyPI (optional):" default: "" + override_version: description: "Override version number (optional):" default: "" +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: build: name: Build distribution 📦 runs-on: ${{ matrix.os }} + strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] env: - # Set up wheels matrix. This is CPython 3.10--3.14 for all OS targets. - CIBW_BUILD: "cp3{10,11,12,13,14}-*" - # Numpy and SciPy do not supply wheels for i686 or win32 for - # Python 3.10+, so we skip those: + # Build wheels for supported CPython versions. + CIBW_BUILD: "cp3{11,12,13,14}-*" + + # NumPy and SciPy do not supply wheels for these targets. CIBW_SKIP: "*-musllinux* *-manylinux_i686 *-win32" - # Force recent version of manylinux - # manylinux2014 no longer supported by scipy and numpy + + # manylinux2014 no longer supported by scipy/numpy CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.11" + - name: Install cibuildwheel - run: >- - python3 -m - pip install - cibuildwheel - --user - - name: Build a binary wheel and a source tarball - run: python3 -m cibuildwheel --output-dir dist - - name: Store the distribution packages - uses: actions/upload-artifact@v4 + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel + + - name: Build binary wheels and source tarball + run: | + python -m cibuildwheel --output-dir dist + + - name: Store distribution packages + uses: actions/upload-artifact@v5 with: name: python-package-distributions-${{ matrix.os }} path: dist/ publish-to-pypi: name: Publish Python 🐍 distribution 📦 to PyPI + if: ${{ github.event.inputs.confirm_ref != '' && github.event.inputs.confirm_ref != 'test' }} + needs: - build + runs-on: ubuntu-latest + environment: name: pypi url: https://pypi.org/p/qutip-qoc + permissions: id-token: write steps: - - name: Download all the dists - uses: actions/download-artifact@v4 + - name: Download all distributions + uses: actions/download-artifact@v5 with: pattern: python-package-distributions-* path: dist/ merge-multiple: true + - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From 16906c479102a7f11fabcc4d723f34f00ddaf841 Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 15:52:38 +0900 Subject: [PATCH 06/10] Pin cibuildwheel major-version for more reproducible CI and to protect from breaking changes upstream --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5152bbb..3ef1bb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: - name: Install cibuildwheel run: | python -m pip install --upgrade pip - python -m pip install cibuildwheel + python -m pip install "cibuildwheel>=2.20,<3" - name: Build binary wheels and source tarball run: | From 143a37353f222b3e49e0c88376418882bcabcbf3 Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 16:08:13 +0900 Subject: [PATCH 07/10] Upgrade actions; upgrade Python to 3.11; minor correction of python -m pip install usages --- .github/workflows/build_documentation.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index dd1950f..1c8cc77 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v6 name: Install Python with: - python-version: "3.10" + python-version: "3.11" - name: Install Pandoc run: | @@ -22,11 +22,12 @@ jobs: - name: Install documentation dependencies run: | - python -mpip install -r doc/requirements.txt + python -m pip install --upgrade pip + python -m pip install -r doc/requirements.txt - name: Install qutip-qoc from GitHub run: | - python -mpip install -e .[full] + python -m pip install -e .[full] # Install in editable mode so it doesn't matter if we import from # inside the installation directory, otherwise we can get some errors # because we're importing from the wrong location. @@ -42,7 +43,7 @@ jobs: # -T : display a full traceback if a Python exception occurs - name: Upload built files - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: qutip_qoc_html_docs path: doc/_build/html/* From 8b9c9a4b207a54a5daf3812686d310aa6d87a70a Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 16:09:30 +0900 Subject: [PATCH 08/10] Forcing to use Node 24 might not be unnecessary for testing --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ef1bb0..2af9fdb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,6 @@ on: description: "Override version number (optional):" default: "" -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - jobs: build: name: Build distribution 📦 From 8c476087c62fd7a09913c7d2595fcf5bd8ea0b40 Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 16:16:15 +0900 Subject: [PATCH 09/10] Add also minimum required Python in pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b026295..a637a53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,3 +6,6 @@ requires = [ "cython>=0.29.20", ] build-backend = "setuptools.build_meta" + +[project] +requires-python = ">=3.11" From d2ef7e313069b9d3c5dc9ac79168ad31dcc4dadf Mon Sep 17 00:00:00 2001 From: Veronika Kurth Date: Thu, 21 May 2026 16:25:40 +0900 Subject: [PATCH 10/10] Remove minimum version for now --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a637a53..b026295 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,3 @@ requires = [ "cython>=0.29.20", ] build-backend = "setuptools.build_meta" - -[project] -requires-python = ">=3.11"