nopenpilot/update_requirements.sh

55 lines
1.3 KiB
Bash
Raw Permalink Normal View History

mac: fix setup and re-enable CI (#23365) * rework mac_setup.sh * ignore casadi and onnx runtime in pipfile for Darwin * remove rust stuff * build and install casadi * add wget * explicit python3. dont do onnx just yet * resource compiler * replace acados Darwin lib w universal2 libs * relock Pipfile using linux machine * Update update_requirements.sh brackets * Update update_requirements.sh oops * ci: re-enable mac build * attempt to fix ci build: * pip stuff? * move rcc bin path to env script * oops * only mac * k im lazy. does ci like this?? * huh?? * * use curl * avoid casadi rebuilds * add comment to remove protobuf * host detect typo * python version * how did the builds not use swig? * better reinstall check * sometimes mac clang complain abt error limit * ci: build OP in venv * ci: bump to Big Sur * retry? idk why it failed @ acados link * * use macos-latest * move rcc path to scons * add extra paths for odd homebrew installs * acados source change * update macOS README * uh, maybe? * k nvm * ci: ok this is strange. might be scons bug? * fix conflicts: bump * just add cppcheck for pre-commit stuff * agane * cleanup * try that * fix path * no pyenv update on mac * source * fix rpath prefix? * no examples * fix exit * let's get this cached * add virtualenvs to cache * why did we cache that * let's see what's big * more * always ruyn * cache scons cache * better cache key * fix for partial hit * why so long Co-authored-by: Andrew Tec <andrest@trabus.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Bruce Wayne <batman@openpilot-mac-mini.local>
2022-01-07 16:15:18 -07:00
#!/bin/bash
set -e
2020-01-17 11:22:00 -07:00
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR
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
2020-10-21 12:36:18 -06:00
fi
export MAKEFLAGS="-j$(nproc)"
PYENV_PYTHON_VERSION=$(cat .python-version)
if ! pyenv prefix ${PYENV_PYTHON_VERSION} &> /dev/null; then
mac: fix setup and re-enable CI (#23365) * rework mac_setup.sh * ignore casadi and onnx runtime in pipfile for Darwin * remove rust stuff * build and install casadi * add wget * explicit python3. dont do onnx just yet * resource compiler * replace acados Darwin lib w universal2 libs * relock Pipfile using linux machine * Update update_requirements.sh brackets * Update update_requirements.sh oops * ci: re-enable mac build * attempt to fix ci build: * pip stuff? * move rcc bin path to env script * oops * only mac * k im lazy. does ci like this?? * huh?? * * use curl * avoid casadi rebuilds * add comment to remove protobuf * host detect typo * python version * how did the builds not use swig? * better reinstall check * sometimes mac clang complain abt error limit * ci: build OP in venv * ci: bump to Big Sur * retry? idk why it failed @ acados link * * use macos-latest * move rcc path to scons * add extra paths for odd homebrew installs * acados source change * update macOS README * uh, maybe? * k nvm * ci: ok this is strange. might be scons bug? * fix conflicts: bump * just add cppcheck for pre-commit stuff * agane * cleanup * try that * fix path * no pyenv update on mac * source * fix rpath prefix? * no examples * fix exit * let's get this cached * add virtualenvs to cache * why did we cache that * let's see what's big * more * always ruyn * cache scons cache * better cache key * fix for partial hit * why so long Co-authored-by: Andrew Tec <andrest@trabus.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Bruce Wayne <batman@openpilot-mac-mini.local>
2022-01-07 16:15:18 -07:00
# no pyenv update on mac
if [ "$(uname)" == "Linux" ]; then
echo "pyenv update ..."
pyenv update
fi
echo "python ${PYENV_PYTHON_VERSION} install ..."
CONFIGURE_OPTS="--enable-shared" pyenv install -f ${PYENV_PYTHON_VERSION}
2020-10-21 12:36:18 -06:00
fi
mac: fix setup and re-enable CI (#23365) * rework mac_setup.sh * ignore casadi and onnx runtime in pipfile for Darwin * remove rust stuff * build and install casadi * add wget * explicit python3. dont do onnx just yet * resource compiler * replace acados Darwin lib w universal2 libs * relock Pipfile using linux machine * Update update_requirements.sh brackets * Update update_requirements.sh oops * ci: re-enable mac build * attempt to fix ci build: * pip stuff? * move rcc bin path to env script * oops * only mac * k im lazy. does ci like this?? * huh?? * * use curl * avoid casadi rebuilds * add comment to remove protobuf * host detect typo * python version * how did the builds not use swig? * better reinstall check * sometimes mac clang complain abt error limit * ci: build OP in venv * ci: bump to Big Sur * retry? idk why it failed @ acados link * * use macos-latest * move rcc path to scons * add extra paths for odd homebrew installs * acados source change * update macOS README * uh, maybe? * k nvm * ci: ok this is strange. might be scons bug? * fix conflicts: bump * just add cppcheck for pre-commit stuff * agane * cleanup * try that * fix path * no pyenv update on mac * source * fix rpath prefix? * no examples * fix exit * let's get this cached * add virtualenvs to cache * why did we cache that * let's see what's big * more * always ruyn * cache scons cache * better cache key * fix for partial hit * why so long Co-authored-by: Andrew Tec <andrest@trabus.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Bruce Wayne <batman@openpilot-mac-mini.local>
2022-01-07 16:15:18 -07:00
eval "$(pyenv init --path)"
2020-10-21 12:36:18 -06:00
mac: fix setup and re-enable CI (#23365) * rework mac_setup.sh * ignore casadi and onnx runtime in pipfile for Darwin * remove rust stuff * build and install casadi * add wget * explicit python3. dont do onnx just yet * resource compiler * replace acados Darwin lib w universal2 libs * relock Pipfile using linux machine * Update update_requirements.sh brackets * Update update_requirements.sh oops * ci: re-enable mac build * attempt to fix ci build: * pip stuff? * move rcc bin path to env script * oops * only mac * k im lazy. does ci like this?? * huh?? * * use curl * avoid casadi rebuilds * add comment to remove protobuf * host detect typo * python version * how did the builds not use swig? * better reinstall check * sometimes mac clang complain abt error limit * ci: build OP in venv * ci: bump to Big Sur * retry? idk why it failed @ acados link * * use macos-latest * move rcc path to scons * add extra paths for odd homebrew installs * acados source change * update macOS README * uh, maybe? * k nvm * ci: ok this is strange. might be scons bug? * fix conflicts: bump * just add cppcheck for pre-commit stuff * agane * cleanup * try that * fix path * no pyenv update on mac * source * fix rpath prefix? * no examples * fix exit * let's get this cached * add virtualenvs to cache * why did we cache that * let's see what's big * more * always ruyn * cache scons cache * better cache key * fix for partial hit * why so long Co-authored-by: Andrew Tec <andrest@trabus.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Bruce Wayne <batman@openpilot-mac-mini.local>
2022-01-07 16:15:18 -07:00
echo "update pip"
pip install pip==21.3.1
pip install pipenv==2021.11.23
2020-11-18 17:25:38 -07:00
if [ -d "./xx" ]; then
export PIPENV_SYSTEM=1
export PIPENV_PIPFILE=./xx/Pipfile
fi
if [ -z "$PIPENV_SYSTEM" ]; then
echo "PYTHONPATH=${PWD}" > .env
RUN="pipenv run"
else
RUN=""
fi
mac: fix setup and re-enable CI (#23365) * rework mac_setup.sh * ignore casadi and onnx runtime in pipfile for Darwin * remove rust stuff * build and install casadi * add wget * explicit python3. dont do onnx just yet * resource compiler * replace acados Darwin lib w universal2 libs * relock Pipfile using linux machine * Update update_requirements.sh brackets * Update update_requirements.sh oops * ci: re-enable mac build * attempt to fix ci build: * pip stuff? * move rcc bin path to env script * oops * only mac * k im lazy. does ci like this?? * huh?? * * use curl * avoid casadi rebuilds * add comment to remove protobuf * host detect typo * python version * how did the builds not use swig? * better reinstall check * sometimes mac clang complain abt error limit * ci: build OP in venv * ci: bump to Big Sur * retry? idk why it failed @ acados link * * use macos-latest * move rcc path to scons * add extra paths for odd homebrew installs * acados source change * update macOS README * uh, maybe? * k nvm * ci: ok this is strange. might be scons bug? * fix conflicts: bump * just add cppcheck for pre-commit stuff * agane * cleanup * try that * fix path * no pyenv update on mac * source * fix rpath prefix? * no examples * fix exit * let's get this cached * add virtualenvs to cache * why did we cache that * let's see what's big * more * always ruyn * cache scons cache * better cache key * fix for partial hit * why so long Co-authored-by: Andrew Tec <andrest@trabus.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Bruce Wayne <batman@openpilot-mac-mini.local>
2022-01-07 16:15:18 -07:00
echo "pip packages install..."
pipenv install --dev --deploy --clear
pyenv rehash
2020-10-23 17:09:34 -06:00
echo "pre-commit hooks install..."
shopt -s nullglob
for f in .pre-commit-config.yaml */.pre-commit-config.yaml; do
cd $DIR/$(dirname $f)
2022-03-13 17:37:53 -06:00
if [ -e ".git" ]; then
$RUN pre-commit install
fi
done