pybind/python_example

[Question] Modifying setup.py with pybind used in a submodule

HunterStephens opened this issue · 2 comments

If I have a module built with pybind as sub-module how would my already constructed setup.py incorporate this? For example, my package is structured like this.

\--package_home
         setup.py
         \--base_package
                 __init__.py
                 a1.py
                 a2.py
                 \--sub_package
                          __init__.py
                          [pybind .so module would go here]
                          b1.py
                          

You'd just use the full dotted path for the submodule name.

@henryiii Could you clarify / make an example with a mixed python/c++ module with pybind?

I assume I would modify the setup.py to specify the folder containing the python package as "packages = X". Would ext_modules automatically end up in the root of that package folder?

I guess I can just verify this myself.

EDIT: So this works, but the name needs to have the relpath, as you write above.