Skip to content

Commit 1989680

Browse files
authored
⬆️ Update runners and prek checks (#620)
## 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.
1 parent 6159801 commit 1989680

File tree

6 files changed

+110
-108
lines changed

6 files changed

+110
-108
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
runs-on: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2022]
26+
runs-on: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-2025]
2727
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
2828
with:
2929
runs-on: ${{ matrix.runs-on }}
@@ -66,7 +66,7 @@ jobs:
6666
- python-linter
6767
- build-sdist
6868
- build-wheel
69-
runs-on: ubuntu-latest
69+
runs-on: ubuntu-slim
7070
steps:
7171
- name: Decide whether the needed jobs succeeded or failed
7272
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

.license-tools-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"uv\\.lock",
3333
".*\\.rst",
3434
"py\\.typed",
35-
".*build.*"
35+
".*build.*",
36+
".*\\.pkl"
3637
]
3738
}

.pre-commit-config.yaml

Lines changed: 103 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,89 @@
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
38-
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
49-
hooks:
50-
- id: fix-ligatures
51-
- id: fix-smartquotes
52-
53-
# Check for common mistakes
54-
- repo: https://github.com/pre-commit/pygrep-hooks
55-
rev: v1.10.0
56-
hooks:
57-
- id: rst-backticks
58-
- id: rst-directive-colons
59-
- id: rst-inline-touching-normal
60-
61-
# Ensure uv lock file is up-to-date
62-
- repo: https://github.com/astral-sh/uv-pre-commit
63-
rev: 0.9.28
64-
hooks:
65-
- id: uv-lock
66-
67-
# Python linting and formatting using ruff
68-
- repo: https://github.com/astral-sh/ruff-pre-commit
69-
rev: v0.14.14
70-
hooks:
71-
- id: ruff-check
72-
- id: ruff-format
73-
74-
# Also run Black on examples in the documentation
75-
- repo: https://github.com/adamchainz/blacken-docs
76-
rev: 1.20.0
77-
hooks:
78-
- id: blacken-docs
79-
additional_dependencies: [black==25.*]
80-
81-
# Check for license headers
82-
- repo: https://github.com/emzeat/mz-lictools
83-
rev: v2.9.0
84-
hooks:
85-
- id: license-tools
86-
exclude: \.pkl$
87-
88-
# Check static types with mypy
89-
- repo: https://github.com/pre-commit/mirrors-mypy
90-
rev: v1.19.1
91-
hooks:
92-
- id: mypy
93-
files: ^(src/mqt|tests|noxfile.py)
94-
args: []
95-
additional_dependencies:
96-
- nox
97-
- numpy
98-
- pytest
99-
- pytest-mock
100-
101-
# Check for spelling
102-
- repo: https://github.com/adhtruong/mirrors-typos
103-
rev: v1.42.3
31+
## Check the pyproject.toml file
32+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
33+
rev: 2026.01.22
10434
hooks:
105-
- id: typos
35+
- id: validate-pyproject
36+
priority: 0
10637

107-
# Format configuration files with prettier
108-
- repo: https://github.com/rbubley/mirrors-prettier
109-
rev: v3.8.1
38+
## Check JSON schemata
39+
- repo: https://github.com/python-jsonschema/check-jsonschema
40+
rev: 0.36.1
11041
hooks:
111-
- id: prettier
112-
types_or: [yaml, markdown, html, css, scss, javascript, json]
42+
- id: check-github-workflows
43+
priority: 0
44+
- id: check-readthedocs
45+
priority: 0
11346

114-
# Catch common capitalization mistakes
47+
## Catch common capitalization mistakes
11548
- repo: local
11649
hooks:
11750
- id: disallow-caps
11851
name: Disallow improper capitalization
11952
language: pygrep
120-
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
53+
entry: '\b(?:Numpy|Github|PyTest|Mqt|Tum)\b'
12154
exclude: .pre-commit-config.yaml
55+
priority: 0
56+
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
12263

123-
# Check best practices for scientific Python code
64+
## Check best practices for scientific Python code
12465
- repo: https://github.com/scientific-python/cookie
12566
rev: 2025.11.21
12667
hooks:
12768
- id: sp-repo-review
12869
additional_dependencies: ["repo-review[cli]"]
70+
priority: 0
12971

130-
# Check JSON schemata
131-
- repo: https://github.com/python-jsonschema/check-jsonschema
132-
rev: 0.36.1
72+
## Check for license headers
73+
- repo: https://github.com/emzeat/mz-lictools
74+
rev: v2.9.0
13375
hooks:
134-
- id: check-dependabot
135-
- id: check-github-workflows
136-
- id: check-readthedocs
76+
- id: license-tools
77+
priority: 0
13778

138-
# Check the pyproject.toml file
139-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
140-
rev: 2026.01.22
79+
## Ensure uv lock file is up-to-date
80+
- repo: https://github.com/astral-sh/uv-pre-commit
81+
rev: 0.9.28
14182
hooks:
142-
- id: validate-pyproject
83+
- id: uv-lock
84+
priority: 0
14385

144-
# Tidy up BibTeX files
86+
## Tidy up BibTeX files
14587
- repo: https://github.com/FlamingTempura/bibtex-tidy
14688
rev: v1.14.0
14789
hooks:
@@ -158,3 +100,61 @@ repos:
158100
"--trailing-commas",
159101
"--remove-empty-fields",
160102
]
103+
priority: 0
104+
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
116+
- repo: https://github.com/astral-sh/ruff-pre-commit
117+
rev: v0.14.14
118+
hooks:
119+
- 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
126+
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)
140+
- repo: https://github.com/adamchainz/blacken-docs
141+
rev: 1.20.0
142+
hooks:
143+
- id: blacken-docs
144+
language: python
145+
additional_dependencies: [black==26.*]
146+
priority: 2
147+
148+
## Static type checking using mypy (needs to run after lockfile update/ruff format, and ruff lint)
149+
- repo: https://github.com/pre-commit/mirrors-mypy
150+
rev: v1.19.1
151+
hooks:
152+
- id: mypy
153+
files: ^(src/mqt|tests|noxfile.py)
154+
args: []
155+
additional_dependencies:
156+
- nox
157+
- numpy
158+
- pytest
159+
- pytest-mock
160+
priority: 3

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ nd = "nd"
255255
ignore = [
256256
"GH200", # We use Renovate instead of Dependabot
257257
"PC160", # We use a mirror of crate-ci/typos
258+
"PC170", # We do not use rST files anymore
258259
]
259260

260261

0 commit comments

Comments
 (0)