-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc
35 lines (31 loc) · 1.15 KB
/
.envrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# shellcheck disable=SC1091
export SENTRY_DEVENV_HOME="${SENTRY_DEVENV_HOME:-$HOME/.local/share/sentry-devenv}"
PATH_add "${SENTRY_DEVENV_HOME}/bin"
if ! [[ "${SENTRY_INFRATOOLS_DEVENV_OPTOUT:-}" ]] && command -v devenv >/dev/null; then
# if devenv is installed, we use it
echo "Using devenv. To opt out, set SENTRY_INFRATOOLS_DEVENV_OPTOUT to any value in your .env"
if ! [ -f .venv/bin/activate ]; then
devenv sync
fi
# Don't need to source anything as things like sentry-kube and salt
# running in their own virtualenvs are linked to in here.
PATH_add "${PWD}/.devenv/bin"
PATH_add "${PWD}/.venv/bin"
export VIRTUAL_ENV="${PWD}/.venv"
elif [ ! -d .venv ]; then
echo "warning: creating virtualenv for the first time"
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
pyenv install -s
else
echo "warning: pyenv not installed, using python3 and hoping for the best"
fi
python3 -m venv .venv
source .venv/bin/activate
pip install $(grep ^-- requirements.txt) --upgrade pip==22.2.2 wheel==0.37.1
make develop
else
source .venv/bin/activate
unset PS1
fi