Skip to content

Add json magic methods to the QCVV library to facilitate saving and reloading using cirq #3654

Add json magic methods to the QCVV library to facilitate saving and reloading using cirq

Add json magic methods to the QCVV library to facilitate saving and reloading using cirq #3654

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: superstaq
on:
push:
branches: [main]
paths-ignore:
- "general-superstaq/general_superstaq/_version.py"
pull_request:
branches: [main]
workflow_call: null
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq
- name: Format
run: |
checks/format_.py
lint:
name: Lint check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq -e ./qiskit-superstaq -e ./cirq-superstaq -e ./supermarq-benchmarks
- name: Pylint
run: |
checks/pylint_.py --all
flake8:
name: Flake8 check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq
- name: Flake8
run: |
checks/flake8_.py
mypy:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq[dev] -e ./qiskit-superstaq[dev] -e ./cirq-superstaq[dev] -e ./supermarq-benchmarks[dev]
- name: Type check
run: |
checks/mypy_.py
coverage:
name: Pytest and Coverage check
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq[dev] -e ./qiskit-superstaq[dev] -e ./cirq-superstaq[dev] -e ./supermarq-benchmarks[dev]
- name: Coverage check
run: |
checks/coverage_.py
coverage-standalone:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- type: "general-superstaq"
dependencies: "./general-superstaq[dev]"
- type: "qiskit-superstaq"
dependencies: "./general-superstaq ./qiskit-superstaq[dev]"
- type: "cirq-superstaq"
dependencies: "./general-superstaq ./qiskit-superstaq ./cirq-superstaq[dev]"
- type: "supermarq-benchmarks"
dependencies: "./general-superstaq ./qiskit-superstaq ./cirq-superstaq ./supermarq-benchmarks[dev]"
name: ${{ matrix.type }} standalone coverage check with minimum dependency versions
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies, using minimum supported versions
run: |
min_versions=$(sed ${{ matrix.type }}/requirements.txt ${{ matrix.type }}/dev-requirements.txt -e 's/[~>]=\([0-9]\)/==\1/')
python -m pip install --upgrade pip
pip install ./checks-superstaq ${{ matrix.dependencies }} $min_versions
- name: Coverage check
run: |
checks/coverage_.py ${{ matrix.type }}
pytest-mac:
name: Pytest macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq[dev] -e ./qiskit-superstaq[dev] -e ./cirq-superstaq[dev] -e ./supermarq-benchmarks[dev]
- name: Pytest-mac check
run: |
checks/pytest_.py
pytest-win:
name: Pytest Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq[dev] -e ./qiskit-superstaq[dev] -e ./cirq-superstaq[dev] -e ./supermarq-benchmarks[dev]
- name: Pytest-win check
run: |
checks/pytest_.py
shell: bash
requirements:
name: Requirements check
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq -e ./qiskit-superstaq -e ./cirq-superstaq -e ./supermarq-benchmarks
- name: Requirements check
run: |
checks/requirements.py
notebook:
env:
SUPERSTAQ_API_KEY: ${{ secrets.SUPERSTAQ_API_KEY }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- type: "qiskit-superstaq"
pattern: "'*_qss.ipynb' qiskit-superstaq -x 'docs/source/apps/*'"
dependencies: "-e ./checks-superstaq -e ./general-superstaq -e ./qiskit-superstaq[examples] -e ./cirq-superstaq"
- type: "cirq-superstaq"
pattern: "'*_css.ipynb' cirq-superstaq -x 'docs/source/apps/*'"
dependencies: "-e ./checks-superstaq -e ./general-superstaq -e ./qiskit-superstaq -e ./cirq-superstaq[examples]"
- type: "supermarq"
pattern: "docs/source/apps/supermarq"
dependencies: "-e ./checks-superstaq -e ./general-superstaq -e ./qiskit-superstaq -e ./cirq-superstaq -e ./supermarq-benchmarks"
name: Notebook check for ${{ matrix.type }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ${{ matrix.dependencies }}
- name: Check notebooks
run: |
checks/pytest_.py --notebook ${{ matrix.pattern }} -v
docs:
name: Build docs
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/*requirements.txt', '.github/workflows/ci.yml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ./checks-superstaq -e ./general-superstaq -e ./qiskit-superstaq -e ./cirq-superstaq -e ./supermarq-benchmarks
sudo apt-get install pandoc
- name: Build docs
run: |
checks/build_docs.py