This package was generated by pyxt
to facilitate easy developments of C++ extesions (Pybind11) for Python.
All the boilerplate around CMake and compilation has been handled for you.
The package name is taction
.
The compiled extension is named _taction_ext
.
You can access the extension using taction.ext
which is an alias for taction.lib._taction_ext
where the extension is stored.
The package can be installed as normal using:
pip install .
All code in located in the src
directory.
The directory structure follows the conventions for their respective languages.
Python code lives under src/taction
.
C++ code is placed src/taction-ext/src
and src/taction-ext/include/taction
.
If you are adding a C++ function you have to follow these steps:
- write implementation, e.g.
add
insrc/taction-ext/src/main.cpp
- write a binding function, e.g.
bind_add
insrc/taction-ext/src/main.cpp
- add the signatures to the corresponding header file, e.g.
add
andbind_add
insrc/taction-ext/include/taction/main.hpp
- add a call to the binding function, e.g. as
bind_add
insrc/taction-ext/src/bindings.cpp
- re-install package
See Pybind11 docs for details on their package.
You can set the build-type in the pyproject.toml
.