Skip to content

Commit

Permalink
brew CI: use correct python and set PYTHONPATH (#1197)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters authored Nov 5, 2024
1 parent e669633 commit 25629f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,17 @@ fi

if [[ -n "${PIP_PACKAGES_NEEDED}" ]]; then
brew install python3
# reset command hash since python3 has already been invoked in this script
hash -r
rm -rf ${WORKSPACE}/venv
python3 -m venv ${WORKSPACE}/venv
. ${WORKSPACE}/venv/bin/activate
pip3 install ${PIP_PACKAGES_NEEDED}
# For python 3.X, our formulae install python bindings to
# ${HOMEBREW_PREFIX}/lib/python3.X/site-packages
# so add that folder to PYTHONPATH
python_minor_version=$(python3 -c 'import sys; print(sys.version_info[1])')
export PYTHONPATH=${HOMEBREW_PREFIX}/lib/python3.$python_minor_version/site-packages:$PYTHONPATH
fi

if [[ -z "${DISABLE_CCACHE}" ]]; then
Expand Down

0 comments on commit 25629f7

Please sign in to comment.