admin/build-doc: consolidate the build deps into admin/doc-pybind.txt

since all the python bindings are required for building the doc, extract
them into admin/doc-pybind.txt.

because the pybind python extensions require Cython python module to build,
we have to move them  into another requirement file, and install them after
Cython is installed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-12-12 15:09:49 +08:00
parent ebdaaf88fd
commit 6fb4aff5ad
5 changed files with 13 additions and 18 deletions

View File

@ -11,6 +11,7 @@ python:
install:
- requirements: admin/doc-requirements.txt
- requirements: admin/doc-read-the-docs.txt
- requirements: admin/doc-pybind.txt
sphinx:
builder: dirhtml
configuration: doc/conf.py

View File

@ -48,8 +48,6 @@ fi
# for availability of commands
set -e
cd build-doc
[ -z "$vdir" ] && vdir="$TOPDIR/build-doc/virtualenv"
if [ ! -e $vdir ]; then
@ -63,7 +61,11 @@ else
PIP_INSTALL="$vdir/bin/pip install"
fi
$PIP_INSTALL --quiet --upgrade pip setuptools
$PIP_INSTALL --quiet -r $TOPDIR/admin/doc-requirements.txt -r $TOPDIR/admin/doc-python-common-requirements.txt
$PIP_INSTALL --quiet \
-r $TOPDIR/admin/doc-requirements.txt \
-r $TOPDIR/admin/doc-python-common-requirements.txt
BUILD_DOC=1 $PIP_INSTALL --quiet \
-r $TOPDIR/admin/doc-pybind.txt
install -d -m0755 \
$TOPDIR/build-doc/output/html \
@ -79,15 +81,6 @@ export PYTHONPATH=$TOPDIR/src/pybind
$vdir/bin/python $TOPDIR/doc/scripts/gen_mon_command_api.py > $TOPDIR/doc/api/mon_command_api.rst
# FIXME(sileht): I dunno how to pass the include-dirs correctly with pip
# for build_ext step, it should be:
# --global-option=build_ext --global-option="--cython-include-dirs $TOPDIR/src/pybind/rados/"
# but that doesn't work, so copying the file in the rbd module directly, that's ok for docs
for bind in rados rbd cephfs rgw; do
BUILD_DOC=1 $vdir/bin/pip install --upgrade $TOPDIR/src/pybind/${bind}
done
for opt in "$@"; do
case $opt in
html|man|livehtml)
@ -104,6 +97,8 @@ if [ -z "$sphinx_targets" ]; then
sphinx_targets="html man"
fi
cd build-doc
for target in $sphinx_targets; do
# Build with -W so that warnings are treated as errors and this fails
case $target in

4
admin/doc-pybind.txt Normal file
View File

@ -0,0 +1,4 @@
src/pybind/rados
src/pybind/cephfs
src/pybind/rbd
src/pybind/rgw

View File

@ -1,3 +1,3 @@
pcpp
Jinja2
-e../src/python-common
src/python-common

View File

@ -1,7 +1,2 @@
plantweb
git+https://github.com/readthedocs/readthedocs-sphinx-search@master
Cython
src/pybind/rados
src/pybind/cephfs
src/pybind/rbd
src/pybind/rgw