add BUILD_ONLY_PYTHON_INTERFACE option #745
Draft
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,
This is PR is not ready, but we can already start some discussions.
It add the
BUILD_PYTHON_INTERFACE
option we already have in many places, plus aBUILD_ONLY_PYTHON_INTERFACE
one.The idea of that second one is that, using a single project source, we should be able to package one version without any python interface, then install that, then package another version with only the python interface, linked to the first one with a standard dependency.
The packaging split of those python bindings are already done in robotpkg through some patches there, but would help in many other places, so I think this should be upstreamed.
For example, this would fix stack-of-tasks/pinocchio#2575 because we could have a dependency chain like example-robot-data <- pinocchio <- py-pinocchio <- py-example-robot-data.
It would also allow end users to avoid python dependencies when they only care about our C++ interfaces, since they could apt/brew/conda/nix/pacman/pip install either "pinocchio" or "py-pinocchio" (the later coming with the former as a dependency)
It would also reduce the required resources to build our packages in package managers which offer multiple python versions, since we won't have to rebuild pinocchio-cpp for each pinocchio-py38 .. pinocchio-py313
(obviously, the name of the packages with/without python, eventually with the python version number in the package name will be left to choose for each package manager. eg. I think for pip we should have something like coal-cpp and keep coal for the python bindings, but for robotpkg this is already coal / py312-coal, and for nix this is already coal / python312Packages.coal)
It would also allow support of multiple python versions installed side by side on a system, eg:
Install example of coal with both python 3.12 and 3.13
PS: in HPP, we already have an early version of this feature under the
INSTALL_PYTHON_INTERFACE_ONLY
name, but this lacks support of various things from jrl-cmakemodules, like not installing the headers / cmake exports / ros stuff