-
Hello, I’m using Nanobind and have created submodules with def_submodule. When I generate stub files (.pyi), only the symbols from the top-level module are included, while the submodules are missing. Additionally, one of my submodules (group_a) returns a type that is defined in another submodule (group_b). What is the recommended way to generate .pyi files that correctly capture all types and functions across the main module and its submodules? For context, the project is CMake-based, and I’m currently calling nanobind_add_stub() to produce the stub files. ChatGPT recommends running stubgen directly from CMake with the -r (recursive) option to generate stubs for the main module and all submodules. Is this considered the recommended approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The same or at least related issue was previously discussed here: #1028 When I last looked, submodules support seemed to be a bit incomplete. |
Beta Was this translation helpful? Give feedback.
This is resolved on
master
now, see the documentation example.