-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_env.sh
executable file
·44 lines (42 loc) · 1.13 KB
/
make_env.sh
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
#!/usr/bin/env bash
#
# Create a virtualenv. Note that python 3.6 is currently the minimal requirement
#
# Stop on error, rather than continue and trash the environment
set -e
#
# Default to 3.8 but allow override
DEFAULT_PYTHON_VER=3.10
PYTHON_VER=${1:-$DEFAULT_PYTHON_VER}
# Clean
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
find . -name 'poetry.lock' -delete
find . -name 'Pipefile.lock' -delete
find . -name '*.log' -delete
find . -name '.coverage' -delete
find . -wholename 'logs/*.json' -delete
find . -wholename '*/.pytest_cache' -delete
find . -wholename '**/.pytest_cache' -delete
find . -wholename './logs/*.json' -delete
find . -wholename '.webassets-cache/*' -delete
find . -wholename './logs' -delete
find . -wholename './.reports' -delete
#
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
python${PYTHON_VER} -m venv venv
elif [[ "$OSTYPE" == "darwin"* ]]; then
python3 -m venv venv
else
echo "Sistema operativo no compatible"
exit 1
fi
#
source venv/bin/activate
#
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install urllib3
./manage.py migrate
#
python manage.py runserver