forked from pymc-devs/pymc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_testenv.sh
executable file
·53 lines (42 loc) · 1.3 KB
/
create_testenv.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
53
#!/usr/bin/env bash
set -ex # fail on first error, print commands
while test $# -gt 0
do
case "$1" in
--global)
GLOBAL=1
;;
--no-setup)
NO_SETUP=1
;;
esac
shift
done
command -v conda >/dev/null 2>&1 || {
echo "Requires conda but it is not installed. Run install_miniconda.sh." >&2;
exit 1;
}
ENVNAME="${ENVNAME:-testenv}" # if no ENVNAME is specified, use testenv
PYTHON_VERSION=${PYTHON_VERSION:-3.6} # if no python specified, use 3.6
if [ -z ${GLOBAL} ]
then
if conda env list | grep -q ${ENVNAME}
then
echo "Environment ${ENVNAME} already exists, keeping up to date"
else
conda create -n ${ENVNAME} --yes pip python=${PYTHON_VERSION}
fi
source activate ${ENVNAME}
fi
pip install --upgrade pip
conda install --yes mkl-service
conda install --yes -c conda-forge python-graphviz
# Install editable using the setup.py
# Travis env is unable to import cached mpl sometimes https://github.com/pymc-devs/pymc3/issues/3423
pip install --no-cache-dir --ignore-installed -e .
pip install --no-cache-dir --ignore-installed -r requirements-dev.txt
# Install untested, non-required code (linter fails without them)
pip install ipython ipywidgets
if [ -z ${NO_SETUP} ]; then
python setup.py build_ext --inplace
fi