Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lock file #141

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 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
78 changes: 48 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
Expand All @@ -29,14 +29,32 @@ jobs:
- name: Run tests
run: tox

test_requirements_lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install tox-gh-actions==2.12.0
- name: Regenerate requirements.txt
run: tox -e pip-compile
- name: Check if requirements.txt is up-to-date
run: git diff --exit-code HEAD requirements.txt

shabeebk marked this conversation as resolved.
Show resolved Hide resolved
test_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -46,30 +64,30 @@ jobs:
run: tox -e docs

run_resonance_integration_test:
needs: [test]
if: |
success() && (
github.event_name == 'schedule' ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
)
runs-on: ${{ matrix.platform }}
environment: resonance-test # Keep the environment for secure secret management
strategy:
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ '3.9', '3.10', '3.11' ]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install tox-gh-actions==2.12.0
- name: Run Resonance example integration test
run: tox -e test_resonance_example
env:
RESONANCE_API_KEY: ${{ secrets.RESONANCE_API_KEY }}
needs: [test]
if: |
success() && (
github.event_name == 'schedule' ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
)
runs-on: ${{ matrix.platform }}
environment: resonance-test # Keep the environment for secure secret management
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install tox-gh-actions==2.12.0
- name: Run Resonance example integration test
run: tox -e test_resonance_example
env:
RESONANCE_API_KEY: ${{ secrets.RESONANCE_API_KEY }}
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
shabeebk marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: local
hooks:
- id: format
name: format
entry: tox -e format
language: system
files: \.py$
pass_filenames: false

- repo: local
hooks:
- id: pip-compile
name: pip-compile
entry: tox -e pip-compile
language: system
files: ^pyproject\.toml$
pass_filenames: false
9 changes: 8 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ and install it in editable mode with all the extras:
$ git clone git@github.com:iqm-finland/qiskit-on-iqm.git
$ cd qiskit-on-iqm
$ pip install -e ".[dev,docs,testing]"
$ pre-commit install


To be able to build the docs `graphviz <https://graphviz.org/>`_ has to be installed.
To be able to build the docs `graphviz <https://graphviz.org/>`_ has to be installed.
Then to build and view the docs run:

.. code-block:: bash
Expand All @@ -30,6 +31,12 @@ Format your code:

$ tox -e format

Update the requirements:

.. code-block:: bash

$ tox -e pip-compile

Run the tests:

.. code-block:: bash
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ changelog = "https://github.com/iqm-finland/qiskit-on-iqm/blob/main/CHANGELOG.rs
# Add here additional requirements for extra features, to install with:
# `pip install qiskit-iqm[dev,docs,testing]
dev = [
"tox == 4.11.4"
"tox == 4.11.4",
"pre_commit == 4.0.1",
"pip-tools == 7.4.1"
]
docs = [
"sphinx == 7.2.6",
Expand Down
Loading
Loading