Skip to content

Commit a462ea5

Browse files
authored
♻️ Replace pybind11 with nanobind (#248)
* Update mqt-core * Replace pybind11 with nanobind * Enable Stable ABI wheels * Auto-generate stub file * Ignore linter errors * Clean up docstrings * Simplify ExternalDependencies.cmake * Improve stubs session
1 parent f88c15b commit a462ea5

File tree

18 files changed

+603
-596
lines changed

18 files changed

+603
-596
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
clang-version: 20
8989
cmake-args: -DBUILD_MQT_DEBUGGER_BINDINGS=ON
9090
files-changed-only: true
91-
install-pkgs: "pybind11==3.0.1"
91+
install-pkgs: "nanobind==2.10.2"
9292
setup-python: true
9393
cpp-linter-extra-args: "-std=c++20"
9494

@@ -125,6 +125,8 @@ jobs:
125125
needs: change-detection
126126
if: fromJSON(needs.change-detection.outputs.run-python-tests)
127127
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
128+
with:
129+
check-stubs: true
128130

129131
build-sdist:
130132
name: 🚀 CD

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ if(BUILD_MQT_DEBUGGER_BINDINGS)
4242
CACHE BOOL "Prevent multiple searches for Python and instead cache the results.")
4343

4444
# top-level call to find Python
45-
find_package(
46-
Python 3.10 REQUIRED
47-
COMPONENTS Interpreter Development.Module
48-
OPTIONAL_COMPONENTS Development.SABIModule)
45+
find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module
46+
${SKBUILD_SABI_COMPONENT})
4947
endif()
5048

5149
include(cmake/ExternalDependencies.cmake)

bindings/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Licensed under the MIT License
77

8-
add_mqt_python_binding(
8+
add_mqt_python_binding_nanobind(
99
DEBUGGER
1010
${MQT_DEBUGGER_TARGET_NAME}-bindings
1111
bindings.cpp
@@ -16,5 +16,4 @@ add_mqt_python_binding(
1616
INSTALL_DIR
1717
.
1818
LINK_LIBS
19-
MQT::Debugger
20-
pybind11_json)
19+
MQT::Debugger)

0 commit comments

Comments
 (0)