Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 31 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
confirm_ref:
description: "Confirm chosen branch name to deploy to PyPI (optional):"
default: ""

override_version:
description: "Override version number (optional):"
default: ""
Expand All @@ -14,58 +15,68 @@ 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>=2.20,<3"

- 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
13 changes: 7 additions & 6 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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.
Expand All @@ -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/*
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,55 @@ 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"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- 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'

Expand All @@ -68,18 +63,17 @@ 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'

- 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
python -m pip install pytest-cov coveralls
pytest tests --strict-markers --cov=qutip_qoc --cov-report= --color=yes

- name: Upload to Coveralls
Expand All @@ -92,16 +86,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -mpip install -r doc/requirements.txt
pip install .
python -m pip install -r doc/requirements.txt
python -m pip install .

- name: Test code snippets in the documentation
run: |
cd doc
Expand All @@ -111,11 +108,14 @@ jobs:
name: Finalise coverage reporting
needs: [cases]
runs-on: ubuntu-latest

container: python:3-slim

steps:
- name: Finalise coverage reporting
env:
GITHUB_TOKEN: ${{ secrets.github_token }}

run: |
python -m pip install coveralls
coveralls --service=github --finish
Loading