Skip to content

Commit

Permalink
admin/build-doc: consolidate the build deps into admin/doc-pybind.txt
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tchaikov committed Dec 12, 2020
1 parent ebdaaf8 commit 6fb4aff
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 7 additions & 12 deletions admin/build-doc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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)
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions admin/doc-pybind.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src/pybind/rados
src/pybind/cephfs
src/pybind/rbd
src/pybind/rgw
2 changes: 1 addition & 1 deletion admin/doc-python-common-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pcpp
Jinja2
-e../src/python-common
src/python-common
5 changes: 0 additions & 5 deletions admin/doc-read-the-docs.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6fb4aff

Please sign in to comment.