The example now provides a single mymath demo library with two independent ways to create bindings: SWIG and pybind11.
The packaging structure is the following:
The packaging process produces a single mymath package that can be uploaded to PyPI
The package contains two modules: mymath_swig and mymath_pybind11 that can be imported and tested
It is a bit odd but it's the only way to share the C++ library while showing both systems. In most cases, only one of two between SWIG and pybind11 are used, and it's simple to just remove what is not used.
It also shows that multiple CMakeExtension entries can be used in setup.py.
The example now provides a single
mymath
demo library with two independent ways to create bindings: SWIG and pybind11.The packaging structure is the following:
mymath
package that can be uploaded to PyPImymath_swig
andmymath_pybind11
that can be imported and testedIt is a bit odd but it's the only way to share the C++ library while showing both systems. In most cases, only one of two between SWIG and pybind11 are used, and it's simple to just remove what is not used.
It also shows that multiple
CMakeExtension
entries can be used insetup.py
.