From 66b049234343d0c0b67f893636aedad6be7cdb35 Mon Sep 17 00:00:00 2001 From: cronekorkn Date: Thu, 23 Mar 2023 11:24:41 +0100 Subject: [PATCH] .envrc: rebuild venv on python version change; install requirements --- .envrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.envrc b/.envrc index ae1a372..20ed2d0 100644 --- a/.envrc +++ b/.envrc @@ -1,10 +1,17 @@ #!/usr/bin/env bash +if test -f .venv/bin/python && test "$(realpath .venv/bin/python)" != "$(realpath "$(pyenv which python)")" +then + echo "rebuilding venv für new python version" + rm -rf .venv +fi + python3 -m venv .venv -source ./.venv/bin/activate +source .venv/bin/activate PATH_add .venv/bin PATH_add bin -python3 -m pip install --upgrade pip +python3 -m pip install --upgrade pip wheel +python3 -m pip install --upgrade -r requirements.txt rm -rf .cache/bw/git_deploy export BW_GIT_DEPLOY_CACHE=.cache/bw/git_deploy