tools/setup: do not change global state (#22735)

* tools/setup: do not change global state

1. download packages in the venv
2. never change global python version

* update_requirements.sh: install to system if used by comma employees

* bump pip & pipenv versions

* no --upgrade

* run pre-commmit install in venv

* for consistency

Co-authored-by: predicate@bonzo <noreply@example.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1d55f2f23e
commatwo_master
lipniak 4 years ago committed by GitHub
parent 073dbd8d60
commit 9fcb713e9c
  1. 3
      tools/mac_setup.sh
  2. 7
      tools/ubuntu_setup.sh
  3. 21
      update_requirements.sh

@ -62,12 +62,11 @@ fi
# install python # install python
PYENV_PYTHON_VERSION=$(cat $OP_ROOT/.python-version) PYENV_PYTHON_VERSION=$(cat $OP_ROOT/.python-version)
pyenv install -s ${PYENV_PYTHON_VERSION} pyenv install -s ${PYENV_PYTHON_VERSION}
pyenv global ${PYENV_PYTHON_VERSION}
pyenv rehash pyenv rehash
eval "$(pyenv init -)" eval "$(pyenv init -)"
pip install pipenv==2020.8.13 pip install pipenv==2020.8.13
pipenv install --system --deploy pipenv install --dev --deploy
echo echo
echo "---- FINISH OPENPILOT SETUP ----" echo "---- FINISH OPENPILOT SETUP ----"

@ -136,14 +136,13 @@ git submodule update
PYENV_PYTHON_VERSION=$(cat $OP_ROOT/.python-version) PYENV_PYTHON_VERSION=$(cat $OP_ROOT/.python-version)
PATH=$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH PATH=$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH
pyenv install -s ${PYENV_PYTHON_VERSION} pyenv install -s ${PYENV_PYTHON_VERSION}
pyenv global ${PYENV_PYTHON_VERSION}
pyenv rehash pyenv rehash
eval "$(pyenv init -)" eval "$(pyenv init -)"
# **** in python env **** # **** in python env ****
pip install --upgrade pip==20.2.4 pip install pip==21.3.1
pip install pipenv==2020.8.13 pip install pipenv==2021.5.29
pipenv install --dev --system --deploy pipenv install --dev --deploy
echo echo
echo "---- FINISH OPENPILOT SETUP ----" echo "---- FINISH OPENPILOT SETUP ----"

@ -28,18 +28,25 @@ if ! command -v pipenv &> /dev/null; then
fi fi
echo "update pip" echo "update pip"
pip install --upgrade pip pip install pip==21.3.1
pip install pipenv pip install pipenv==2021.5.29
echo "pip packages install ..." echo "pip packages install ..."
[ -d "./xx" ] && export PIPENV_PIPFILE=./xx/Pipfile if [ -d "./xx" ]; then
pipenv install --dev --deploy --system export PIPENV_PIPFILE=./xx/Pipfile
pipenv install --system --dev --deploy
RUN=""
else
pipenv install --dev --deploy
RUN="pipenv run"
fi
# update shims for newly installed executables (e.g. scons) # update shims for newly installed executables (e.g. scons)
pyenv rehash pyenv rehash
echo "precommit install ..." echo "precommit install ..."
pre-commit install $RUN pre-commit install
# for internal comma repos # for internal comma repos
[ -d "./xx" ] && (cd xx && pre-commit install) [ -d "./xx" ] && (cd xx && $RUN pre-commit install)
[ -d "./notebooks" ] && (cd notebooks && pre-commit install) [ -d "./notebooks" ] && (cd notebooks && $RUN pre-commit install)

Loading…
Cancel
Save