Skip to content

Commit 1b55147

Browse files
⬆️ Update runners and prek checks (#132)
## 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] 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. --------- Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
1 parent f5b517a commit 1b55147

File tree

5 files changed

+93
-103
lines changed

5 files changed

+93
-103
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
[
3333
ubuntu-24.04,
3434
ubuntu-24.04-arm,
35+
macos-15,
3536
macos-15-intel,
36-
macos-14,
37-
windows-2022,
37+
windows-2025,
3838
]
3939
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
4040
with:
@@ -78,7 +78,7 @@ jobs:
7878
- python-linter
7979
- build-sdist
8080
- build-wheel
81-
runs-on: ubuntu-latest
81+
runs-on: ubuntu-slim
8282
steps:
8383
- name: Decide whether the needed jobs succeeded or failed
8484
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: 87 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,82 @@
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"
15+
skip: [mypy]
1416

1517
repos:
16-
# Standard hooks
18+
# Priority 0: Fast validation and independent fixers
19+
20+
## Standard hooks
1721
- repo: https://github.com/pre-commit/pre-commit-hooks
1822
rev: v6.0.0
1923
hooks:
20-
- id: check-added-large-files
21-
args: ["--maxkb=2048"]
22-
- id: check-case-conflict
23-
- id: check-vcs-permalinks
2424
- id: check-merge-conflict
25-
- id: check-symlinks
26-
- id: check-json
27-
- id: check-toml
28-
- id: check-yaml
29-
- id: debug-statements
25+
priority: 0
3026
- id: end-of-file-fixer
31-
- id: mixed-line-ending
27+
priority: 1
3228
- id: trailing-whitespace
29+
priority: 1
3330

34-
# Clean jupyter notebooks
35-
- repo: https://github.com/srstevenson/nb-clean
36-
rev: 4.0.1
37-
hooks:
38-
- id: nb-clean
39-
args:
40-
- --remove-empty-cells
41-
- --preserve-cell-metadata
42-
- raw_mimetype
43-
- --
44-
45-
# Handling unwanted unicode characters
46-
- repo: https://github.com/sirosen/texthooks
47-
rev: 0.7.1
48-
hooks:
49-
- id: fix-ligatures
50-
- id: fix-smartquotes
51-
52-
# Check for common mistakes
53-
- repo: https://github.com/pre-commit/pygrep-hooks
54-
rev: v1.10.0
55-
hooks:
56-
- id: rst-backticks
57-
- id: rst-directive-colons
58-
- id: rst-inline-touching-normal
59-
60-
# Ensure uv lock file is up-to-date
61-
- repo: https://github.com/astral-sh/uv-pre-commit
62-
rev: 0.9.28
63-
hooks:
64-
- id: uv-lock
65-
66-
# Python linting using ruff
67-
- repo: https://github.com/astral-sh/ruff-pre-commit
68-
rev: v0.14.14
69-
hooks:
70-
- id: ruff-check
71-
- id: ruff-format
72-
73-
# Static type checking using mypy
74-
- repo: https://github.com/pre-commit/mirrors-mypy
75-
rev: v1.19.1
31+
## Check the pyproject.toml file
32+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
33+
rev: 2026.01.22
7634
hooks:
77-
- id: mypy
78-
files: ^^(src/mqt|tests|noxfile.py)
79-
args: []
80-
additional_dependencies:
81-
- matplotlib
82-
- nox
83-
- more_itertools
84-
- types-networkx
35+
- id: validate-pyproject
36+
priority: 0
8537

86-
# Also run Black on examples in the documentation
87-
- repo: https://github.com/adamchainz/blacken-docs
88-
rev: 1.20.0
38+
## Check JSON schemata
39+
- repo: https://github.com/python-jsonschema/check-jsonschema
40+
rev: 0.36.1
8941
hooks:
90-
- id: blacken-docs
91-
additional_dependencies: [black==25.*]
42+
- id: check-github-workflows
43+
priority: 0
44+
- id: check-readthedocs
45+
priority: 0
9246

93-
# Format configuration files with prettier
94-
- repo: https://github.com/rbubley/mirrors-prettier
95-
rev: v3.8.1
47+
## Catch common capitalization mistakes
48+
- repo: local
9649
hooks:
97-
- id: prettier
98-
types_or: [yaml, markdown, html, css, scss, javascript, json]
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|.*\.png)$
55+
priority: 0
9956

100-
# Check for spelling
57+
## Check for spelling
10158
- repo: https://github.com/adhtruong/mirrors-typos
10259
rev: v1.42.3
10360
hooks:
10461
- id: typos
62+
priority: 0
10563

106-
# Catch common capitalization mistakes
107-
- repo: local
108-
hooks:
109-
- id: disallow-caps
110-
name: Disallow improper capitalization
111-
language: pygrep
112-
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum|MQTopt|MQTref
113-
exclude: .pre-commit-config.yaml|^docs/_static
114-
115-
# Check best practices for scientific Python code
64+
## Check best practices for scientific Python code
11665
- repo: https://github.com/scientific-python/cookie
11766
rev: 2025.11.21
11867
hooks:
11968
- id: sp-repo-review
12069
additional_dependencies: ["repo-review[cli]"]
70+
priority: 0
12171

122-
# Check JSON schemata
123-
- repo: https://github.com/python-jsonschema/check-jsonschema
124-
rev: 0.36.1
125-
hooks:
126-
- id: check-dependabot
127-
- id: check-github-workflows
128-
- id: check-readthedocs
129-
130-
# Check the pyproject.toml file
131-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
132-
rev: 2026.01.22
72+
## Ensure uv lock file is up-to-date
73+
- repo: https://github.com/astral-sh/uv-pre-commit
74+
rev: 0.9.28
13375
hooks:
134-
- id: validate-pyproject
76+
- id: uv-lock
77+
priority: 0
13578

136-
# Tidy up BibTeX files
79+
## Tidy up BibTeX files
13780
- repo: https://github.com/FlamingTempura/bibtex-tidy
13881
rev: v1.14.0
13982
hooks:
@@ -150,3 +93,49 @@ repos:
15093
"--trailing-commas",
15194
"--remove-empty-fields",
15295
]
96+
priority: 0
97+
98+
# Priority 1: Second-pass fixers
99+
100+
## Format configuration files with prettier
101+
- repo: https://github.com/rbubley/mirrors-prettier
102+
rev: v3.8.1
103+
hooks:
104+
- id: prettier
105+
types_or: [yaml, markdown, html, css, scss, javascript, json]
106+
priority: 1
107+
108+
## Python linting using ruff
109+
- repo: https://github.com/astral-sh/ruff-pre-commit
110+
rev: v0.14.14
111+
hooks:
112+
- id: ruff-format
113+
priority: 1
114+
- id: ruff-check
115+
require_serial: true
116+
priority: 2
117+
118+
# Priority 2+: Final checks and fixers
119+
120+
## Also run Black on examples in the documentation (needs to run after ruff format)
121+
- repo: https://github.com/adamchainz/blacken-docs
122+
rev: 1.20.0
123+
hooks:
124+
- id: blacken-docs
125+
language: python
126+
additional_dependencies: [black==26.*]
127+
priority: 2
128+
129+
## Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
130+
- repo: https://github.com/pre-commit/mirrors-mypy
131+
rev: v1.19.1
132+
hooks:
133+
- id: mypy
134+
files: ^(src/mqt|tests|noxfile.py)
135+
args: []
136+
additional_dependencies:
137+
- matplotlib
138+
- nox
139+
- more_itertools
140+
- types-networkx
141+
priority: 3

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ ket = "ket"
133133
ignore = [
134134
"GH200", # We use Renovate instead of Dependabot
135135
"PC160", # We use a mirror of crate-ci/typos
136+
"PC170", # We do not use rST files anymore
136137
]
137138

138139

0 commit comments

Comments
 (0)