Skip to content

Commit be4727d

Browse files
authored
Merge pull request #235 from BQSKit/cicd-updates
CI/CD Updates and Fixes
2 parents d52c597 + c8b5e3b commit be4727d

File tree

7 files changed

+90
-26
lines changed

7 files changed

+90
-26
lines changed

.github/workflows/nightly-tests.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Runs slow tests every night
2+
name: nightly tests
3+
4+
on:
5+
schedule:
6+
- cron: "21 2 * * *"
7+
8+
jobs:
9+
tests:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.12
16+
17+
- name: Upgrade python environment
18+
run: python -m pip install --upgrade virtualenv setuptools pip
19+
20+
- name: Upgrade test dependencies
21+
run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' qiskit
22+
23+
- name: Install BQSKit
24+
env:
25+
SYSTEM_VERSION_COMPAT: 0
26+
run: pip install .
27+
28+
- name: Run tests
29+
env:
30+
NUMBER_RANDOM_CIRCUITS: 100
31+
run: pytest

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
pre-commit:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- uses: actions/setup-python@v4
1414
with:
1515
python-version: '3.11'
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish Release
2+
on:
3+
release:
4+
5+
jobs:
6+
build:
7+
name: Build distribution
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.11'
15+
16+
- name: Install build tool
17+
run: python -m pip install build --user
18+
19+
- name: Build distribution packages
20+
run: python -m build
21+
22+
- name: Store the distribution packages
23+
uses: actions/upload-artifact@v3
24+
with:
25+
name: python-package-distributions
26+
path: dist/
27+
28+
publish-to-pypi:
29+
name: Upload release to PyPI
30+
31+
needs:
32+
- build
33+
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: release
37+
url: https://pypi.org/p/bqskit
38+
39+
permissions:
40+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
41+
42+
steps:
43+
- name: Download all the dists
44+
uses: actions/download-artifact@v3
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
49+
- name: Publish package distributions to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,23 @@ jobs:
1515

1616
runs-on: ${{ matrix.os }}
1717
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-python@v2
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

2323
- name: Upgrade python environment
2424
run: python -m pip install --upgrade virtualenv setuptools pip
2525

2626
- name: Upgrade test dependencies
27-
run: python -m pip install psutil pytest 'hypothesis[zoneinfo]'
28-
29-
- name: Upgrade optional test dependencies
30-
if: matrix.python-version != '3.12'
31-
run: python -m pip install qiskit
27+
run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' qiskit
3228

3329
- name: Install BQSKit
3430
env:
3531
SYSTEM_VERSION_COMPAT: 0
36-
NUMBER_RANDOM_CIRCUITS: 100
3732
run: pip install .
33+
3834
- name: Run tests
39-
run: pytest
35+
env:
36+
NUMBER_RANDOM_CIRCUITS: 100
37+
run: pytest --ignore=tests/compiler/compile --ignore=tests/passes/partitioning/test_parts.py --ignore=tests/passes/synthesis/test_qfast.py

bqskit/passes/processing/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from bqskit.passes.processing.exhaustive import ExhaustiveGateRemovalPass
55
from bqskit.passes.processing.iterative import IterativeScanningGateRemovalPass
6-
from bqskit.passes.processing.rebase import Rebase2QuditGatePass # TODO: Remove
76
from bqskit.passes.processing.scan import ScanningGateRemovalPass
87
from bqskit.passes.processing.substitute import SubstitutePass
98

@@ -12,5 +11,4 @@
1211
'IterativeScanningGateRemovalPass',
1312
'ScanningGateRemovalPass',
1413
'SubstitutePass',
15-
'Rebase2QuditGatePass',
1614
]

bqskit/passes/processing/rebase.py

-13
This file was deleted.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
packages=find_packages(exclude=['examples*', 'test*']),
6868
install_requires=[
6969
'bqskitrs>=0.4.1',
70-
'lark-parser',
70+
'lark',
7171
'numpy>=1.22.0',
7272
'scipy>=1.8.0',
7373
'typing-extensions>=4.0.0',

0 commit comments

Comments
 (0)