From 847e4ef941401e1b580e93d7058e8413bd131e21 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 --- doc/conf.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 6ed0f7ee5f68e..d69b8f9ab7213 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -110,8 +110,21 @@ 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'), - os.path.join(top_level, 'src/python-common')]: +if os.environ.get('READTHEDOCS') == 'True': + exclude_patterns += ['**/api/*', + '**/api.rst'] + autodoc_mock_imports = ['cephfs', + 'rados', + 'rbd', + 'ceph'] + pybinds = ['pybind/mgr', + 'python-common'] +else: + pybinds = ['pybind', + 'pybind/mgr', + 'python-common'] + +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