forked from apple/turicreate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_pydocs.sh
executable file
·63 lines (50 loc) · 1.37 KB
/
make_pydocs.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
#!/bin/bash
set -e
PYTHON_SCRIPTS=deps/conda/bin
if [[ $OSTYPE == msys ]]; then
PYTHON_SCRIPTS=deps/conda/bin/Scripts
fi
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
WORKSPACE=${SCRIPT_DIR}/..
build_type="release"
print_help() {
echo "Builds the release branch and produce an egg to the targets directory "
echo
echo "Usage: ./make_docs.sh"
echo
echo " --debug Use the debug build instead of the release build"
echo
echo "Produce an sphinx docs at pydocs/"
echo "Example: ./make_pydocs.sh"
exit 1
} # end of print help
while [ $# -gt 0 ]
do case $1 in
--debug) build_type="debug";;
esac
shift
done
set -x
TARGET_DIR=${WORKSPACE}/target
if [[ ! -d "${TARGET_DIR}" ]]; then
mkdir ${TARGET_DIR}
fi
# Setup the build environment,
# Set PYTHONPATH, PYTHONHOME, PYTHON_EXECUTABLE
source ${WORKSPACE}/scripts/python_env.sh $build_type
# Generate docs
generate_docs() {
echo -e "\n\n\n================= Generating Docs ================\n\n\n"
$PIP_EXECUTABLE install sphinx==1.6.5
$PIP_EXECUTABLE install sphinx-bootstrap-theme
$PIP_EXECUTABLE install numpydoc
SPHINXBUILD=${WORKSPACE}/$PYTHON_SCRIPTS/sphinx-build
cd ${WORKSPACE}
# rm -rf pydocs
mkdir -p pydocs
cd pydocs
cp -R ${WORKSPACE}/src/python/doc/* .
make clean SPHINXBUILD=${SPHINXBUILD}
make html SPHINXBUILD=${SPHINXBUILD}
}
generate_docs