cmake: Do not force reinstall dependencies on building python wheels

When we install into a virtual environment we forced pip to reinstall
dependencies. With this pip could install a newer version of a
dependency. This leads to an unloadable Python bindings module if
the user has installed numpy1.x but numpy2.x is available. Then the
make process links against numpy1.x and the module is not loadable
afterwards when numpy2.x is install.
Therefore remove the force-reinstall option so the environment stays
the same after the wheel is built and installed.
This commit is contained in:
Lars Amsel 2025-09-24 10:27:56 +02:00 committed by Jörg Hofrichter
parent 2536c29282
commit 7ebd4723aa

View File

@ -270,7 +270,7 @@ macro(UHD_PYTHON_INSTALL_MODULE)
# In virtualenvs, let setuptools do its thing
install(CODE "message(\"Installing ${_py_install_mod_MODULE} Python module into venv via pip in '${CMAKE_CURRENT_BINARY_DIR}'.\")")
install(CODE
"execute_process(COMMAND pip3 install . --force-reinstall WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
"execute_process(COMMAND pip3 install . WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
else()
# Otherwise, use sysconfig to determine the correct relative path for Python
# packages, and install to our prefix