Repository navigation
multi environments ci workflow #697
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
base: main
Are you sure you want to change the base?
Changes from 44 commits
5582631
59491df
3915b30
43af38e
0361e72
e542519
575b74c
a37ece0
8e5c637
3ca7f34
4fd3965
860e9f1
50bda05
2bf06f7
86993af
e25f8a8
fd0bc28
a7c0fef
4a82dbb
1a2fbd6
f471ac7
c9ac6ed
713b74a
67fcd82
eff534b
704e862
bb5fdba
df19447
78ce8b6
2160e6c
6d450af
1f9af15
f7e816e
9d52d86
e8c2f8f
7a5f728
e191d2d
192eeff
3ec9c9c
e0a43e8
0259462
81aca70
63f3a40
8c05465
45942a8
7e81240
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||||||
| name: Qrisp unit tests via Pytest Windows and macOS | ||||||||||
|
|
||||||||||
| on: | ||||||||||
| push: | ||||||||||
| branches: | ||||||||||
| - main | ||||||||||
|
|
||||||||||
| permissions: | ||||||||||
| contents: read | ||||||||||
|
|
||||||||||
| concurrency: | ||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||
| cancel-in-progress: true | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| build: | ||||||||||
| name: Test Py${{ matrix.python-version }} on ${{ matrix.os }} (${{ matrix.test-group-name }}) | ||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||
| timeout-minutes: 120 | ||||||||||
| strategy: | ||||||||||
| fail-fast: false | ||||||||||
| matrix: | ||||||||||
| # Actual dimensions that need to be multiplied out | ||||||||||
| os: [macos-latest, windows-latest] | ||||||||||
| python-version: ["3.11.*", "3.12.*", "3.13.*"] | ||||||||||
| test-group-name: [core, algorithms-and-integrations] | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make sure we follow the same pattern as the other PR. For a specific os, only test
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if we discussed this in one of the meetings, but the current version of the workflow follows the description from issue #825.
Maybe it will be resource-heavy to run two new actions on every push to the PR. If we want to test every OS, we can do it nightly? |
||||||||||
|
|
||||||||||
| include: | ||||||||||
| # Map paths to test groups globally | ||||||||||
| - test-group-name: core | ||||||||||
| test-group-paths: "tests/circuit_tests tests/core_tests tests/primitives_tests tests/jax_tests tests/test_typing.py" | ||||||||||
| - test-group-name: algorithms-and-integrations | ||||||||||
| test-group-paths: "tests/algorithms_tests tests/operators_tests tests/block_encodings_tests tests/interface_tests tests/stim_integration_tests" | ||||||||||
|
|
||||||||||
| # Assign pip-extras based on OS type | ||||||||||
| - os: macos-latest | ||||||||||
| pip-extras: "[dev,catalyst,xdsl,iqm]" | ||||||||||
| - os: windows-latest | ||||||||||
| pip-extras: "[dev-windows,xdsl,iqm]" | ||||||||||
|
|
||||||||||
| # Inject specific pytest flags for Windows test groups | ||||||||||
| - os: windows-latest | ||||||||||
| test-group-name: core | ||||||||||
| # Exclude tests that are not supported on Windows due to platform-specific issues | ||||||||||
| pytest-flags: '-k "not test_catalyst_interface and not test_qubit_array_fusion"' | ||||||||||
| - os: windows-latest | ||||||||||
| # Exclude tests that are not supported on Windows due to platform-specific issues | ||||||||||
| test-group-name: algorithms-and-integrations | ||||||||||
| pytest-flags: '--ignore=tests/interface_tests/test_converter_qrisp_to_qml.py' | ||||||||||
|
|
||||||||||
| steps: | ||||||||||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: printf '%s\n' '--- diff ---'
git diff --no-ext-diff --unified=50 7b24083e4efa79daaf60164e53e47ee0a484bfbf 8c0546500d131bd94be33c46b5ebea76a02848c1 -- .github/workflows/multi.yml
printf '%s\n' '--- reviewed workflow ---'
git show 8c0546500d131bd94be33c46b5ebea76a02848c1:.github/workflows/multi.yml | nl -ba
printf '%s\n' '--- checkout references in workflow ---'
rg -n -C 3 'actions/checkout|persist-credentials|permissions:|pull_request|push:|git push|git fetch' .github/workflows/multi.yml || test "$?" -eq 1Repository: eclipse-qrisp/Qrisp Length of output: 6716 Security Misconfiguration Reachability: Internal Disable checkout credential persistence. The workflow only runs on pushes to Disable checkout credential persistence - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.30.1)[warning] 52-52: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||
| - name: Set up Python ${{ matrix.python-version }} | ||||||||||
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | ||||||||||
| with: | ||||||||||
| python-version: ${{ matrix.python-version }} | ||||||||||
| cache: 'pip' | ||||||||||
| - name: Install dependencies | ||||||||||
| shell: bash | ||||||||||
| run: | | ||||||||||
| python -m pip install --upgrade pip | ||||||||||
| pip install -e ".${{ matrix.pip-extras }}" | ||||||||||
| - name: Test with pytest (${{ matrix.test-group-name }}) | ||||||||||
| shell: bash | ||||||||||
| run: | | ||||||||||
| pytest ${{ matrix.test-group-paths }} ${{ matrix.pytest-flags }} | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,14 +28,30 @@ For development you will also want the test and documentation dependencies: | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| pip install -e ".[dev,docs]" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Windows** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. note:: | ||||||||||||||||||||||||||||||
| The ``dev`` dependency group includes ``pyscf``, which is not supported on Windows. Windows users must install the compatible dependencies individually: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Install optional dependency groups (excluding dev) | ||||||||||||||||||||||||||||||
| pip install -e ".[docs,iqm,xdsl,aqt,qiskit]" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Install Windows-compatible testing framework tools | ||||||||||||||||||||||||||||||
| pip install pytest qiskit-aer cirq pytest-httpx stim | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Install tqecd from source | ||||||||||||||||||||||||||||||
| python -m pip install git+https://github.com/tqec/tqecd.git | ||||||||||||||||||||||||||||||
|
Comment on lines
+39
to
+45
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- documented setup at reviewed head ---'
nl -ba 'documentation/source/reference/Development Guide/getting_started.rst' | sed -n '1,90p'
printf '%s\n' '--- dependency declarations ---'
rg -n -C 5 'dev-windows|dev-testing-windows|pytest-cov|iqm-client|pytest-httpx' pyproject.toml
printf '%s\n' '--- Windows CI installation references ---'
rg -n -i -C 4 'windows|dev-testing-windows|dev-windows|pip install|uv sync|install.*extra' .github/workflows .github 2>/dev/null | head -n 260
printf '%s\n' '--- changed guide/dependency/workflow files in PR ---'
git diff --name-status 7b24083e4efa79daaf60164e53e47ee0a484bfbf 8c0546500d131bd94be33c46b5ebea76a02848c1 -- pyproject.toml 'documentation/source/reference/Development Guide/getting_started.rst' .githubRepository: eclipse-qrisp/Qrisp Length of output: 19561 🏁 Script executed: printf '%s\n' '--- remainder of guide: commands and claims ---'
nl -ba 'documentation/source/reference/Development Guide/getting_started.rst' | sed -n '88,230p'
printf '%s\n' '--- full optional dependency definitions ---'
nl -ba pyproject.toml | sed -n '40,115p'
printf '%s\n' '--- Windows CI and style workflow setup ---'
nl -ba .github/workflows/multi.yml | sed -n '20,75p'
nl -ba .github/workflows/code_style.yml | sed -n '1,100p'
printf '%s\n' '--- guide references to coverage/style-specific commands ---'
rg -n -i -C 2 'coverage|pytest-cov|ruff|format|lint|style|pytest' 'documentation/source/reference/Development Guide/getting_started.rst'Repository: eclipse-qrisp/Qrisp Length of output: 13479 🏁 Script executed: printf '%s\n' '--- locate code-quality guide ---'
rg -n -F 'DevGuideCodeQuality' documentation/source
printf '%s\n' '--- locate documented Ruff commands ---'
rg -n -i -C 3 'ruff|pytest-cov|--cov|coverage' documentation/source
printf '%s\n' '--- check base dependencies and Windows test dependencies ---'
nl -ba pyproject.toml | sed -n '1,46p'
rg -n -i -C 2 'import stim|from stim|stim\.' tests/stim_integration_testsRepository: eclipse-qrisp/Qrisp Length of output: 23391 Install the Windows development extra for Ruff. The linked Code Quality guide recommends Pylint or Ruff, but the Windows setup installs neither. Add Suggested Windows setup edit- pip install -e ".[docs,iqm,xdsl,aqt,qiskit]"
+ pip install -e ".[dev-windows,docs,iqm,xdsl,aqt,qiskit]"
- pip install pytest qiskit-aer cirq pytest-httpx stim
+ pip install pytest-httpx stim📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. list-table:: Optional dependency groups | ||||||||||||||||||||||||||||||
| :header-rows: 1 | ||||||||||||||||||||||||||||||
| :widths: 15 40 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| * - Group | ||||||||||||||||||||||||||||||
| - What it installs | ||||||||||||||||||||||||||||||
| * - ``dev`` | ||||||||||||||||||||||||||||||
| - Test runner (pytest), simulators (qiskit-aer, cirq), and chemistry (pyscf) | ||||||||||||||||||||||||||||||
| - Test runner (pytest), simulators (qiskit-aer, cirq), and chemistry (pyscf *(Not supported on Windows)*) | ||||||||||||||||||||||||||||||
| * - ``docs`` | ||||||||||||||||||||||||||||||
| - Sphinx and related extensions for building the documentation | ||||||||||||||||||||||||||||||
| * - ``aqt`` | ||||||||||||||||||||||||||||||
|
|
@@ -45,7 +61,7 @@ For development you will also want the test and documentation dependencies: | |||||||||||||||||||||||||||||
| * - ``iqm`` | ||||||||||||||||||||||||||||||
| - Client for IQM quantum hardware | ||||||||||||||||||||||||||||||
| * - ``catalyst`` | ||||||||||||||||||||||||||||||
| - PennyLane Catalyst JIT compiler | ||||||||||||||||||||||||||||||
| - PennyLane Catalyst JIT compiler *(Not supported on Windows)* | ||||||||||||||||||||||||||||||
| * - ``xdsl`` | ||||||||||||||||||||||||||||||
| - xDSL compiler infrastructure | ||||||||||||||||||||||||||||||
| * - ``all`` | ||||||||||||||||||||||||||||||
|
|
@@ -57,7 +73,7 @@ Include the groups you need in brackets, either at install time or later: | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Everything (base install plus every optional group) | ||||||||||||||||||||||||||||||
| # Everything (base install plus every optional group) (Linux/macOS) | ||||||||||||||||||||||||||||||
| pip install -e ".[all]" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Or individual groups after the base install | ||||||||||||||||||||||||||||||
|
|
@@ -84,11 +100,27 @@ Running the test suite | |||||||||||||||||||||||||||||
| Before making any changes, confirm that the existing test suite passes on your | ||||||||||||||||||||||||||||||
| machine. This gives you a clean baseline to compare against. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Linux and macOS** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Run the full suite (note: this currently takes up to ~1 hour) | ||||||||||||||||||||||||||||||
| pytest tests/ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Windows** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. note:: | ||||||||||||||||||||||||||||||
| Because certain unsupported dependencies are missing on Windows, you must ignore specific interface and JAX tests when running the suite: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Run the full suite while ignoring unsupported dependency tests | ||||||||||||||||||||||||||||||
| pytest tests/ --ignore=tests/interface_tests/test_converter_qrisp_to_qml.py --ignore=tests/jax_tests/test_catalyst_interface.py --ignore=tests/jax_tests/test_qubit_array_fusion.py | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Subsystem testing (All Platforms)** | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| .. code-block:: bash | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Run only a specific subsystem — much faster during development | ||||||||||||||||||||||||||||||
| pytest tests/circuit_tests/ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,18 +69,25 @@ docs = [ | |
| dev-code-style = [ | ||
| "ruff==0.16.5", | ||
| ] | ||
| dev-testing = [ | ||
| dev-testing-windows = [ | ||
| "pytest==9.1.1", | ||
| "pytest-cov>=6.0", | ||
| "qiskit-aer", | ||
| "pyscf", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simply curious: is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is, alongside
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to know! Should we think about documenting this in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can see, there is no documentation about installing Qrisp in a Windows environment, so I think this is a great suggestion. We can discuss it in the software engineering meeting. |
||
| "cirq", | ||
| "tqecd", | ||
| "iqm-client[qrisp]", | ||
| ] | ||
| dev-testing = [ | ||
| "qrisp[dev-testing-windows]", | ||
| "pyscf", | ||
| ] | ||
| dev = [ | ||
| "qrisp[dev-code-style,dev-testing]", | ||
| ] | ||
| dev-windows = [ | ||
| "qrisp[dev-code-style, dev-testing-windows]", | ||
| ] | ||
|
|
||
| # aqt is intentionally excluded from `all` because qiskit-aqt-provider ships a | ||
| # pytest plugin (qiskit_aqt_provider.test.fixtures) that fails to load when | ||
| # pytest-httpx is not installed, breaking any pytest invocation. | ||
|
|
@@ -132,4 +139,4 @@ ignore = [ | |
| omit = ["*/__init__.py"] | ||
|
|
||
| [tool.pylint. messages_control] | ||
| disable = ["import-error"] | ||
| disable = ["import-error"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just thinking out loud (not asking you to make changes): would it be better to have one workflow for all 3 OSes? I don't know if we have already had this conversation 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we had hahaha. I think it will be better organized if they are separated into two workflows. But if we decide to change the behavior of
multi.ymlto run on every PR, it will be reasonable to have a single workflow for all the supported OSes.