From 9621224d8276b2d048cd6558986088ab3168adef Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 9 Apr 2020 16:51:06 +0800 Subject: [PATCH] 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 --- doc/conf.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index fadb5248a8634..4e924ae32ae09 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) -- 2.39.5