Skip to content

Commit ae8c631

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

File tree

6 files changed

+94
-104
lines changed

6 files changed

+94
-104
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, macos-14, windows-2022]
26+
runs-on: [ubuntu-24.04, 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 }}
@@ -69,7 +69,7 @@ jobs:
6969
- python-linter
7070
- build-sdist
7171
- build-wheel
72-
runs-on: ubuntu-latest
72+
runs-on: ubuntu-slim
7373
steps:
7474
- name: Decide whether the needed jobs succeeded or failed
7575
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
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
contents: write
1717
pull-requests: write
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-slim
1919
steps:
2020
- uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
2121
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: 89 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +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: [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
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
31+
## Check the pyproject.toml file
32+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
33+
rev: 2026.01.22
8434
hooks:
85-
- id: license-tools
35+
- id: validate-pyproject
36+
priority: 0
8637

87-
# Format configuration files with prettier
88-
- repo: https://github.com/rbubley/mirrors-prettier
89-
rev: v3.8.1
38+
## Check JSON schemata
39+
- repo: https://github.com/python-jsonschema/check-jsonschema
40+
rev: 0.36.1
9041
hooks:
91-
- id: prettier
92-
types_or: [yaml, markdown, html, css, scss, javascript, json]
42+
- id: check-github-workflows
43+
priority: 0
44+
- id: check-readthedocs
45+
priority: 0
9346

94-
# Static type checking using ty
47+
## Catch common capitalization mistakes
9548
- repo: local
9649
hooks:
97-
- id: ty-check
98-
name: ty check
99-
entry: uv run ty check
100-
language: unsupported
101-
require_serial: true
102-
types_or: [python, pyi, jupyter]
103-
exclude: ^(docs/)
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
55+
priority: 0
10456

105-
# Check for spelling
57+
## Check for spelling
10658
- repo: https://github.com/adhtruong/mirrors-typos
10759
rev: v1.42.3
10860
hooks:
10961
- id: typos
62+
priority: 0
11063

111-
# Catch common capitalization mistakes
112-
- repo: local
113-
hooks:
114-
- id: disallow-caps
115-
name: Disallow improper capitalization
116-
language: pygrep
117-
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
118-
exclude: \.pre-commit-config\.yaml|\.joblib$
119-
120-
# Check best practices for scientific Python code
64+
## Check best practices for scientific Python code
12165
- repo: https://github.com/scientific-python/cookie
12266
rev: 2025.11.21
12367
hooks:
12468
- id: sp-repo-review
12569
additional_dependencies: ["repo-review[cli]"]
70+
priority: 0
12671

127-
# Check JSON schemata
128-
- repo: https://github.com/python-jsonschema/check-jsonschema
129-
rev: 0.36.1
72+
## Check for license headers
73+
- repo: https://github.com/emzeat/mz-lictools
74+
rev: v2.9.0
13075
hooks:
131-
- id: check-dependabot
132-
- id: check-github-workflows
133-
- id: check-readthedocs
76+
- id: license-tools
77+
priority: 0
13478

135-
# Check the pyproject.toml file
136-
- repo: https://github.com/henryiii/validate-pyproject-schema-store
137-
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
13882
hooks:
139-
- id: validate-pyproject
83+
- id: uv-lock
84+
priority: 0
14085

141-
# Tidy up BibTeX files
86+
## Tidy up BibTeX files
14287
- repo: https://github.com/FlamingTempura/bibtex-tidy
14388
rev: v1.14.0
14489
hooks:
@@ -155,3 +100,48 @@ repos:
155100
"--trailing-commas",
156101
"--remove-empty-fields",
157102
]
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+
## Also run Black on examples in the documentation (needs to run after ruff format)
128+
- repo: https://github.com/adamchainz/blacken-docs
129+
rev: 1.20.0
130+
hooks:
131+
- id: blacken-docs
132+
language: python
133+
additional_dependencies: [black==26.*]
134+
priority: 2
135+
136+
## Static type checking using ty (needs to run after lockfile update/ruff format, and ruff lint)
137+
- repo: local
138+
hooks:
139+
- id: ty-check
140+
name: ty check
141+
entry: uv run ty check
142+
language: unsupported
143+
require_serial: true
144+
types_or: [python, pyi, jupyter]
145+
exclude: ^(docs/)
146+
pass_filenames: false
147+
priority: 3

noxfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def minimums(session: nox.Session) -> None:
106106
)
107107
env = {"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}
108108
session.run("uv", "tree", "--frozen", env=env)
109-
session.run("uv", "lock", "--refresh", env=env)
110109

111110

112111
@nox.session(reuse_venv=True)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ ignore = [
249249
"MY100", # We use ty instead of mypy
250250
"PC140", # We use ty instead of mypy
251251
"PC160", # We use a mirror of crate-ci/typos
252+
"PC170", # We do not use rST files anymore
252253
]
253254

254255

0 commit comments

Comments
 (0)