Add venv on Mac and do not use --user flag in that case

release/4.3a0
Frank Dellaert 2024-08-25 13:49:43 -07:00
parent b9e68ec79b
commit 9307536827
2 changed files with 10 additions and 2 deletions

View File

@ -168,9 +168,17 @@ jobs:
run: |
bash .github/scripts/python.sh -d
- name: Create virtual on MacOS
if: runner.os == 'macOS'
run: |
python$PYTHON_VERSION -m venv venv
source venv/bin/activate
echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV
python -m pip install --upgrade pip
- name: Install Python Dependencies
shell: bash
run: python$PYTHON_VERSION -m pip install --break-system-packages --user -r python/dev_requirements.txt
run: python$PYTHON_VERSION -m pip install -r python/dev_requirements.txt
- name: Build
shell: bash

View File

@ -266,7 +266,7 @@ endif()
# Add custom target so we can install with `make python-install`
set(GTSAM_PYTHON_INSTALL_TARGET python-install)
add_custom_target(${GTSAM_PYTHON_INSTALL_TARGET}
COMMAND ${PYTHON_EXECUTABLE} -m pip install --break-system-packages --user .
COMMAND ${PYTHON_EXECUTABLE} -m pip install $(if [ -z "$VIRTUAL_ENV" ]; then echo "--user"; fi) .
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES}
WORKING_DIRECTORY ${GTSAM_PYTHON_BUILD_DIRECTORY})