Skip to content

Commit 3eb8e2f

Browse files
authored
♻️ Auto-generate stub file (#831)
## Description After we have switched from `pybind11` to `nanobind` in #817, we can now auto-generate the stub file. This PR defines a corresponding `nox` session and copies over all existing docstrings to the bindings code. ## 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 cad5355 commit 3eb8e2f

20 files changed

+1156
-623
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ jobs:
199199
if: fromJSON(needs.change-detection.outputs.run-python-tests)
200200
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
201201
with:
202-
enable-ty: true
202+
check-stubs: true
203203
enable-mypy: false
204+
enable-ty: true
204205

205206
build-sdist:
206207
name: 🚀 CD

.license-tools-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
".*\\.profile",
3535
"uv\\.lock",
3636
"py\\.typed",
37-
".*build.*"
37+
".*build.*",
38+
"qcec_patterns.txt"
3839
]
3940
}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
1111

1212
### Changed
1313

14+
- ♻️ Auto-generate `pyqcec.pyi` via `nanobind.stubgen` ([#831]) ([**@denialhaag**])
1415
- 🔧 Replace `mypy` with `ty` ([#775], [#825]) ([**@denialhaag**])
1516

1617
## [3.4.0] - 2026-01-13
@@ -124,6 +125,7 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._
124125

125126
<!-- PR links -->
126127

128+
[#831]: https://github.com/munich-quantum-toolkit/qcec/pull/831
127129
[#825]: https://github.com/munich-quantum-toolkit/qcec/pull/825
128130
[#817]: https://github.com/munich-quantum-toolkit/qcec/pull/817
129131
[#796]: https://github.com/munich-quantum-toolkit/qcec/pull/796

UPGRADING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This document describes breaking changes and how to upgrade. For a complete list
44

55
## [Unreleased]
66

7+
To comply with established guidelines for attribute names, `mqt.qcec.pyqcec.StateType.random_1Q_basis` has been renamed to `random_1q_basis`.
8+
79
## [3.4.0]
810

911
### Python wheels

bindings/application_scheme.cpp

Lines changed: 0 additions & 39 deletions
This file was deleted.

bindings/bindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ namespace nb = nanobind;
1616
using namespace nb::literals;
1717

1818
// forward declarations
19-
void registerApplicationSchema(const nb::module_& m);
19+
void registerApplicationScheme(const nb::module_& m);
2020
void registerConfiguration(const nb::module_& m);
2121
void registerEquivalenceCheckingManager(const nb::module_& m);
2222
void registerEquivalenceCriterion(const nb::module_& m);
2323
void registerStateType(const nb::module_& m);
2424

2525
// NOLINTNEXTLINE(performance-unnecessary-value-param)
2626
NB_MODULE(MQT_QCEC_MODULE_NAME, m) {
27-
registerApplicationSchema(m);
27+
registerApplicationScheme(m);
2828
registerConfiguration(m);
2929
registerEquivalenceCheckingManager(m);
3030
registerEquivalenceCriterion(m);

bindings/configuration.cpp

Lines changed: 0 additions & 120 deletions
This file was deleted.

bindings/equivalence_checking_manager.cpp

Lines changed: 0 additions & 120 deletions
This file was deleted.

bindings/equivalence_criterion.cpp

Lines changed: 0 additions & 36 deletions
This file was deleted.

bindings/qcec_patterns.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_hashable_values_:
2+
3+
_unhashable_values_map_:

0 commit comments

Comments
 (0)