Skip to content

Commit b15c230

Browse files
⬆️ Update runners and prek checks (#775)
## Description This PR updates the CI to use `macos-15` instead of `macos-14` and `macos-2025` instead of `macos-2022`. It furthermore updates `.pre-commit-config.yml` to make use of `prek`'s priority feature. ## Checklist: - [x] The pull request only contains commits that are focused and relevant to this change. - [x] ~I have added appropriate tests that cover the new/changed functionality.~ - [x] ~I have updated the documentation to reflect these changes.~ - [x] ~I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.~ - [x] ~I have added migration instructions to the upgrade guide (if needed).~ - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. --------- Signed-off-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
1 parent 5fab130 commit b15c230

File tree

8 files changed

+189
-184
lines changed

8 files changed

+189
-184
lines changed

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
[
2727
ubuntu-24.04,
2828
ubuntu-24.04-arm,
29+
macos-15,
2930
macos-15-intel,
30-
macos-14,
31-
windows-2022,
31+
windows-2025,
3232
windows-11-arm,
3333
]
3434
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11

.github/workflows/ci.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
runs-on: [macos-15-intel, macos-14]
46+
runs-on: [macos-15, macos-15-intel]
4747
compiler: [clang]
4848
config: [Release]
4949
include:
50-
- runs-on: macos-14
50+
- runs-on: macos-15
5151
compiler: clang
5252
config: Debug
5353
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
@@ -63,11 +63,11 @@ jobs:
6363
strategy:
6464
fail-fast: false
6565
matrix:
66-
runs-on: [windows-2022, windows-11-arm]
66+
runs-on: [windows-2025, windows-11-arm]
6767
compiler: [msvc]
6868
config: [Release]
6969
include:
70-
- runs-on: windows-2022
70+
- runs-on: windows-2025
7171
compiler: msvc
7272
config: Debug
7373
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
@@ -161,7 +161,14 @@ jobs:
161161
strategy:
162162
fail-fast: false
163163
matrix:
164-
runs-on: [ubuntu-24.04, ubuntu-24.04-arm, macos-15-intel, windows-2022]
164+
runs-on:
165+
[
166+
ubuntu-24.04,
167+
ubuntu-24.04-arm,
168+
macos-15,
169+
macos-15-intel,
170+
windows-2025,
171+
]
165172
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
166173
with:
167174
runs-on: ${{ matrix.runs-on }}
@@ -183,7 +190,7 @@ jobs:
183190
strategy:
184191
fail-fast: false
185192
matrix:
186-
runs-on: [macos-15, windows-2025]
193+
runs-on: [macos-14, windows-2025]
187194
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
188195
with:
189196
runs-on: ${{ matrix.runs-on }}
@@ -215,9 +222,9 @@ jobs:
215222
[
216223
ubuntu-24.04,
217224
ubuntu-24.04-arm,
225+
macos-15,
218226
macos-15-intel,
219-
macos-14,
220-
windows-2022,
227+
windows-2025,
221228
windows-11-arm,
222229
]
223230
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
@@ -243,7 +250,7 @@ jobs:
243250
- python-tests-extensive
244251
- build-sdist
245252
- build-wheel
246-
runs-on: ubuntu-latest
253+
runs-on: ubuntu-slim
247254
steps:
248255
- name: Decide whether the needed jobs succeeded or failed
249256
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
permissions:
1717
contents: write
1818
pull-requests: write
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-slim
2020
steps:
2121
- uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
2222
env:

.github/workflows/templating.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
render-template:
1010
name: Render template
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-slim
1212
permissions:
1313
contents: write
1414
pull-requests: write

.github/workflows/upstream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
runs-on: [ubuntu-24.04, macos-14, windows-2022]
21+
runs-on: [ubuntu-24.04, macos-15, windows-2025]
2222
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
2323
with:
2424
runs-on: ${{ matrix.runs-on }}

.pre-commit-config.yaml

Lines changed: 102 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,157 @@
11
# To run all pre-commit checks, use:
22
#
3-
# pre-commit run -a
3+
# uvx prek run -a
44
#
55
# To install pre-commit hooks that run every time you commit:
66
#
7-
# pre-commit install
7+
# uv tool install prek
8+
# prek install
89
#
910

1011
ci:
1112
autoupdate_commit_msg: "⬆️🪝 update pre-commit hooks"
12-
autofix_commit_msg: "🎨 pre-commit fixes"
1313
autoupdate_schedule: quarterly
14+
autofix_commit_msg: "🎨 pre-commit fixes"
1415
skip: [ty-check]
1516

1617
repos:
17-
# Standard hooks
18+
# Priority 0: Fast validation and independent fixers
19+
20+
## Standard hooks
1821
- repo: https://github.com/pre-commit/pre-commit-hooks
1922
rev: v6.0.0
2023
hooks:
21-
- id: check-added-large-files
22-
args: ["--maxkb=2048"]
23-
- id: check-case-conflict
24-
- id: check-vcs-permalinks
2524
- id: check-merge-conflict
26-
- id: check-symlinks
27-
- id: check-json
28-
- id: check-toml
29-
- id: check-yaml
30-
- id: debug-statements
25+
priority: 0
3126
- id: end-of-file-fixer
32-
- id: mixed-line-ending
27+
priority: 1
3328
- id: trailing-whitespace
29+
priority: 1
3430

35-
# Clean jupyter notebooks
36-
- repo: https://github.com/srstevenson/nb-clean
37-
rev: 4.0.1
31+
## Check the pyproject.toml file
32+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
33+
rev: 2026.01.22
3834
hooks:
39-
- id: nb-clean
40-
args:
41-
- --remove-empty-cells
42-
- --preserve-cell-metadata
43-
- raw_mimetype
44-
- --
45-
46-
# Handling unwanted unicode characters
47-
- repo: https://github.com/sirosen/texthooks
48-
rev: 0.7.1
35+
- id: validate-pyproject
36+
priority: 0
37+
38+
## Check JSON schemata
39+
- repo: https://github.com/python-jsonschema/check-jsonschema
40+
rev: 0.36.0
41+
hooks:
42+
- id: check-github-workflows
43+
priority: 0
44+
- id: check-readthedocs
45+
priority: 0
46+
47+
## Catch common capitalization mistakes
48+
- repo: local
4949
hooks:
50-
- id: fix-ligatures
51-
- id: fix-smartquotes
50+
- id: disallow-caps
51+
name: Disallow improper capitalization
52+
language: pygrep
53+
entry: Nanobind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum|MQTopt|MQTref
54+
exclude: .pre-commit-config.yaml
55+
priority: 0
5256

53-
# Check for common mistakes
54-
- repo: https://github.com/pre-commit/pygrep-hooks
55-
rev: v1.10.0
57+
## Check for spelling
58+
- repo: https://github.com/adhtruong/mirrors-typos
59+
rev: v1.42.1
5660
hooks:
57-
- id: rst-backticks
58-
- id: rst-directive-colons
59-
- id: rst-inline-touching-normal
61+
- id: typos
62+
priority: 0
6063

61-
# Check for license headers
64+
## Check best practices for scientific Python code
65+
- repo: https://github.com/scientific-python/cookie
66+
rev: 2025.11.21
67+
hooks:
68+
- id: sp-repo-review
69+
additional_dependencies: ["repo-review[cli]"]
70+
priority: 0
71+
72+
## Check for license headers
6273
- repo: https://github.com/emzeat/mz-lictools
6374
rev: v2.9.0
6475
hooks:
6576
- id: license-tools
77+
priority: 0
6678

67-
# Ensure uv lock file is up-to-date
79+
## Ensure uv lock file is up-to-date
6880
- repo: https://github.com/astral-sh/uv-pre-commit
6981
rev: 0.9.26
7082
hooks:
7183
- id: uv-lock
84+
priority: 0
7285

73-
# Python linting using ruff
74-
- repo: https://github.com/astral-sh/ruff-pre-commit
75-
rev: v0.14.14
86+
## Tidy up BibTeX files
87+
- repo: https://github.com/FlamingTempura/bibtex-tidy
88+
rev: v1.14.0
7689
hooks:
77-
- id: ruff-check
78-
- id: ruff-format
90+
- id: bibtex-tidy
91+
args:
92+
[
93+
"--align=20",
94+
"--curly",
95+
"--months",
96+
"--blank-lines",
97+
"--sort",
98+
"--strip-enclosing-braces",
99+
"--sort-fields",
100+
"--trailing-commas",
101+
"--remove-empty-fields",
102+
]
103+
priority: 0
79104

80-
# Also run Black on examples in the documentation
81-
- repo: https://github.com/adamchainz/blacken-docs
82-
rev: 1.20.0
105+
# Priority 1: Second-pass fixers
106+
107+
## Clang-format the C++ part of the code base automatically
108+
- repo: https://github.com/pre-commit/mirrors-clang-format
109+
rev: v21.1.8
83110
hooks:
84-
- id: blacken-docs
85-
additional_dependencies: [black==25.*]
111+
- id: clang-format
112+
types_or: [c++, c, cuda]
113+
priority: 1
86114

87-
# CMake format and lint the CMakeLists.txt files
115+
## CMake format and lint the CMakeLists.txt files
88116
- repo: https://github.com/cheshirekow/cmake-format-precommit
89117
rev: v0.6.13
90118
hooks:
91119
- id: cmake-format
92120
additional_dependencies: [pyyaml]
93121
types: [file]
94122
files: (\.cmake|CMakeLists.txt)(.in)?$
123+
priority: 1
95124

96-
# Clang-format the C++ part of the code base automatically
97-
- repo: https://github.com/pre-commit/mirrors-clang-format
98-
rev: v21.1.8
99-
hooks:
100-
- id: clang-format
101-
types_or: [c++, c, cuda]
102-
103-
# Format configuration files with prettier
125+
## Format configuration files with prettier
104126
- repo: https://github.com/rbubley/mirrors-prettier
105127
rev: v3.8.1
106128
hooks:
107129
- id: prettier
108130
types_or: [yaml, markdown, html, css, scss, javascript, json]
131+
priority: 1
132+
133+
## Python linting using ruff
134+
- repo: https://github.com/astral-sh/ruff-pre-commit
135+
rev: v0.14.14
136+
hooks:
137+
- id: ruff-format
138+
priority: 1
139+
- id: ruff-check
140+
require_serial: true
141+
priority: 2
109142

110-
## Static type checking using ty
143+
# Priority 2+: Final checks and fixers
144+
145+
## Also run Black on examples in the documentation (needs to run after ruff format)
146+
- repo: https://github.com/adamchainz/blacken-docs
147+
rev: 1.20.0
148+
hooks:
149+
- id: blacken-docs
150+
language: python
151+
additional_dependencies: [black==26.*]
152+
priority: 2
153+
154+
## Static type checking using ty (needs to run after lockfile update/ruff format, and ruff lint)
111155
- repo: local
112156
hooks:
113157
- id: ty-check
@@ -117,57 +161,4 @@ repos:
117161
require_serial: true
118162
types_or: [python, pyi, jupyter]
119163
exclude: ^(docs/)
120-
121-
# Check for spelling
122-
- repo: https://github.com/adhtruong/mirrors-typos
123-
rev: v1.42.1
124-
hooks:
125-
- id: typos
126-
127-
# Catch common capitalization mistakes
128-
- repo: local
129-
hooks:
130-
- id: disallow-caps
131-
name: Disallow improper capitalization
132-
language: pygrep
133-
entry: Nanobind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
134-
exclude: .pre-commit-config.yaml
135-
136-
# Check best practices for scientific Python code
137-
- repo: https://github.com/scientific-python/cookie
138-
rev: 2025.11.21
139-
hooks:
140-
- id: sp-repo-review
141-
additional_dependencies: ["repo-review[cli]"]
142-
143-
# Check JSON schemata
144-
- repo: https://github.com/python-jsonschema/check-jsonschema
145-
rev: 0.36.0
146-
hooks:
147-
- id: check-dependabot
148-
- id: check-github-workflows
149-
- id: check-readthedocs
150-
151-
# Check the pyproject.toml file
152-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
153-
rev: 2026.01.22
154-
hooks:
155-
- id: validate-pyproject
156-
157-
# Tidy up BibTeX files
158-
- repo: https://github.com/FlamingTempura/bibtex-tidy
159-
rev: v1.14.0
160-
hooks:
161-
- id: bibtex-tidy
162-
args:
163-
[
164-
"--align=20",
165-
"--curly",
166-
"--months",
167-
"--blank-lines",
168-
"--sort",
169-
"--strip-enclosing-braces",
170-
"--sort-fields",
171-
"--trailing-commas",
172-
"--remove-empty-fields",
173-
]
164+
priority: 3

0 commit comments

Comments
 (0)