-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsetup_mac.sh
More file actions
executable file
·44 lines (36 loc) · 1.23 KB
/
setup_mac.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.23 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
#!/bin/bash
echo "----Checking for already running Virtual Environment----"
if [[ "$VIRTUAL_ENV" != "" ]]; then
echo "Deactivitate the existing virtual enviroment before running this script."
echo "This can be done with the \"deactivate\" command."
exit 53
fi
echo "----Checking for and create a virtual environment----"
if [ ! -d "venv" ]; then
python -m virtualenv venv
if [ $? != 0 ]; then
echo "Virutal environment failed"
exit 59
fi
fi
source venv/bin/activate
if [[ "$VIRTUAL_ENV" == "" ]]; then
echo "FAILURE: Virutal environment creation failed"
exit 666
fi
echo "----Setting up virtual environment----"
SETUP_TMP="setup_tmp"
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
python -m pip install -r requirements.txt
if [ $? != 0 ]; then
echo "Requirements install failed"
exit 59
fi
echo "--------Applying work around to googles protobuf library----"
touch venv/lib/python2.7/site-packages/google/__init__.py
python -m compileall venv/lib/python2.7/site-packages/google/
echo ""
echo "-----------------------------------"
echo "Enviroment setup complete and seemingly successful."
echo "You can start the enviroment with the command\"source venv/bin/activate\""