From 2a32d3eeae4a2afef624871d86111eea4d6d6330 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 10:28:37 -0400 Subject: [PATCH 01/10] Updated lark-parser to lark --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 935ba74ad..005681ffd 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ packages=find_packages(exclude=['examples*', 'test*']), install_requires=[ 'bqskitrs>=0.4.1', - 'lark-parser', + 'lark', 'numpy>=1.22.0', 'scipy>=1.8.0', 'typing-extensions>=4.0.0', From 3a76222652efe4c47ee5635eb57f127aee4d4489 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 11:39:39 -0400 Subject: [PATCH 02/10] Skip slow tests on PR --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a948ae5d..aa486561a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,9 @@ jobs: - name: Install BQSKit env: SYSTEM_VERSION_COMPAT: 0 - NUMBER_RANDOM_CIRCUITS: 100 run: pip install . + - name: Run tests - run: pytest + env: + NUMBER_RANDOM_CIRCUITS: 100 + run: pytest --ignore=tests/compiler/compile --ignore=tests/passes/partitioning/test_parts.py From 35690ed7b034fb481ad40ef44e88e8b519260176 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 11:43:26 -0400 Subject: [PATCH 03/10] Remove optional test dependencies --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa486561a..8f112953f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,11 +24,7 @@ jobs: run: python -m pip install --upgrade virtualenv setuptools pip - name: Upgrade test dependencies - run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' - - - name: Upgrade optional test dependencies - if: matrix.python-version != '3.12' - run: python -m pip install qiskit + run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' qiskit - name: Install BQSKit env: From 31ec6b52f0e86e155975870b97f4d6a6d235fcab Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 12:30:55 -0400 Subject: [PATCH 04/10] Removed deprecated rebase pass --- bqskit/passes/processing/__init__.py | 2 -- bqskit/passes/processing/rebase.py | 13 ------------- 2 files changed, 15 deletions(-) delete mode 100644 bqskit/passes/processing/rebase.py diff --git a/bqskit/passes/processing/__init__.py b/bqskit/passes/processing/__init__.py index 00136b54f..e54966b93 100644 --- a/bqskit/passes/processing/__init__.py +++ b/bqskit/passes/processing/__init__.py @@ -3,7 +3,6 @@ from bqskit.passes.processing.exhaustive import ExhaustiveGateRemovalPass from bqskit.passes.processing.iterative import IterativeScanningGateRemovalPass -from bqskit.passes.processing.rebase import Rebase2QuditGatePass # TODO: Remove from bqskit.passes.processing.scan import ScanningGateRemovalPass from bqskit.passes.processing.substitute import SubstitutePass @@ -12,5 +11,4 @@ 'IterativeScanningGateRemovalPass', 'ScanningGateRemovalPass', 'SubstitutePass', - 'Rebase2QuditGatePass', ] diff --git a/bqskit/passes/processing/rebase.py b/bqskit/passes/processing/rebase.py deleted file mode 100644 index ecbb5dde9..000000000 --- a/bqskit/passes/processing/rebase.py +++ /dev/null @@ -1,13 +0,0 @@ -"""This module implements the Rebase2QuditGatePass (Deprecated Location).""" -from __future__ import annotations - -import warnings - -warnings.warn( - 'The Rebase2QuditGatePass has moved to bqskit.passes.retarget.two.' - ' The old location will be removed and this warning will become an' - ' error in the future.', - DeprecationWarning, -) - -from bqskit.passes.retarget.two import Rebase2QuditGatePass # noqa From c7a43558c4bb09aa43bf3cf968524c6023902ae3 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 12:32:27 -0400 Subject: [PATCH 05/10] Skipped one more slow test --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f112953f..3005e2a72 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,4 +34,4 @@ jobs: - name: Run tests env: NUMBER_RANDOM_CIRCUITS: 100 - run: pytest --ignore=tests/compiler/compile --ignore=tests/passes/partitioning/test_parts.py + run: pytest --ignore=tests/compiler/compile --ignore=tests/passes/partitioning/test_parts.py --ignore=tests/passes/synthesis/test_qfast.py From 8adb68bdae434b6c2aa8f06ab327b6b614da1b33 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 13:23:31 -0400 Subject: [PATCH 06/10] Add night slow test action --- .github/workflows/nightly-tests.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/nightly-tests.yml diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml new file mode 100644 index 000000000..98c782700 --- /dev/null +++ b/.github/workflows/nightly-tests.yml @@ -0,0 +1,31 @@ +# Runs slow tests every night +name: nightly tests + +on: + schedule: + - cron: "21 2 * * * + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.12 + + - name: Upgrade python environment + run: python -m pip install --upgrade virtualenv setuptools pip + + - name: Upgrade test dependencies + run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' qiskit + + - name: Install BQSKit + env: + SYSTEM_VERSION_COMPAT: 0 + run: pip install . + + - name: Run tests + env: + NUMBER_RANDOM_CIRCUITS: 100 + run: pytest From c8efa7b7780978478ddd86147e8b7c011f05b5c2 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 13:30:29 -0400 Subject: [PATCH 07/10] pre-commit --- .github/workflows/nightly-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 98c782700..9fd7473b2 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -5,14 +5,14 @@ on: schedule: - cron: "21 2 * * * -jobs: +jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.12 + python-version: 3.12 - name: Upgrade python environment run: python -m pip install --upgrade virtualenv setuptools pip @@ -28,4 +28,4 @@ jobs: - name: Run tests env: NUMBER_RANDOM_CIRCUITS: 100 - run: pytest + run: pytest From c753556e97b6cdf18d2eff2af10781d9a90c2e00 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 14:06:38 -0400 Subject: [PATCH 08/10] Fixed workflow parse error --- .github/workflows/nightly-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 9fd7473b2..bea761ea6 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -3,7 +3,7 @@ name: nightly tests on: schedule: - - cron: "21 2 * * * + - cron: "21 2 * * *" jobs: tests: From a39f5ecf257e6c9b41937719aaf60f151332cfcb Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 14:28:22 -0400 Subject: [PATCH 09/10] Publish on release workflow --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/publish-on-release.yml | 51 ++++++++++++++++++++++++ .github/workflows/tests.yml | 4 +- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-on-release.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 57e478b2e..b13b58946 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,7 +9,7 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.11' diff --git a/.github/workflows/publish-on-release.yml b/.github/workflows/publish-on-release.yml new file mode 100644 index 000000000..d3692e13f --- /dev/null +++ b/.github/workflows/publish-on-release.yml @@ -0,0 +1,51 @@ +name: Publish Release +on: + release: + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install build tool + run: python -m pip install build --user + + - name: Build distribution packages + run: python -m build + + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Upload release to PyPI + + needs: + - build + + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/bqskit + + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3005e2a72..5796cda2e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,8 +15,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From c8b5e3b20cdac0fd67dd0acbc2f289d796a06b07 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 26 Mar 2024 14:29:54 -0400 Subject: [PATCH 10/10] pre-commit --- .github/workflows/publish-on-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-on-release.yml b/.github/workflows/publish-on-release.yml index d3692e13f..e20fe9aae 100644 --- a/.github/workflows/publish-on-release.yml +++ b/.github/workflows/publish-on-release.yml @@ -48,4 +48,3 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 -