About this project ================== The RobotPy project maintains Python wrappers around many different C++ libraries to allow its users to use Python for the FIRST Robotics Competition. It was much too work to create/maintain handwritten wrappers around these libraries, and other tools in the python ecosystem did not meet our needs. robotpy-build was created in 2020 to automate large portions of the work required to maintain and build these wrappers. semiwrap is a rewrite of that project, incorporating five years of lessons learned while maintaining over a dozen different projects wrapping hundreds of C++ classes and functions. We hope that this tool will be useful for you as well. Goals ----- A primary goal of semiwrap is to make it really simple to define and build python wrappers for C++ code using pybind11, requiring little boilerplate. * Autogenerate python extension module wrappers around the native code by parsing C++ header files, including those that contain modern C++ features * Support extensive customization of the wrappers when the autogeneration fails * Autogenerate build files for the autogenerated code * semiwrap projects can depend on (and wrap) native/binary libraries in other python wheels * Provide tooling to make it easier to update projects as their dependencies evolve Technologies ------------ Unlike robotpy-build, semiwrap does not actually build your code. Instead, semiwrap ships with a hatchling plugin that autogenerates ``meson.build`` files that will autogenerate pybind11 wrappers and build python extension modules from them. You should use meson to actually build your code (we recommend the ``hatch-meson`` hatchling plugin, which is maintained by the authors of semiwrap). To support finding dependencies in other wheels, semiwrap uses the pypi-pkgconf project to resolve pkg-config packages, and exports pkg-config files that can be resolved by other projects. .. note:: Currently, semiwrap only ships with a build file generator for meson. In theory the underlying generator is abstracted such that it should be simple to generate build files for other build systems (CMake, Bazel, etc). If this is something you're interested in please reach out. Related projects ---------------- * `hatch-nativelib `_ - a hatchling plugin that can generate and export pkg-config files and python module loaders for libraries * `hatch-robotpy `_ - a hatchling plugin that can download prebuilt binaries and ship them in a wheel