-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.envrc
24 lines (21 loc) · 840 Bytes
/
.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
# check if python version is already set in current directory
# if not, then set create a virtual environment & set the version
# manually for this environment
if [ -f ".python-version" ] ; then
if [ ! -d ".env" ] ; then
use pyenv < .python-version
echo "Installing virtualenv for $(python -V)"
python -m venv .env
fi
echo "Activating $(python -V) virtualenv"
source .env/bin/activate
fi
echo "Virtualenv activated for $(python -V)"
echo "$(which python)"
export PYTHONPATH=${PWD}
export PYENV_VERSION=$(cat .python-version)
# include this line to deactivate warning PS1 can not be
# exported via direnv; sometimes the activate script from
# venv can include a PS1 export that isn't allowed
# see more: https://github.com/direnv/direnv/wiki/PS1
unset PS1