-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·86 lines (72 loc) · 2.27 KB
/
install.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash -e
set -e
# Packages to be removed from installation:
MOCKPACKAGES="^numpy|^tensorflow|^xgboost|^mpi4py"
# Default settings:
OVERWRITE=false
BRANCH="devel"
# Parse command line input:
while getopts 'hob:' OPTION; do
case "$OPTION" in
h)
echo "Usage: $(basename $0) [-h] [-o] [-b BRANCH]" >&2
exit 1
;;
o)
OVERWRITE=true
;;
b)
BRANCH="$OPTARG"
;;
?)
echo "Usage: $(basename $0) [-h] [-o] [-b BRANCH]" >&2
exit 1
;;
esac
done
shift "$(($OPTIND -1))"
#--------------------------------------------------------------------------------------------------
for SUBPACKAGE in "photometry" "dataval" "corrections" "starclass"; do
echo "**********************************************************"
if [ "$OVERWRITE" = "true" ]; then
echo "Deleting old $SUBPACKAGE..."
rm -rf "../$SUBPACKAGE"
fi
if [ ! -e "../$SUBPACKAGE" ]; then
echo "Setting up $SUBPACKAGE..."
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/tasoc/$SUBPACKAGE.git --branch $BRANCH --single-branch ../$SUBPACKAGE
else
echo "$SUBPACKAGE already exists"
fi
echo "****************************************************"
# Update all the dependencies:
echo "Processing sub-package: $SUBPACKAGE"
if [[ ! -d "../$SUBPACKAGE" ]]; then
echo "DOES NOT EXIST"
exit 2
fi
# Pull latest Git repo:
cd "../$SUBPACKAGE"
git status
git pull -f
# Ensure numpy is the first thing to be installed:
if [ "$SUBPACKAGE" = "photometry" ]; then
grep "numpy" requirements.txt | xargs -I {} pip install "{}" --disable-pip-version-check
fi
# Install requirements for sub-package:
grep -v -E "$MOCKPACKAGES" requirements.txt > requirements.tmp.txt
pip install -q -r requirements.tmp.txt --disable-pip-version-check
rm requirements.tmp.txt
cd ../documentation
done
# Update documentation code:
echo "****************************************************"
pip install --upgrade -r requirements.txt -q --disable-pip-version-check
# Delete old builds:
rm -rf _build/
# Run Sphinx:
echo "Creating HTML documentation..."
sphinx-build -a -W --no-color -b html -d _build/doctrees . _build/html
#echo "Creating LaTeX documentation..."
#sphinx-build -a -W --no-color -b latexpdf -d _build/doctrees . _build/latexpdf
#make latexpdf SPHINXOPTS="-q" LATEXMKOPTS="-silent -quiet" LATEXOPTS="-interaction=nonstopmode"