forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_environment
More file actions
executable file
·72 lines (60 loc) · 1.71 KB
/
dev_environment
File metadata and controls
executable file
·72 lines (60 loc) · 1.71 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# CLI user interface
if [ "$1" == "-h" ]; then
usage="$(basename "$0") [-h] -- program to install all the bokeh dependencies
where:
-h show this help text
-e ENVIRONMENT were you want to install the dependencies, defaults to bokeh
-b install BUILD dependencies, defauls to true
-r install RUN dependencies, defauls to true
-t install TEST (and examples) dependencies, defauls to true
-a install ADDITIONAL image diff-related packages, defaults to false
"
echo "$usage"
exit 0
fi
# defauls
env=bokeh
build=true
run=true
test=true
add=false
# handling of arguments
while getopts e:b:r:t:a option
do
case "${option}" in
e) env=${OPTARG};;
b) build=${OPTARG};;
r) run=${OPTARG};;
t) test=${OPTARG};;
a) add=true;;
esac
done
# TODO: check if env exists
function get_value {
echo $(cat <<EOF | python -
from conda_build.metadata import MetaData
print(" ".join([s.replace(" ", "") for s in MetaData("../conda.recipe").get_value("$1")]))
EOF
)
}
function conda_install {
channels=$(echo $(get_value 'extra/channels') | sed -e 's/^\| \+/ -c /g')
conda install -n $env $channels --yes $@
}
if [ "$build" == "true" ]; then
conda_install $(get_value "requirements/build")
echo "BUILD dependecies installed."
fi
if [ "$run" == "true" ]; then
conda_install $(get_value "requirements/run")
echo "RUN dependecies installed."
fi
if [ "$test" == "true" ]; then
conda_install $(get_value "test/requires")
echo "TEST (and examples) dependecies installed."
fi
if [[ "$add" == "true" ]]; then
conda_install boto
echo "Image diff-related dependecies installed."
fi