-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_dev_env.sh
More file actions
48 lines (40 loc) · 1.14 KB
/
init_dev_env.sh
File metadata and controls
48 lines (40 loc) · 1.14 KB
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
#!/bin/bash
# create python virtual environment
if [ -d "./.venv" ]; then
echo ".venv already exists"
else
echo "Creating .venv"
python -m venv .venv
fi
# activate venv
case "$OSTYPE" in
linux-gnu)
source .venv/bin/activate
;;
*)
source .venv/Scripts/activate
;;
esac
# update pip
python -m pip install --upgrade pip
# install dependencies
pip install -r config/requirements.txt
# install certs
pip install pip-system-certs --use-feature=truststore
pip install --upgrade certifi
git_exclude_content=`cat ../.git/info/exclude | grep -E '__pycache__|.history|.venv'`
if [[ -n $git_exclude_content ]]; then
echo "git exclude already contains __pycache__, .history, and .venv"
else
echo "\n"
if [ -d .git ]; then
echo "__pycache__" >> .git/info/exclude
echo ".history" >> .git/info/exclude
echo ".venv" >> .git/info/exclude
elif [ -d ../.git ]; then
echo "__pycache__" >> ../.git/info/exclude
echo ".history" >> ../.git/info/exclude
echo ".venv" >> ../.git/info/exclude
fi
echo "Added __pycache__, .history, and .venv to git exclude"
fi