When building the Python package from the pyproject.toml file, no stubs are generated. This means that there is no autocomplete or type checking. With the following modifications stubs would be automatically generated:
cmake.targets = ["python_ruckig"] -> cmake.targets = ["python_ruckig", "ruckig_stub"]
Add:
nanobind_add_stub(
ruckig_stub
MODULE ruckig
OUTPUT ${CMAKE_INSTALL_PREFIX}/ruckig.pyi
PYTHON_PATH $<TARGET_FILE_DIR:python_ruckig>
DEPENDS python_ruckig
)
install(FILES ${CMAKE_INSTALL_PREFIX}/ruckig.pyi DESTINATION .)
to the if(BUILD_PYTHON_MODULE) section of CMakeLists.txt file
When building the Python package from the pyproject.toml file, no stubs are generated. This means that there is no autocomplete or type checking. With the following modifications stubs would be automatically generated:
cmake.targets = ["python_ruckig"] -> cmake.targets = ["python_ruckig", "ruckig_stub"]
Add:
nanobind_add_stub(
ruckig_stub
MODULE ruckig
OUTPUT ${CMAKE_INSTALL_PREFIX}/ruckig.pyi
PYTHON_PATH $<TARGET_FILE_DIR:python_ruckig>
DEPENDS python_ruckig
)
install(FILES ${CMAKE_INSTALL_PREFIX}/ruckig.pyi DESTINATION .)
to the if(BUILD_PYTHON_MODULE) section of CMakeLists.txt file