Compile a nanobind extension as part of a larger python package #799
Unanswered
OasisArtisan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a python project where I have defined a package with multiple submodules.
I want to compile the nanobind extension such that it can be imported using the same project structure.
Ex: Assume I already have the following python package structure.
Where I can import as
import fruits.apple.mod1
I want to be able to import
import fruits.apple.nanobindmod1
andimport fruits.orange.nanobindmod2
even though there is a single nanobind extension that was compiled.Basically how do I define the proper namespaces/scope in the nanobind cpp file or cmake to enable such behavior of logically separating functions into different submodules exposed to python ?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions