-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·60 lines (48 loc) · 1.33 KB
/
bootstrap
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
53
54
55
56
57
58
59
60
#!/bin/bash -e
function create_virtualenv() {
echo "Creating virtualenv...";
virtualenv --no-site-packages --distribute .;
source bin/activate;
}
function maybe_create_virtualenv() {
echo "
This script will create an isolated environment for installing python
software libraries needed for development unless one exists.
This setup is recommended.
If you are not familiar with using virtualenv [1] to manage a python
development environment you may wish to take a few minutes to read a
bit about it.
If you are comfortable managing it yourself, e.g. through a tool like
virtualenv-wrapper [2], run this command after activating it.
[1] http://www.virtualenv.org/
[2] http://virtualenvwrapper.readthedocs.org/
"
if [ -t 0 ]; then
while true; do
read -p "Create a virtualenv now (recommended)? " yn
case $yn in
[Yy]* )
create_virtualenv
break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
else
create_virtualenv
fi
}
if test -z "$VIRTUAL_ENV"; then
if test ! -e bin/activate; then
maybe_create_virtualenv
else
source bin/activate
fi
fi
if test -z "$PIP_DOWNLOAD_CACHE"; then
export PIP_DOWNLOAD_CACHE=.pip
fi
echo "Ensuring an up-to-date pip..."
pip install -qU pip
echo "Checking dependencies (may be a few minutes for first run)..."
pip install --use-wheel -qr requirements.txt