Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of the installation directory of some python subprojects fragile #1371

Closed
traversaro opened this issue Mar 17, 2023 · 0 comments · Fixed by #1508
Closed

Handling of the installation directory of some python subprojects fragile #1371

traversaro opened this issue Mar 17, 2023 · 0 comments · Fixed by #1508

Comments

@traversaro
Copy link
Member

The logic of installation of Python bindings for some subprojects is inherently fragile. The superbuild computes the installation location of python bindings in

string(STRIP ${_PYTHON_INSTDIR} ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR)
, via the code:

from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))

Then, for some subprojects we explicitly set that the python installation should be the one that we set (for example casadi

-DPYTHON_PREFIX:PATH=${ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR}
), however for some others we just rely on the fact that the subprojets also compute their python installation directory via from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix='')). However, this is fragile as the, for example, the directory returned by this code is different depending on whater we are running the code in the system python environment or in a virtual environment. We already had users realllllly confused by this.

A better alternative is to use a strategy similar to the one that we used for casadi.

fyi @LoreMoretti

@traversaro traversaro changed the title Python bindings installation logic is fragile Handling of the installation directory of some python subprojects fragile Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant