-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc
49 lines (29 loc) · 861 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
strict_env
direnv_version '2.34.0'
COLOR_MAGENTA="\033[1;35m"
FORMAT_BOLD="\033[1m"
FORMAT_NONE="\033[0m"
MSG_INFO="${FORMAT_BOLD}${COLOR_MAGENTA}info:${FORMAT_NONE}"
msg_info()
{
printf '%b %s\n' "$MSG_INFO" "$1"
}
use flake
VIRTUAL_ENV=$(expand_path .venv)
if [ ! -d "$VIRTUAL_ENV" ]; then
msg_info "creating \`$VIRTUAL_ENV\` because it doesn't seem to exist"
python -m venv "$VIRTUAL_ENV"
fi
if [ -n "${FISH_VERISON-}" ]; then
. "$VIRTUAL_ENV/bin/activate.fish"
else
. "$VIRTUAL_ENV/bin/activate"
fi
if [ ! -f "$VIRTUAL_ENV/.requirements-installed" ]; then
msg_info 'installing python requirements since they seem to be missing'
pip install -r 'requirements.txt'
pip install -r 'dev-requirements.txt'
touch "$VIRTUAL_ENV/.requirements-installed"
fi
pre-commit install --allow-missing-config
export SIF_SRC_DIR="$(expand_path .)"