From 15b834b875ff826b7425b50343c85b8b0a8d0ca5 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Mon, 25 Sep 2023 14:12:15 +0100 Subject: [PATCH 01/18] Move tests one level up. --- tests/qadence/{test_measurements => }/test_shadows.py | 0 tests/qadence/{test_measurements => }/test_tomography.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/qadence/{test_measurements => }/test_shadows.py (100%) rename tests/qadence/{test_measurements => }/test_tomography.py (100%) diff --git a/tests/qadence/test_measurements/test_shadows.py b/tests/qadence/test_shadows.py similarity index 100% rename from tests/qadence/test_measurements/test_shadows.py rename to tests/qadence/test_shadows.py diff --git a/tests/qadence/test_measurements/test_tomography.py b/tests/qadence/test_tomography.py similarity index 100% rename from tests/qadence/test_measurements/test_tomography.py rename to tests/qadence/test_tomography.py From 45487c12a0059db83e4ecff18d6b14db0ebfbcf2 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 13:27:24 +0100 Subject: [PATCH 02/18] Test fast on push/PR and all on schedule. --- .github/workflows/test_all.yml | 28 +++++++++++++++++++ .github/workflows/{test.yml => test_fast.yml} | 11 ++------ 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/test_all.yml rename .github/workflows/{test.yml => test_fast.yml} (78%) diff --git a/.github/workflows/test_all.yml b/.github/workflows/test_all.yml new file mode 100644 index 00000000..8feec921 --- /dev/null +++ b/.github/workflows/test_all.yml @@ -0,0 +1,28 @@ +name: Run all Qadence tests on schedule. + +on: + schedule: + # 03:00 every Saturday morning + - cron: '0 3 * * 6' + workflow_dispatch: {} + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test_qadence_ubuntu: + name: Test Qadence (ubuntu) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Select Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install Hatch + run: | + pip install hatch + - name: Run tests + run: | + hatch -v run test diff --git a/.github/workflows/test.yml b/.github/workflows/test_fast.yml similarity index 78% rename from .github/workflows/test.yml rename to .github/workflows/test_fast.yml index 6c73590b..ba2763b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test_fast.yml @@ -1,16 +1,9 @@ -name: Test Qadence. +name: Run Qadence fast tests. -on: +on: [push] pull_request: branches: - main - - develop - push: - branches: - - develop - schedule: - # 03:00 every Saturday morning - - cron: '0 3 * * 6' workflow_dispatch: {} concurrency: From 7683ef2e8b25bf62458bfcc87122f63fdd81c75a Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 15:10:29 +0100 Subject: [PATCH 03/18] Fix yaml syntax. --- .github/workflows/test_fast.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml index ba2763b5..60d87dad 100644 --- a/.github/workflows/test_fast.yml +++ b/.github/workflows/test_fast.yml @@ -1,6 +1,7 @@ name: Run Qadence fast tests. -on: [push] +on: + push pull_request: branches: - main From 2ae7c645fbd92b1bd3d8938fe33ccd790cce1d09 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 15:13:52 +0100 Subject: [PATCH 04/18] Correct syntax. --- .github/workflows/test_fast.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml index 60d87dad..367aeb9e 100644 --- a/.github/workflows/test_fast.yml +++ b/.github/workflows/test_fast.yml @@ -1,7 +1,7 @@ name: Run Qadence fast tests. on: - push + push: pull_request: branches: - main From 7629040e7c4c640f61abb036b05b0ef76b9a6ec4 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 15:16:44 +0100 Subject: [PATCH 05/18] Avoid job duplication. --- .github/workflows/test_fast.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml index 367aeb9e..8f4be0e2 100644 --- a/.github/workflows/test_fast.yml +++ b/.github/workflows/test_fast.yml @@ -2,6 +2,8 @@ name: Run Qadence fast tests. on: push: + branches: + - main pull_request: branches: - main From 179470092973c971659bb2164d4f22993405b460 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 15:57:30 +0100 Subject: [PATCH 06/18] Add coverage action. --- .coveragerc | 3 +++ .github/workflows/test_fast.yml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..338b363f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[run] +omit = + setup.py \ No newline at end of file diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml index 8f4be0e2..3d6a9157 100644 --- a/.github/workflows/test_fast.yml +++ b/.github/workflows/test_fast.yml @@ -26,6 +26,8 @@ jobs: - name: Install Hatch run: | pip install hatch - - name: Run tests + - name: Run fast tests run: | hatch -v run test -m "not slow" + - name: Publish coverage + uses: codecov/codecov-action@v3 From 03a547777bc9ac3ce2f9a69066bc5c4e88abf493 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 15:59:54 +0100 Subject: [PATCH 07/18] Fix lint warnings. --- .coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 338b363f..38803458 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,3 @@ [run] omit = - setup.py \ No newline at end of file + setup.py From 9ab5f1c104cb343a19f4468f03c8566da4d86f01 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 16:44:46 +0100 Subject: [PATCH 08/18] Add badge to README. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index b32a1be6..9b71e06c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,15 @@ Qadence is a Python package that provides a simple interface to build _**digital-analog quantum programs**_ with tunable interaction defined on _**arbitrary qubit register layouts**_. + +[![Run Qadence fast tests.](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml) + + + + + + + ## Feature highlights * A [block-based system](tutorials/getting_started.md) for composing _**complex digital-analog From 18b78eb4a302a72fef9cd407129af2205a1712dc Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 16:55:44 +0100 Subject: [PATCH 09/18] Add title and badges. --- README.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9b71e06c..34a99e39 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,12 @@

noheading

-!!! warning "Large Logo" - Put a large verion of the logo herec. +# Qadence Qadence is a Python package that provides a simple interface to build _**digital-analog quantum programs**_ with tunable interaction defined on _**arbitrary qubit register layouts**_. - -[![Run Qadence fast tests.](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml) - - - - - - +[![pre-commit](https://github.com/pasqal-io/qadence/actions/workflows/lint.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/lint.yml) +[![test](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml) ## Feature highlights From 5cdda09d9171db0e9d0527fec71a660bef8ba936 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 17:45:11 +0100 Subject: [PATCH 10/18] Don't use codecov action (yet). --- .github/workflows/test_fast.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_fast.yml b/.github/workflows/test_fast.yml index 3d6a9157..5eb5bcea 100644 --- a/.github/workflows/test_fast.yml +++ b/.github/workflows/test_fast.yml @@ -29,5 +29,3 @@ jobs: - name: Run fast tests run: | hatch -v run test -m "not slow" - - name: Publish coverage - uses: codecov/codecov-action@v3 From c3948afd51a85db71dd0a9341a3bd1bc2207336e Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 17:45:36 +0100 Subject: [PATCH 11/18] Better naming. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34a99e39..09df4af6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Qadence is a Python package that provides a simple interface to build _**digital programs**_ with tunable interaction defined on _**arbitrary qubit register layouts**_. [![pre-commit](https://github.com/pasqal-io/qadence/actions/workflows/lint.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/lint.yml) -[![test](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml) +[![tests](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml/badge.svg)](https://github.com/pasqal-io/qadence/actions/workflows/test_fast.yml) ## Feature highlights From 38241dc6ad0b4999341ea85c4f22ad293bfbfd1e Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 17:45:50 +0100 Subject: [PATCH 12/18] Report as an xml file. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c45aa47e..517907f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ dependencies = [ features = ["all"] [tool.hatch.envs.default.scripts] -test = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=qadence --cov=tests --ignore=./tests/test_examples.py --ignore=./tests/test_notebooks.py {args}" +test = "pytest --cov-report=xml --cov-config=pyproject.toml --cov=qadence --cov=tests --ignore=./tests/test_examples.py --ignore=./tests/test_notebooks.py {args}" test-examples = "pytest ./tests/test_examples.py {args}" test-notebooks = "pytest ./tests/test_notebooks.py {args}" no-cov = "cov --no-cov {args}" From 17edd2fe6aa0a792a63e2638dd137b3385ed9703 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 17:52:32 +0100 Subject: [PATCH 13/18] Add action to test examples. --- .github/workflows/test_examples.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/test_examples.yml diff --git a/.github/workflows/test_examples.yml b/.github/workflows/test_examples.yml new file mode 100644 index 00000000..45f57d8c --- /dev/null +++ b/.github/workflows/test_examples.yml @@ -0,0 +1,33 @@ +name: Run Qadence example tests. + +on: + push: + branches: + - main + pull_request: + branches: + - main + paths: + - examples + workflow_dispatch: {} + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test_qadence_ubuntu: + name: Test Qadence (ubuntu) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Select Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install Hatch + run: | + pip install hatch + - name: Run fast tests + run: | + hatch -v run test-examples From c11db3d9af3cd270112a942a7da884e64126b913 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 17:57:06 +0100 Subject: [PATCH 14/18] Exclude notebooks from testing the examples. --- .github/workflows/test_examples.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_examples.yml b/.github/workflows/test_examples.yml index 45f57d8c..bd12b1f8 100644 --- a/.github/workflows/test_examples.yml +++ b/.github/workflows/test_examples.yml @@ -9,6 +9,8 @@ on: - main paths: - examples + paths-ignore: + - examples/notebooks workflow_dispatch: {} concurrency: From 380ddef0c349575667f55e2b35e6b9a5fcb5363a Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 17:59:18 +0100 Subject: [PATCH 15/18] Add action to test notebooks. --- .github/workflows/test_notebooks.yml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/test_notebooks.yml diff --git a/.github/workflows/test_notebooks.yml b/.github/workflows/test_notebooks.yml new file mode 100644 index 00000000..e94063cb --- /dev/null +++ b/.github/workflows/test_notebooks.yml @@ -0,0 +1,33 @@ +name: Run Qadence notebooks tests. + +on: + push: + branches: + - main + pull_request: + branches: + - main + paths: + - examples/notebooks + workflow_dispatch: {} + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test_qadence_ubuntu: + name: Test Qadence (ubuntu) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Select Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install Hatch + run: | + pip install hatch + - name: Run fast tests + run: | + hatch -v run test-notebooks From 4d1c2813e1f46d5c2bbc0c163d2aad3fc38f1287 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 18:03:58 +0100 Subject: [PATCH 16/18] Add action to test the docs. --- .github/workflows/test_docs.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/test_docs.yml diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml new file mode 100644 index 00000000..d131ade9 --- /dev/null +++ b/.github/workflows/test_docs.yml @@ -0,0 +1,33 @@ +name: Run Qadence docs tests. + +on: + push: + branches: + - main + pull_request: + branches: + - main + paths: + - docs + workflow_dispatch: {} + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test_qadence_ubuntu: + name: Test Qadence (ubuntu) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Select Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install Hatch + run: | + pip install hatch + - name: Run doc tests + run: | + hatch -e docs run test-docs From d33c57e65a083566679997d0e02a76c94b66c239 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 18:04:14 +0100 Subject: [PATCH 17/18] Better naming. --- .github/workflows/test_examples.yml | 2 +- .github/workflows/test_notebooks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_examples.yml b/.github/workflows/test_examples.yml index bd12b1f8..cdb4eae7 100644 --- a/.github/workflows/test_examples.yml +++ b/.github/workflows/test_examples.yml @@ -30,6 +30,6 @@ jobs: - name: Install Hatch run: | pip install hatch - - name: Run fast tests + - name: Run example tests run: | hatch -v run test-examples diff --git a/.github/workflows/test_notebooks.yml b/.github/workflows/test_notebooks.yml index e94063cb..a7b11190 100644 --- a/.github/workflows/test_notebooks.yml +++ b/.github/workflows/test_notebooks.yml @@ -28,6 +28,6 @@ jobs: - name: Install Hatch run: | pip install hatch - - name: Run fast tests + - name: Run notebooks tests run: | hatch -v run test-notebooks From 103b1662b0a33d1273fc2dff8edb2c145c7e7850 Mon Sep 17 00:00:00 2001 From: Roland Guichard Date: Tue, 26 Sep 2023 18:52:53 +0100 Subject: [PATCH 18/18] Add dependabot. --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ac1560a2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly"