WIP: Modify build system to allow generation of wheels and Debian packages #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
or internal use we wanted to distribute CPlantBox either via Python wheels or using Debian packages, and I could not find any information on that in the code. Therefore, I thought our changes might be interesting to other users of CPlantBox. However, feel free to close the PR or suggest relevant changes in case you want to keep (some) of these changes.
In order to generate the packages, some changes to the build system were required - I'm not completely sure if these changes have any unintended side effects for other general use cases of CPlantBox (i.e., I had to revert the target location of the .so files back to their default).
Anyway, the current state allows the generation of wheels and Debian packages, as tested on a Debian bookworm and an old Debian 10.13 (Buster) installation. Please also note that wheels could directly be uploaded to pypi.org, enabling to install CPlantBox easily via an
pip install cplantbox
for supported architectures/interpreters.Build instructions
Starting in a clean virtualenv:
pip install build wheel ninja
I had some problems with the pybind11 version, but 2.4 and 2.11.1 finally worked:
Wheels are then built with:
python setup.py bdist_wheel
or
python -m build --wheel
Debian packaging
The Debian packages are then generated using:
python3 setup.py --command-packages=stdeb.command bdist_deb
output is located in deb_dist/