-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.sh
executable file
·52 lines (43 loc) · 1.14 KB
/
setup.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
44
45
46
47
48
49
50
51
52
#!/bin/bash -e
SYS_PYTHON=$(which pypy3 || which pypy || which pypy2)
if [ -z $1 ]
then
DEST=vanguardenv
else
DEST=$1
fi
mkdir -p $DEST
# 1. Install python if needed
if [ -z "$(which $SYS_PYTHON)" ]
then
echo "We need pypy or pypy3 to be in the path."
echo
echo "If you are on a Debian or Ubuntu system, you can try: "
echo " sudo apt-get install pypy virtualenv"
echo
echo "If there is no pypy for your arch, edit this script to set"
echo "SYS_PYTHON=\"python\""
exit 1
fi
if [ -z "$(which virtualenv)" ]
then
echo "We need virtualenv to be in the path. If you are on a debian system, try:"
echo " sudo apt-get install virtualenv"
exit 1
fi
# 2. Initialize virtualenv
if [ ! -f ${DEST}/bin/activate ]
then
virtualenv --never-download -p $SYS_PYTHON $DEST
fi
source ${DEST}/bin/activate
# 3. Install stem+setuptools
pip install --require-hashes -r requirements.txt
$(basename $SYS_PYTHON) setup.py install
# 4. Inform user what to do
echo
echo "If we got this far, everything should be ready!"
echo
echo "Run 'source ${DEST}/bin/activate' to start the environment."
echo
echo "Then run 'vanguards' or './vanguards_parallel.sh'"