From: Kefu Chai Date: Thu, 9 Apr 2020 08:51:06 +0000 (+0800) Subject: doc/conf.py: exclude pybindings docs from build for RTD X-Git-Tag: v14.2.12~86^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9621224d8276b2d048cd6558986088ab3168adef;p=ceph.git doc/conf.py: exclude pybindings docs from build for RTD because it'd difficult to prepare (dummy) librados,libcephfs and librbd for their python bindings in the building environment offered by Read the Docs. Signed-off-by: Kefu Chai (cherry picked from commit 847e4ef941401e1b580e93d7058e8413bd131e21) Conflicts: doc/conf.py: trivial resolution --- diff --git a/doc/conf.py b/doc/conf.py index fadb5248a86..4e924ae32ae 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -105,7 +105,19 @@ class Mock(object): sys.modules['ceph_module'] = Mock() -for pybind in [os.path.join(top_level, 'src/pybind'), - os.path.join(top_level, 'src/pybind/mgr')]: +if os.environ.get('READTHEDOCS') == 'True': + exclude_patterns += ['**/api/*', + '**/api.rst'] + autodoc_mock_imports = ['cephfs', + 'rados', + 'rbd', + 'ceph'] + pybinds = ['pybind/mgr'] +else: + pybinds = ['pybind', + 'pybind/mgr'] + +for c in pybinds: + pybind = os.path.join(top_level, 'src', c) if pybind not in sys.path: sys.path.insert(0, pybind)