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: v15.2.9~122^2~118^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6734b0b976911750c329f34348a595cd3a6ddc82;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) --- diff --git a/doc/conf.py b/doc/conf.py index 6ed0f7ee5f68..d69b8f9ab721 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)