I'm working on a Python package, that wraps a C++ library using Pybind11 + cmake, the code is available at https://github.com/bayesmix-dev/pybmix
Since I'm working on Linux, in order to distribute it through PyPi, I understand that there are two options:
- build a manylinux wheel
- distribute binaries and users need to install it locally
Given that I'm not sure how many users will use my package, I opted for the 2nd option. Moreover, I handle all C++ libraries through CMake submodules so that the library is "self-contained".
Now here's the problem: running
python3 setup.py bdist_wheel
produces a file dist/pybmix-0.0.2-cp38-cp38-linux_x86_64.whl
which is bad due to the linux_...
part. However running
pip3 install pybmix-0.0.2-cp38-cp38-linux_x86_64.whl
works on my machine
running
python3 setup.py sdist
produces a file dist/pybmix-0.0.2.tar.gz
, installing it fails:
pip3 install dist/pybmix-0.0.2.tar.gz
.....
subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for pybmix
Failed to build pybmix
ERROR: Could not build wheels for pybmix which use PEP 517 and cannot be installed directly
Also maybe related but maybe not, I am using protocol buffer to generate some Python and C++ files, this is done in the CMakeLists.txt file so that in my setup.py I have overridden the build_py
in order to first call build_ext
(which is overridden as well as in https://github.com/pybind/cmake_example)