forked from asterisk/testsuite
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupVenv.sh
executable file
·41 lines (36 loc) · 977 Bytes
/
setupVenv.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
#!/usr/bin/env bash
set -e
REALTIME=false
declare -a VENV_ARGS
for a in "$@" ; do
if [ "$a" == "--realtime" ] ; then
REALTIME=true
else
VENV_ARGS+=( "$a" )
fi
done
function do_pip_setup {
python3 -m pip install --upgrade pip
python3 -m pip install wheel setuptools build
python3 -m pip install -r ./requirements.txt
python3 -m pip install -r ./extras.txt
$REALTIME && python3 -m pip install -r ./requirements-realtime.txt
md5sum requirements.txt extras.txt requirements-realtime.txt > $1/checksums
}
if [[ "$VIRTUAL_ENV" != "" ]]
then
echo "Detected activated virtual environment:" $VIRTUAL_ENV
echo "Skipping creation of new environment, configuring"
do_pip_setup $VIRTUAL_ENV
else
python3 -m venv ${VENV_ARGS[@]} .venv
source .venv/bin/activate
echo "Activated virtual environment:" $VIRTUAL_ENV
if [[ "$VIRTUAL_ENV" != "" ]]
then
echo "Configuring virtual environment"
do_pip_setup $VIRTUAL_ENV
else
echo "Virtual environment failed"
fi
fi