Skip to content

Commit e38f03b

Browse files
authored
⬆️ Update runners and prek checks (#253)
## 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] 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.
1 parent 4436bb6 commit e38f03b

File tree

7 files changed

+186
-189
lines changed

7 files changed

+186
-189
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: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
cpp-tests-ubuntu:
2020
name: 🇨‌ Test 🐧
2121
needs: change-detection
22-
if: fromJSON(needs.change-detection.outputs.run-cpp-tests) && !contains(github.event.pull_request.labels.*.name, 'extensive-cpp-ci')
22+
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
2323
strategy:
2424
fail-fast: false
2525
matrix:
@@ -40,15 +40,15 @@ jobs:
4040
cpp-tests-macos:
4141
name: 🇨‌ Test 🍎
4242
needs: change-detection
43-
if: fromJSON(needs.change-detection.outputs.run-cpp-tests) && !contains(github.event.pull_request.labels.*.name, 'extensive-cpp-ci')
43+
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
4444
strategy:
4545
fail-fast: false
4646
matrix:
47-
runs-on: [macos-15-intel, macos-14]
47+
runs-on: [macos-15, macos-15-intel]
4848
compiler: [clang]
4949
config: [Release]
5050
include:
51-
- runs-on: macos-14
51+
- runs-on: macos-15
5252
compiler: clang
5353
config: Debug
5454
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
@@ -61,15 +61,15 @@ jobs:
6161
cpp-tests-windows:
6262
name: 🇨‌ Test 🏁
6363
needs: change-detection
64-
if: fromJSON(needs.change-detection.outputs.run-cpp-tests) && !contains(github.event.pull_request.labels.*.name, 'extensive-cpp-ci')
64+
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
runs-on: [windows-2022, windows-11-arm]
68+
runs-on: [windows-2025, windows-11-arm]
6969
compiler: [msvc]
7070
config: [Release]
7171
include:
72-
- runs-on: windows-2022
72+
- runs-on: windows-2025
7373
compiler: msvc
7474
config: Debug
7575
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
@@ -112,9 +112,9 @@ jobs:
112112
[
113113
ubuntu-24.04,
114114
ubuntu-24.04-arm,
115+
macos-15,
115116
macos-15-intel,
116-
macos-14,
117-
windows-2022,
117+
windows-2025,
118118
]
119119
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
120120
with:
@@ -154,9 +154,9 @@ jobs:
154154
[
155155
ubuntu-24.04,
156156
ubuntu-24.04-arm,
157+
macos-15,
157158
macos-15-intel,
158-
macos-14,
159-
windows-2022,
159+
windows-2025,
160160
windows-11-arm,
161161
]
162162
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
@@ -179,7 +179,7 @@ jobs:
179179
- python-linter
180180
- build-sdist
181181
- build-wheel
182-
runs-on: ubuntu-latest
182+
runs-on: ubuntu-slim
183183
steps:
184184
- name: Decide whether the needed jobs succeeded or failed
185185
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

.pre-commit-config.yaml

Lines changed: 101 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,165 @@
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: [mypy]
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-
# Static type checking using mypy
81-
- repo: https://github.com/pre-commit/mirrors-mypy
82-
rev: v1.19.1
83-
hooks:
84-
- id: mypy
85-
files: ^(python/mqt|test/python)
86-
args: []
87-
additional_dependencies:
88-
- pandas-stubs
89-
- pytest
90-
- scipy-stubs
91-
- types-networkx
105+
# Priority 1: Second-pass fixers
92106

93-
# Also run Black on examples in the documentation
94-
- repo: https://github.com/adamchainz/blacken-docs
95-
rev: 1.20.0
96-
hooks:
97-
- id: blacken-docs
98-
additional_dependencies: [black==25.*]
99-
100-
# Clang-format the C++ part of the code base automatically
107+
## Clang-format the C++ part of the code base automatically
101108
- repo: https://github.com/pre-commit/mirrors-clang-format
102109
rev: v21.1.8
103110
hooks:
104111
- id: clang-format
105112
types_or: [c++, c, cuda]
113+
priority: 1
106114

107-
# CMake format and lint the CMakeLists.txt files
115+
## CMake format and lint the CMakeLists.txt files
108116
- repo: https://github.com/cheshirekow/cmake-format-precommit
109117
rev: v0.6.13
110118
hooks:
111119
- id: cmake-format
112120
additional_dependencies: [pyyaml]
113121
types: [file]
114122
files: (\.cmake|CMakeLists.txt)(.in)?$
123+
priority: 1
115124

116-
# Format configuration files with prettier
125+
## Format configuration files with prettier
117126
- repo: https://github.com/rbubley/mirrors-prettier
118127
rev: v3.8.1
119128
hooks:
120129
- id: prettier
121130
types_or: [yaml, markdown, html, css, scss, javascript, json]
131+
priority: 1
122132

123-
# Check for spelling
124-
- repo: https://github.com/adhtruong/mirrors-typos
125-
rev: v1.42.1
126-
hooks:
127-
- id: typos
128-
129-
# Catch common capitalization mistakes
130-
- repo: local
131-
hooks:
132-
- id: disallow-caps
133-
name: Disallow improper capitalization
134-
language: pygrep
135-
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
136-
exclude: .pre-commit-config.yaml
137-
138-
# Check best practices for scientific Python code
139-
- repo: https://github.com/scientific-python/cookie
140-
rev: 2025.11.21
133+
## Python linting using ruff
134+
- repo: https://github.com/astral-sh/ruff-pre-commit
135+
rev: v0.14.14
141136
hooks:
142-
- id: sp-repo-review
143-
additional_dependencies: ["repo-review[cli]"]
137+
- id: ruff-format
138+
priority: 1
139+
- id: ruff-check
140+
require_serial: true
141+
priority: 2
144142

145-
# Check JSON schemata
146-
- repo: https://github.com/python-jsonschema/check-jsonschema
147-
rev: 0.36.0
148-
hooks:
149-
- id: check-dependabot
150-
- id: check-github-workflows
151-
- id: check-readthedocs
143+
# Priority 2+: Final checks and fixers
152144

153-
# Check the pyproject.toml file
154-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
155-
rev: 2026.01.22
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
156148
hooks:
157-
- id: validate-pyproject
149+
- id: blacken-docs
150+
language: python
151+
additional_dependencies: [black==26.*]
152+
priority: 2
158153

159-
# Tidy up BibTeX files
160-
- repo: https://github.com/FlamingTempura/bibtex-tidy
161-
rev: v1.14.0
154+
## Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
155+
- repo: https://github.com/pre-commit/mirrors-mypy
156+
rev: v1.19.1
162157
hooks:
163-
- id: bibtex-tidy
164-
args:
165-
[
166-
"--align=20",
167-
"--curly",
168-
"--months",
169-
"--blank-lines",
170-
"--sort",
171-
"--strip-enclosing-braces",
172-
"--sort-fields",
173-
"--trailing-commas",
174-
"--remove-empty-fields",
175-
]
158+
- id: mypy
159+
files: ^(python/mqt|test/python)
160+
args: []
161+
additional_dependencies:
162+
- pandas-stubs
163+
- pytest
164+
- scipy-stubs
165+
- types-networkx

0 commit comments

Comments
 (0)