Skip to content

Commit cd7da02

Browse files
denialhaagburgholzercoderabbitai[bot]
authored
⬆️ Update runners and prek checks (#349)
## Description This PR updates the CI to use `macos-15` instead of `macos-14` and `windows-2025` instead of `windows-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: Lukas Burgholzer <burgholzer@me.com> Co-authored-by: Lukas Burgholzer <burgholzer@me.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 02a0530 commit cd7da02

File tree

5 files changed

+108
-106
lines changed

5 files changed

+108
-106
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
runs-on: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2022]
31+
runs-on: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-2025]
3232
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
3333
with:
3434
runs-on: ${{ matrix.runs-on }}
@@ -70,7 +70,7 @@ jobs:
7070
- python-linter
7171
- build-sdist
7272
- build-wheel
73-
runs-on: ubuntu-latest
73+
runs-on: ubuntu-slim
7474
steps:
7575
- name: Decide whether the needed jobs succeeded or failed
7676
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: 103 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,151 @@
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-
- --
35+
- id: validate-pyproject
36+
priority: 0
4537

46-
# Handling unwanted unicode characters
47-
- repo: https://github.com/sirosen/texthooks
48-
rev: 0.7.1
38+
## Check JSON schemata
39+
- repo: https://github.com/python-jsonschema/check-jsonschema
40+
rev: 0.36.1
4941
hooks:
50-
- id: fix-ligatures
51-
- id: fix-smartquotes
42+
- id: check-github-workflows
43+
priority: 0
44+
- id: check-readthedocs
45+
priority: 0
5246

53-
# Check for common mistakes
54-
- repo: https://github.com/pre-commit/pygrep-hooks
55-
rev: v1.10.0
47+
## Catch common capitalization mistakes
48+
- repo: local
5649
hooks:
57-
- id: rst-backticks
58-
- id: rst-directive-colons
59-
- id: rst-inline-touching-normal
50+
- id: disallow-caps
51+
name: Disallow improper capitalization
52+
language: pygrep
53+
entry: '\b(?:Numpy|Github|PyTest|Mqt|Tum)\b'
54+
exclude: ^(.pre-commit-config.yaml|webpage/package-lock.json|.*\.zip)
55+
priority: 0
6056

61-
# Check for license headers
57+
## Check for spelling
58+
- repo: https://github.com/adhtruong/mirrors-typos
59+
rev: v1.42.3
60+
hooks:
61+
- id: typos
62+
priority: 0
63+
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.28
7082
hooks:
7183
- id: uv-lock
84+
priority: 0
85+
86+
## Tidy up BibTeX files
87+
- repo: https://github.com/FlamingTempura/bibtex-tidy
88+
rev: v1.14.0
89+
hooks:
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
72104

73-
# Python linting and formatting using ruff
105+
# Priority 1: Second-pass fixers
106+
107+
## Format configuration files with prettier
108+
- repo: https://github.com/rbubley/mirrors-prettier
109+
rev: v3.8.1
110+
hooks:
111+
- id: prettier
112+
types_or: [yaml, markdown, html, css, scss, javascript, json]
113+
priority: 1
114+
115+
## Python linting using ruff
74116
- repo: https://github.com/astral-sh/ruff-pre-commit
75117
rev: v0.14.14
76118
hooks:
77-
- id: ruff-check
78119
- id: ruff-format
120+
priority: 1
121+
- id: ruff-check
122+
require_serial: true
123+
priority: 2
124+
125+
# Priority 2+: Final checks and fixers
79126

80-
# Also run Black on examples in the documentation
127+
## Clean Jupyter notebooks
128+
- repo: https://github.com/srstevenson/nb-clean
129+
rev: 4.0.1
130+
hooks:
131+
- id: nb-clean
132+
args:
133+
- --remove-empty-cells
134+
- --preserve-cell-metadata
135+
- raw_mimetype
136+
- --
137+
priority: 2
138+
139+
## Also run Black on examples in the documentation (needs to run after ruff format)
81140
- repo: https://github.com/adamchainz/blacken-docs
82141
rev: 1.20.0
83142
hooks:
84143
- id: blacken-docs
85-
additional_dependencies: [black==25.*]
86-
87-
# Format configuration files with prettier
88-
- repo: https://github.com/rbubley/mirrors-prettier
89-
rev: v3.8.1
90-
hooks:
91-
- id: prettier
92-
types_or: [yaml, markdown, html, css, scss, javascript, json]
144+
language: python
145+
additional_dependencies: [black==26.*]
146+
priority: 2
93147

94-
# Check static types with mypy
148+
## Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
95149
- repo: https://github.com/pre-commit/mirrors-mypy
96150
rev: v1.19.1
97151
hooks:
@@ -106,57 +160,4 @@ repos:
106160
- pandas-stubs
107161
- mqt-core
108162
- mqt-bench>=2.0.1
109-
110-
# Check for spelling
111-
- repo: https://github.com/adhtruong/mirrors-typos
112-
rev: v1.42.3
113-
hooks:
114-
- id: typos
115-
116-
# Catch common capitalization mistakes
117-
- repo: local
118-
hooks:
119-
- id: disallow-caps
120-
name: Disallow improper capitalization
121-
language: pygrep
122-
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
123-
exclude: .pre-commit-config.yaml|\.pkl$|\.zip$|\.json$
124-
125-
# Check best practices for scientific Python code
126-
- repo: https://github.com/scientific-python/cookie
127-
rev: 2025.11.21
128-
hooks:
129-
- id: sp-repo-review
130-
additional_dependencies: ["repo-review[cli]"]
131-
132-
# Check JSON schemata
133-
- repo: https://github.com/python-jsonschema/check-jsonschema
134-
rev: 0.36.1
135-
hooks:
136-
- id: check-dependabot
137-
- id: check-github-workflows
138-
- id: check-readthedocs
139-
140-
# Check the pyproject.toml file
141-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
142-
rev: 2026.01.22
143-
hooks:
144-
- id: validate-pyproject
145-
146-
# Tidy up BibTeX files
147-
- repo: https://github.com/FlamingTempura/bibtex-tidy
148-
rev: v1.14.0
149-
hooks:
150-
- id: bibtex-tidy
151-
args:
152-
[
153-
"--align=20",
154-
"--curly",
155-
"--months",
156-
"--blank-lines",
157-
"--sort",
158-
"--strip-enclosing-braces",
159-
"--sort-fields",
160-
"--trailing-commas",
161-
"--remove-empty-fields",
162-
]
163+
priority: 3

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ aer = "aer"
261261
ignore = [
262262
"GH200", # We use Renovate instead of Dependabot
263263
"PC160", # We use a mirror of crate-ci/typos
264+
"PC170", # We do not use rST files anymore
264265
]
265266

266267

0 commit comments

Comments
 (0)