You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request updates the files in this repository with the latest
changes from the MQT Templates repository.
For details on the respective changes, see the
[changelog](https://github.com/munich-quantum-toolkit/templates/blob/main/CHANGELOG.md)
as well as the [upgrade
guide](https://github.com/munich-quantum-toolkit/templates/blob/main/UPGRADING.md).
> [!NOTE]
> This pull request may contain merge conflicts if there have been
changes to a templated file and its template.
> Resolve such conflicts manually before merging the pull request.
---------
Co-authored-by: mqt-app[bot] <219534693+mqt-app[bot]@users.noreply.github.com>
Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/contributing.md
+60-12Lines changed: 60 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
# Contributing
5
5
6
6
Thank you for your interest in contributing to MQT QCEC!
7
-
This document outlines how to contribute and the development guidelines.
7
+
This document outlines the development guidelines and how to contribute.
8
8
9
9
We use GitHub to [host code](https://github.com/munich-quantum-toolkit/qcec), to [track issues and feature requests][issues], as well as accept [pull requests](https://github.com/munich-quantum-toolkit/qcec/pulls).
10
10
See <https://docs.github.com/en/get-started/quickstart> for a general introduction to working with GitHub and contributing to projects.
@@ -92,6 +92,44 @@ Please adhere to the following guidelines to help the project grow sustainably.
92
92
- Do not squash commits locally; maintainers typically squash on merge.
93
93
Avoid rebasing or force-pushing before reviews; you may rebase after addressing feedback if desired.
94
94
95
+
### Working with CodeRabbit
96
+
97
+
We use [CodeRabbit](https://www.coderabbit.ai/) for automated code review on pull requests.
98
+
To get the most out of it and help the project maintain its high ambitions for code quality, please follow these practices:
99
+
100
+
-**Draft PRs**:
101
+
CodeRabbit runs on every push to non-draft PRs.
102
+
If you are still experimenting, mark your PR as a draft so that the automated review only runs when you are ready for feedback.
103
+
-**Respond to comments**:
104
+
Do not simply resolve CodeRabbit's comments without answering them.
105
+
It learns from your replies and improves over time.
106
+
If a suggestion does not apply, take a moment to explain why in a reply.
107
+
-**Avoid multiple AI review bots**:
108
+
CodeRabbit performs significantly worse when other AI review bots (e.g., GitHub Copilot) are active on the same PR.
109
+
For the best results, do not tag Copilot unless you have already iterated with CodeRabbit and want an extra pass.
110
+
-**Engage CodeRabbit in discussions**:
111
+
When team members are discussing code in PR comments, CodeRabbit stays silent by default.
112
+
Tag {code}`@coderabbitai` to engage it in the conversation and get its feedback on the specific points being discussed.
113
+
In particular, when you tag another person in a comment, ensure to also tag CodeRabbit.
114
+
Otherwise, you will just get an automatic "It seems like the humans are having a chat" response from CodeRabbit anyway, which does not add much value.
115
+
-**Let CodeRabbit resolve comments**:
116
+
Wait until after the next push before considering resolving CodeRabbit's comments manually.
117
+
CodeRabbit will automatically resolve comments that it thinks have been addressed by your changes.
118
+
Sometimes, it gets stuck, at which point you may resolve it manually.
119
+
-**Manual review on drafts**:
120
+
You can trigger a full review on a draft PR by commenting with {code}`@coderabbitai full review`.
121
+
-**Continuing after reviews are paused**:
122
+
CodeRabbit has a default threshold for the number of reviews it performs on a PR before pausing further reviews to avoid spamming.
123
+
If you want to resume reviews, you can ask CodeRabbit to resume by commenting with {code}`@coderabbitai resume`.
124
+
Note that this will not trigger a review immediately; it will just allow CodeRabbit to perform reviews on the next push or manual trigger.
125
+
126
+
### Use of AI and LLMs
127
+
128
+
Contributions may be prepared with the help of AI or LLM tools.
129
+
However, [AI Slop](https://en.wikipedia.org/wiki/AI_slop)—generic, low-value, or clearly machine-generated content that does not meet our standards for clarity, accuracy, or usefulness—is not acceptable.
130
+
Ensure that all text, code, and documentation you submit are accurate, relevant, and consistent with the project's style and guidelines.
131
+
Please be mindful of the maintainers' time and consider the impact of your contributions on the project's long-term success.
132
+
95
133
## Get Started 🎉
96
134
97
135
Ready to contribute?
@@ -110,9 +148,9 @@ As of August 2025, our CI pipeline on GitHub continuously tests the library acro
110
148
111
149
- {code}`ubuntu-24.04`: {code}`Release` and {code}`Debug` builds using {code}`gcc`
112
150
- {code}`ubuntu-24.04-arm`: {code}`Release` build using {code}`gcc`
151
+
- {code}`macos-15`: {code}`Release` and {code}`Debug` builds using {code}`AppleClang`
113
152
- {code}`macos-15-intel`: {code}`Release` build using {code}`AppleClang`
114
-
- {code}`macos-14`: {code}`Release` and {code}`Debug` builds using {code}`AppleClang`
115
-
- {code}`windows-2022`: {code}`Release` and {code}`Debug` builds using {code}`msvc`
153
+
- {code}`windows-2025`: {code}`Release` and {code}`Debug` builds using {code}`msvc`
116
154
- {code}`windows-11-arm`: {code}`Release` build using {code}`msvc`
117
155
118
156
To access the latest build logs, visit the [GitHub Actions page](https://github.com/munich-quantum-toolkit/qcec/actions/workflows/ci.yml).
@@ -253,14 +291,14 @@ See {ref}`working-on-documentation` for more information on how to build the doc
253
291
254
292
## Working on the Python Package
255
293
256
-
We use [{code}`pybind11`](https://pybind11.readthedocs.io/en/stable) to expose large parts of the C++ core library to Python.
294
+
We use [{code}`nanobind`](https://nanobind.readthedocs.io/) to expose large parts of the C++ core library to Python.
257
295
This allows us to keep the performance-critical parts of the code in C++ while providing a convenient interface for Python users.
258
296
All code related to C++-Python bindings is contained in the {code}`bindings` directory.
259
297
260
298
:::{tip}
261
299
262
300
To build only the Python bindings, pass {code}`-DBUILD_MQT_QCEC_BINDINGS=ON` to the CMake configure step.
263
-
CMake will then try to find Python and the necessary dependencies ({code}`pybind11`) on your system and configure the respective targets.
301
+
CMake will then try to find Python and the necessary dependencies ({code}`nanobind`) on your system and configure the respective targets.
264
302
In [CLion][clion], you can enable an option to pass the current Python interpreter to CMake.
265
303
Go to {code}`Preferences` -> {code}`Build, Execution, Deployment` -> {code}`CMake` -> {code}`Python Integration` and check the box {code}`Pass Python Interpreter to CMake`.
266
304
Alternatively, you can pass {code}`-DPython_ROOT_DIR=<PATH_TO_PYTHON>` to the configure step to point CMake to a specific Python installation.
@@ -275,12 +313,13 @@ We recommend using [{code}`nox`][nox] for development.
275
313
{code}`nox` is a Python automation tool that allows you to define tasks in a {code}`noxfile.py` file and then run them with a single command.
276
314
If you have not installed it yet, see our {ref}`installation guide for developers <development-setup>`.
277
315
278
-
We define four convenient {code}`nox` sessions in our {code}`noxfile.py`:
316
+
We define some convenient {code}`nox` sessions in our {code}`noxfile.py`:
279
317
280
318
- {code}`tests` to run the Python tests
281
319
- {code}`minimums` to run the Python tests with the minimum dependencies
282
320
- {code}`lint` to run the Python code formatting and linting
283
321
- {code}`docs` to build the documentation
322
+
- {code}`stubs` to regenerate the type stub files for the Python bindings
284
323
285
324
These are explained in more detail in the following sections.
286
325
@@ -301,7 +340,7 @@ We take extra care to install the project without build isolation so that rebuil
301
340
If you only want to run the tests on a specific Python version, you can pass the desired Python version to the {code}`nox` command.
302
341
303
342
```console
304
-
$ nox -s tests-3.12
343
+
$ nox -s tests-3.14
305
344
```
306
345
307
346
:::{note}
@@ -328,12 +367,12 @@ The Python code is formatted and linted using a collection of [{code}`pre-commit
328
367
This collection includes
329
368
330
369
-[ruff][ruff], an extremely fast Python linter and formatter written in Rust, and
331
-
-[mypy][mypy], a static type checker for Python code.
370
+
-[ty][ty], Astral's type checker for Python.
332
371
333
372
The hooks can be installed by running the following command in the root directory:
334
373
335
374
```console
336
-
$ pre-commit install
375
+
$ prek install
337
376
```
338
377
339
378
This will install the hooks in the {code}`.git/hooks` directory of the repository.
@@ -347,10 +386,10 @@ $ nox -s lint
347
386
348
387
:::{note}
349
388
350
-
If you do not want to use {code}`nox`, you can also run the hooks manually by using {code}`pre-commit`.
389
+
If you do not want to use {code}`nox`, you can also run the hooks manually by using {code}`prek`.
351
390
352
391
```console
353
-
$ pre-commit run --all-files
392
+
$ prek run --all-files
354
393
```
355
394
356
395
:::
@@ -363,6 +402,13 @@ Every public function, class, and module should have a docstring that explains w
363
402
364
403
We heavily rely on [type hints](https://docs.python.org/3/library/typing.html) to document the expected types of function arguments and return values.
365
404
For the compiled parts of the code base, we provide type hints in the form of stub files in the {code}`python/mqt/qcec` directory.
405
+
These stub files are auto-generated.
406
+
Do not edit them directly.
407
+
Instead, you can use the {code}`nox` session {code}`stubs` to regenerate them automatically.
408
+
409
+
```console
410
+
nox -s stubs
411
+
```
366
412
367
413
The Python API documentation is integrated into the overall documentation that we host on ReadTheDocs using the
368
414
[{code}`sphinx-autoapi`](https://sphinx-autoapi.readthedocs.io/en/latest/) extension for Sphinx.
@@ -408,6 +454,7 @@ Here are some tips for finding the cause of certain failures:
408
454
409
455
- If any of the {code}`CI / 🇨 Test` checks fail, this indicates build errors or test failures in the C++ part of the code base.
410
456
Look through the respective logs on GitHub for any error or failure messages.
457
+
411
458
- If any of the {code}`CI / 🐍 Test` checks fail, this indicates build errors or test failures in the Python part of the code base.
412
459
Look through the respective logs on GitHub for any error or failure messages.
413
460
@@ -420,6 +467,7 @@ Here are some tips for finding the cause of certain failures:
420
467
421
468
- If the {code}`pre-commit.ci` check fails, some of the {code}`pre-commit` checks failed and could not be fixed automatically by the _pre-commit.ci_ bot.
422
469
The individual log messages frequently provide helpful suggestions on how to fix the warnings.
470
+
423
471
- If the {code}`docs/readthedocs.org:\*` check fails, the documentation could not be built properly.
424
472
Inspect the corresponding log file for any errors.
425
473
@@ -493,7 +541,7 @@ Afterward, navigate to the [Releases page](https://github.com/munich-quantum-too
0 commit comments