QuPRS 0.3.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. quprs-0.4.0/.github/workflows/benchmarks.yml +97 -0
  2. {quprs-0.3.0 → quprs-0.4.0}/.github/workflows/pytest.yml +14 -12
  3. {quprs-0.3.0 → quprs-0.4.0}/Dockerfile +0 -2
  4. {quprs-0.3.0 → quprs-0.4.0}/PKG-INFO +4 -1
  5. {quprs-0.3.0 → quprs-0.4.0}/pyproject.toml +3 -0
  6. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/_version.py +2 -2
  7. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS.egg-info/PKG-INFO +4 -1
  8. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS.egg-info/SOURCES.txt +1 -0
  9. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS.egg-info/requires.txt +3 -0
  10. {quprs-0.3.0 → quprs-0.4.0}/.github/workflows/docker-build.yml +0 -0
  11. {quprs-0.3.0 → quprs-0.4.0}/.github/workflows/python-publish.yml +0 -0
  12. {quprs-0.3.0 → quprs-0.4.0}/.gitignore +0 -0
  13. {quprs-0.3.0 → quprs-0.4.0}/LICENSE.md +0 -0
  14. {quprs-0.3.0 → quprs-0.4.0}/MANIFEST.in +0 -0
  15. {quprs-0.3.0 → quprs-0.4.0}/NOTICE.md +0 -0
  16. {quprs-0.3.0 → quprs-0.4.0}/README.md +0 -0
  17. {quprs-0.3.0 → quprs-0.4.0}/setup.cfg +0 -0
  18. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/__init__.py +0 -0
  19. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/cache_manager/__init__.py +0 -0
  20. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/cache_manager/cache_decorator.py +0 -0
  21. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/cache_manager/global_cache_manager.py +0 -0
  22. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/config.py +0 -0
  23. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/interface/__init__.py +0 -0
  24. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/interface/gate_library.py +0 -0
  25. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/interface/load_qiskit.py +0 -0
  26. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/interface/ps2wmc.py +0 -0
  27. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/interface/qasm2qc.py +0 -0
  28. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/pathsum.py +0 -0
  29. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/utils/Qiskit_Circuit_Utils.py +0 -0
  30. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/utils/__init__.py +0 -0
  31. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/utils/gpmc +0 -0
  32. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/utils/reduction.py +0 -0
  33. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/utils/strategy.py +0 -0
  34. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS/utils/util.py +0 -0
  35. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS.egg-info/dependency_links.txt +0 -0
  36. {quprs-0.3.0 → quprs-0.4.0}/src/QuPRS.egg-info/top_level.txt +0 -0
@@ -0,0 +1,97 @@
1
+ name: Python CI & Benchmarks
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ # ────────────────────────────────────────────────────────────────────────────
11
+ # 1. Unit tests + Benchmark baseline (only runs on push to main branch)
12
+ build-and-save-baseline:
13
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.12"]
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Setup Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+ cache: 'pip'
27
+
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install .[dev] # Includes pytest, pytest-benchmark, matplotlib, tabulate
32
+
33
+ - name: Run tests and save baseline benchmark
34
+ run: |
35
+ pytest --benchmark-only --benchmark-save=main --benchmark-storage=file://./benchmarks
36
+ - name: Upload baseline benchmark artifact
37
+ uses: actions/upload-artifact@v4
38
+ with:
39
+ name: benchmark-main
40
+ path: ./benchmarks/**/*.json
41
+
42
+ # ────────────────────────────────────────────────────────────────────────────
43
+ # 2. Unit tests + PR Benchmark comparison (runs on pull requests)
44
+ test-and-compare:
45
+ if: github.event_name == 'pull_request'
46
+ runs-on: ubuntu-latest
47
+ strategy:
48
+ matrix:
49
+ python-version: ["3.12"]
50
+ steps:
51
+ - name: Checkout code
52
+ uses: actions/checkout@v4
53
+
54
+ - name: Setup Python ${{ matrix.python-version }}
55
+ uses: actions/setup-python@v5
56
+ with:
57
+ python-version: ${{ matrix.python-version }}
58
+ cache: 'pip'
59
+
60
+ - name: Install dependencies
61
+ run: |
62
+ python -m pip install --upgrade pip
63
+ pip install .[dev]
64
+
65
+ - name: Run unit tests
66
+ run: pytest -n auto -v
67
+
68
+ - name: Download baseline benchmark
69
+ uses: actions/download-artifact@v4
70
+ with:
71
+ name: benchmark-main
72
+ path: .benchmarks
73
+
74
+ - name: Run PR benchmark and compare
75
+ run: |
76
+ pytest --benchmark-only --benchmark-save=pr
77
+ pytest --benchmark-compare main pr
78
+
79
+ - name: Generate Markdown & Chart report
80
+ run: python generate_benchmark_report.py
81
+
82
+ - name: Upload report markdown
83
+ uses: actions/upload-artifact@v4
84
+ with:
85
+ name: benchmark-report-md
86
+ path: benchmark_report.md
87
+
88
+ - name: Upload chart image
89
+ uses: actions/upload-artifact@v4
90
+ with:
91
+ name: benchmark-chart-png
92
+ path: benchmark_chart.png
93
+
94
+ - name: Comment benchmark results on PR
95
+ uses: marocchino/sticky-pull-request-comment@v2
96
+ with:
97
+ path: benchmark_report.md
@@ -4,10 +4,7 @@ name: Python Pytest CI
4
4
 
5
5
  # Trigger this workflow on push or pull request to main branch
6
6
  on:
7
- push:
8
- branches: [ "main" ]
9
- pull_request:
10
- branches: [ "main" ]
7
+ [push, pull_request]
11
8
 
12
9
  jobs:
13
10
  build:
@@ -36,20 +33,25 @@ jobs:
36
33
  - name: Install dependencies
37
34
  run: |
38
35
  python -m pip install --upgrade pip
39
- pip install pytest
40
- pip install pytest-xdist
41
- pip install pytest-cov
42
- pip install .
36
+ pip install .[dev]
43
37
 
44
38
  # Step 4: Run pytest
45
39
  - name: Run tests with pytest
46
40
  run: |
47
- pytest -n auto -v --junitxml=pytest-results.xml
41
+ pytest -n auto -v --junitxml=pytest-results.xml --html=pytest-results.html --self-contained-html
48
42
 
49
- # Step 5: Upload pytest results as artifact
50
- - name: Upload pytest results
43
+ # Step 5: Upload pytest HTML results as artifact
44
+ - name: Upload pytest HTML results
51
45
  if: always()
52
46
  uses: actions/upload-artifact@v4
53
47
  with:
54
- name: pytest-results-${{ matrix.python-version }}
48
+ name: pytest-results-html-${{ matrix.python-version }}
49
+ path: pytest-results.html
50
+
51
+ # Step 6: Upload pytest XML results as artifact
52
+ - name: Upload pytest XML results
53
+ if: always()
54
+ uses: actions/upload-artifact@v4
55
+ with:
56
+ name: pytest-results-xml-${{ matrix.python-version }}
55
57
  path: pytest-results.xml
@@ -43,7 +43,5 @@ RUN conda run -n base pytest -n auto
43
43
  # 5. Set license information as a container label
44
44
  LABEL org.opencontainers.image.licenses="MIT"
45
45
 
46
-
47
-
48
46
  # 6. Set the default command to run when the container starts
49
47
  CMD ["/bin/bash"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuPRS
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: QuPRS: Quantum Path-sum Reduction and Solver
5
5
  Author-email: Wei-Jia Huang <wei.jia.huang.physics@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/PhysicsQoo/QuPRS
@@ -30,6 +30,9 @@ Requires-Dist: build; extra == "dev"
30
30
  Requires-Dist: pytest; extra == "dev"
31
31
  Requires-Dist: pytest-xdist; extra == "dev"
32
32
  Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: pytest-flake8; extra == "dev"
34
+ Requires-Dist: pytest-benchmark; extra == "dev"
35
+ Requires-Dist: pytest-html; extra == "dev"
33
36
  Requires-Dist: pandas; extra == "dev"
34
37
  Requires-Dist: tqdm; extra == "dev"
35
38
  Dynamic: license-file
@@ -38,6 +38,9 @@ dev = [
38
38
  "pytest",
39
39
  "pytest-xdist",
40
40
  "pytest-cov",
41
+ "pytest-flake8",
42
+ "pytest-benchmark",
43
+ "pytest-html",
41
44
  "pandas",
42
45
  "tqdm"
43
46
  ]
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.3.0'
21
- __version_tuple__ = version_tuple = (0, 3, 0)
20
+ __version__ = version = '0.4.0'
21
+ __version_tuple__ = version_tuple = (0, 4, 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuPRS
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: QuPRS: Quantum Path-sum Reduction and Solver
5
5
  Author-email: Wei-Jia Huang <wei.jia.huang.physics@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/PhysicsQoo/QuPRS
@@ -30,6 +30,9 @@ Requires-Dist: build; extra == "dev"
30
30
  Requires-Dist: pytest; extra == "dev"
31
31
  Requires-Dist: pytest-xdist; extra == "dev"
32
32
  Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: pytest-flake8; extra == "dev"
34
+ Requires-Dist: pytest-benchmark; extra == "dev"
35
+ Requires-Dist: pytest-html; extra == "dev"
33
36
  Requires-Dist: pandas; extra == "dev"
34
37
  Requires-Dist: tqdm; extra == "dev"
35
38
  Dynamic: license-file
@@ -5,6 +5,7 @@ MANIFEST.in
5
5
  NOTICE.md
6
6
  README.md
7
7
  pyproject.toml
8
+ .github/workflows/benchmarks.yml
8
9
  .github/workflows/docker-build.yml
9
10
  .github/workflows/pytest.yml
10
11
  .github/workflows/python-publish.yml
@@ -10,5 +10,8 @@ build
10
10
  pytest
11
11
  pytest-xdist
12
12
  pytest-cov
13
+ pytest-flake8
14
+ pytest-benchmark
15
+ pytest-html
13
16
  pandas
14
17
  tqdm
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes