forked from plotly/plotly.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
51 lines (42 loc) · 1.79 KB
/
setup.sh
File metadata and controls
51 lines (42 loc) · 1.79 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
45
46
47
48
49
50
51
#!/bin/bash
echo "running setup routine with python versions:"
for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
echo " ${version}"
done
PROGNAME=$(basename $0)
function error_exit
{
echo -e "${PROGNAME}: ${1:-"Unknown Error"}\n" 1>&2
exit 1
}
# PYENV shims need to be infront of the rest of the path to work!
echo "adding pyenv shims to the beginning of the path in this shell"
export PATH="/home/ubuntu/.pyenv/shims:$PATH"
# for each version we want, setup a functional virtual environment
for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
echo Setting up Python ${version}
# exporting this variable (in this scope) chooses the python version
export PYENV_VERSION=${version}
echo "Using pyenv version $(pyenv version)"
# this was a major issue previously, sanity check that we're using the
# version we *think* we're using (that pyenv is pointing to)
echo "python -c 'import sys; print(sys.version)'"
python -c 'import sys; print(sys.version)'
# install core requirements all versions need
pip install -r ${PLOTLY_CORE_REQUIREMENTS_FILE} ||
error_exit "${LINENO}: can't install core reqs for Python ${version}"
# handle funkiness around python 2.6
if [ ${version:0:3} == '2.6' ]
then
pip install -e '.[PY2.6]' ||
error_exit "${LINENO}: can't install extras for Python ${version}"
pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE_2_6} ||
error_exit "${LINENO}: can't install optional for Python ${version}"
else
pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE} ||
error_exit "${LINENO}: can't install optional for Python ${version}"
fi
# install some test tools
pip install nose coverage ||
error_exit "${LINENO}: can't install test tools for Python ${version}"
done