Skip to content

Commit bc2a69c

Browse files
authored
🔧 Modernize DX and configuration (#280)
## Description This PR modernizes the developer experience and updates configurations to support current tooling standards. ## 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 41382bf commit bc2a69c

File tree

4 files changed

+155
-75
lines changed

4 files changed

+155
-75
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ repos:
1919
rev: v6.0.0
2020
hooks:
2121
- id: check-added-large-files
22+
args: ["--maxkb=2048"]
2223
- id: check-case-conflict
23-
- id: check-docstring-first
24+
- id: check-vcs-permalinks
2425
- id: check-merge-conflict
26+
- id: check-symlinks
27+
- id: check-json
2528
- id: check-toml
2629
- id: check-yaml
2730
- id: debug-statements
@@ -55,12 +58,17 @@ repos:
5558
- id: rst-directive-colons
5659
- id: rst-inline-touching-normal
5760

61+
# Ensure uv lock file is up-to-date
62+
- repo: https://github.com/astral-sh/uv-pre-commit
63+
rev: 0.9.11
64+
hooks:
65+
- id: uv-lock
66+
5867
# Python linting and formatting using ruff
5968
- repo: https://github.com/astral-sh/ruff-pre-commit
6069
rev: v0.14.6
6170
hooks:
6271
- id: ruff-check
63-
args: ["--fix", "--show-fixes"]
6472
- id: ruff-format
6573

6674
# Also run Black on examples in the documentation

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def preserve_lockfile() -> Generator[None]:
5252
@nox.session(reuse_venv=True, default=True)
5353
def lint(session: nox.Session) -> None:
5454
"""Run the linter."""
55-
if shutil.which("pre-commit") is None:
56-
session.install("pre-commit")
55+
if shutil.which("prek") is None:
56+
session.install("prek")
5757

58-
session.run("pre-commit", "run", "--all-files", *session.posargs, external=True)
58+
session.run("prek", "run", "--all-files", *session.posargs, external=True)
5959

6060

6161
def _run_tests(

pyproject.toml

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -66,29 +66,28 @@ classifiers = [
6666

6767
[dependency-groups]
6868
docs = [
69-
"furo>=2024.8.6",
70-
"myst-nb>=1.2.0",
71-
"setuptools-scm>=8.2",
69+
"furo>=2025.09.25",
70+
"graphviz>=0.21.0",
71+
"myst-nb>=1.3.0",
72+
"setuptools-scm>=9.2.2",
73+
"sphinx>=8.1.3",
74+
"sphinx>=8.2.3; python_version >= '3.11'",
7275
"sphinx-autoapi>=3.6.0",
7376
"sphinx-copybutton>=0.5.2",
7477
"sphinx-design>=0.6.1",
75-
"sphinxcontrib-bibtex>=2.6.3",
78+
"sphinxcontrib-bibtex>=2.6.5",
7679
"sphinxcontrib-svg2pdfconverter>=1.3.0",
77-
"sphinxext-opengraph>=0.10.0",
78-
"graphviz>=0.20.3",
79-
"sphinx>=7.4.7",
80-
"sphinx>=8.1.3; python_version >= '3.10'",
81-
"sphinx>=8.2.3; python_version >= '3.11'",
80+
"sphinxext-opengraph>=0.13.0",
8281
]
8382
test = [
84-
"pytest>=8.3.5",
85-
"pytest-cov>=6.1.1",
86-
"pytest-sugar>=1.0.0",
87-
"pytest-xdist>=3.7.0",
83+
"pytest>=9.0.1",
84+
"pytest-cov>=7.0.0",
85+
"pytest-sugar>=1.1.1",
86+
"pytest-xdist>=3.8.0",
8887
]
8988
dev = [
90-
{include-group = "docs"},
9189
{include-group = "test"},
90+
"nox>=2025.11.12",
9291
]
9392

9493
[project.urls]
@@ -107,18 +106,16 @@ source = "vcs"
107106
version-file = "src/mqt/problemsolver/_version.py"
108107

109108

110-
[tool.pytest.ini_options]
111-
minversion = "7.2"
112-
testpaths = ["tests/"]
109+
[tool.pytest]
110+
minversion = "9.0"
111+
testpaths = ["tests"]
112+
strict = true
113113
addopts = [
114114
"-ra",
115-
"--strict-markers",
116-
"--strict-config",
117115
"--showlocals",
118-
"--numprocesses=auto", # Automatically use all available CPU cores for parallel testing
116+
"--numprocesses=auto", # Automatically use all available CPU cores for parallel testing
119117
]
120118
log_level = "INFO"
121-
xfail_strict = true
122119
filterwarnings = [
123120
"error",
124121
# Qiskit 2.1 internal deprecations
@@ -141,7 +138,6 @@ report.exclude_also = [
141138
'raise AssertionError',
142139
'raise NotImplementedError',
143140
]
144-
145141
show_missing = true
146142
skip_empty = true
147143
precision = 1
@@ -164,17 +160,22 @@ ignore_missing_imports = true
164160

165161
[tool.ruff]
166162
line-length = 120
167-
extend-include = ["resource_estimation"]
163+
namespace-packages = ["mqt"]
168164
preview = true
165+
fix = true
169166
unsafe-fixes = true
167+
show-fixes = true
168+
169+
[tool.ruff.format]
170+
docstring-code-format = true
170171

171172
[tool.ruff.lint]
172173
extend-select = [
173174
"A", # flake8-builtins
174175
"ANN", # flake8-annotations
175176
"ARG", # flake8-unused-arguments
176177
"ASYNC", # flake8-async
177-
"B", "B904", # flake8-bugbear
178+
"B", # flake8-bugbear
178179
"C4", # flake8-comprehensions
179180
"D", # pydocstyle
180181
"EM", # flake8-errmsg
@@ -207,10 +208,9 @@ extend-select = [
207208
"YTT", # flake8-2020
208209
]
209210
ignore = [
210-
"ISC001", # Conflicts with formatter
211-
"E501", # Line too long (Black is enough)
212-
"PLR", # Design related pylint codes
213-
"S101", # Use of assert detected
211+
"E501", # Line too long (Black is enough)
212+
"PLR", # Design-related pylint codes
213+
"S101", # Use of assert detected
214214
"D100",
215215
"D101",
216216
"D102",
@@ -235,6 +235,7 @@ known-first-party = ["mqt.problemsolver"]
235235
[tool.ruff.lint.pydocstyle]
236236
convention = "google"
237237

238+
238239
[tool.typos]
239240
default.extend-ignore-re = [
240241
'"id": ".*",',
@@ -255,4 +256,4 @@ aer = "aer"
255256

256257

257258
[tool.repo-review]
258-
ignore = ["GH200", "RTD100", "PY004"]
259+
ignore = ["GH200"]

0 commit comments

Comments
 (0)