How to install python modules using cppyy?

195 Views Asked by At

I want to package a python module containing python source and a native c++ library. Cppyy is used to dynamically generate the bindings so the library is really just a normal library. The build system for the library is meson and should not be replaced. The whole thing is in a git repository. I only care about Linux.

My question is how to get from this to “pip install url_to_package builds/installs everything.” in the least complicated way possible.

What I’ve tried:

  • Extending setuptools with a custom build command:

    …that executes meson compile and copies the result in the right place. But pip install will perform its work in some random split-off temporary directory and I can’t find my C++ sources from there.

  • The Meson python module:

    …can build my library and install files directly into some python env. Does not work with pip and has very limited functionality.

  • Wheels:

    …are incredibly confusing and overkill for me. I will likely be the only user of this module. Actually, all I want is to easily use the module in projects that live in different directories…

Along the way, I also came across different CMake solutions, but those are disqualified because of my build system choice. What should I do?

0

There are 0 best solutions below