Skip to content

Commit

Permalink
pip, don't use --user as it automatically does that
Browse files Browse the repository at this point in the history
With --user and then sudo make install it would be installed
in the home dir of root, which doesn't make sense.
Newer versions of pip (since early 2020) falls back to user-install
when the global site is not writeable.
  • Loading branch information
jakobandersen committed Nov 27, 2022
1 parent b034ae4 commit 2c901d7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions libs/pymod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,7 @@ configure_file(redirector/pyproject.toml ${exportDir}/pyproject.toml @ONLY)
configure_file(redirector/setup.cfg.in ${exportDir}/setup.cfg @ONLY)
configure_file(redirector/mod/__init__.py.in ${exportDir}/mod/__init__.py @ONLY)
if(${BUILD_PY_MOD_PIP})
# https://www.scivision.dev/cmake-install-python-package/
# detect virtualenv and set Pip args accordingly
if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX})
set(_pip_args)
else()
set(_pip_args "--user")
endif()
install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} -m pip install . ${_pip_args} WORKING_DIRECTORY ${exportDir})"
install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} -m pip install . WORKING_DIRECTORY ${exportDir})"
COMPONENT pymod_run)
endif()

Expand Down

0 comments on commit 2c901d7

Please sign in to comment.