summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorSean Channel <pentabular@gmail.com>2012-10-03 14:02:55 -0700
committerTommi Virtanen <tv@inktank.com>2012-10-04 14:53:20 -0700
commitc65ffe9f7f27bc0fe5afab36e9ef0de42bc3c74c (patch)
tree3db93a87d834ad5dcd26fd493757186982a6ac66 /admin
parentad97bbb0a1e985b91ab0ffe9ae5b15cfce465211 (diff)
downloadceph-c65ffe9f7f27bc0fe5afab36e9ef0de42bc3c74c.tar.gz
admin/build-doc: Use installed Sphinx and its dependencies, when possible.
This avoids the delay of installing Sphinx inside the virtualenv; especially, compiling lxml is slow. If Sphinx is not installed system-wide (or it's too old), this will still install a copy inside the virtualenv, to keep working. Thanks to Sean for the push to make this happen, and testing the various scenarios; I (Tv) took the liberty of changing the commit to use venv-python for the manpage build too, avoid the nonstandard "which" command, be more careful about quoting, and explain more fully what's going on in the comment. Closes: https://github.com/ceph/ceph/pull/24 Signed-off-by: Sean Channel <pentabular@gmail.com> Signed-off-by: Tommi Virtanen <tv@inktank.com>
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/build-doc18
1 files changed, 14 insertions, 4 deletions
diff --git a/admin/build-doc b/admin/build-doc
index 81854640edf..0bcc799b0eb 100755
--- a/admin/build-doc
+++ b/admin/build-doc
@@ -42,12 +42,22 @@ cd build-doc
[ -z "$vdir" ] && vdir="./virtualenv"
if [ ! -e $vdir ]; then
- virtualenv --no-site-packages $vdir
+ virtualenv --system-site-packages $vdir
+fi
+$vdir/bin/pip install -r ../admin/doc-requirements.txt
+
+sphinx_build="$vdir/bin/sphinx-build"
+if [ ! -e $sphinx_build ]; then
+ # If sphinx is not installed inside the virtualenv (that is, we
+ # have a system-wide sphinx installed and it is new enough), use
+ # that. As we need to use the python interpreter from inside the
+ # virtualenv to make the sphinx extensions visible, we need need
+ # to know the full path to the sphinx-build script.
+ sphinx_build="$(command -v -p sphinx-build)"
fi
-$vdir/bin/pip install --quiet -r ../admin/doc-requirements.txt
install -d -m0755 \
output/html \
output/man
-PYTHONPATH=`pwd`/../src/pybind $vdir/bin/sphinx-build -a -b dirhtml -d doctrees ../doc output/html
-$vdir/bin/sphinx-build -a -b man -d doctrees ../doc output/man
+PYTHONPATH="$(pwd)/../src/pybind" "$vdir/bin/python" "$sphinx_build" -a -b dirhtml -d doctrees ../doc output/html
+"$vdir/bin/python" "$sphinx_build" -a -b man -d doctrees ../doc output/man