setup: perform all pyenv setup in a single place (#23408)

* consolidate pyenv setup

* cleanup openpilot_env.sh

* undo openpilot_env.sh changes

* needed on mac

* add that back

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: f2f8e7b930
taco
Greg Hogan 3 years ago committed by GitHub
parent 451e3e0f52
commit 193e80665d
  1. 17
      update_requirements.sh

@ -4,11 +4,26 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR
RC_FILE="${HOME}/.$(basename ${SHELL})rc"
if [ "$(uname)" == "Darwin" ] && [ $SHELL == "/bin/bash" ]; then
RC_FILE="$HOME/.bash_profile"
fi
if ! command -v "pyenv" > /dev/null 2>&1; then
echo "pyenv install ..."
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
export PATH=$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH
echo -e "\n. ~/.pyenvrc" >> $RC_FILE
cat <<EOF > "${HOME}/.pyenvrc"
if [ -z "\$PYENV_ROOT" ]; then
export PATH=\$HOME/.pyenv/bin:\$HOME/.pyenv/shims:\$PATH
export PYENV_ROOT="\$HOME/.pyenv"
eval "\$(pyenv init -)"
eval "\$(pyenv virtualenv-init -)"
fi
EOF
fi
source $RC_FILE
export MAKEFLAGS="-j$(nproc)"

Loading…
Cancel
Save