]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/conf.py: exclude pybindings docs from build for RTD
authorKefu Chai <kchai@redhat.com>
Thu, 9 Apr 2020 08:51:06 +0000 (16:51 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 17 Sep 2020 01:43:33 +0000 (09:43 +0800)
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 <kchai@redhat.com>
(cherry picked from commit 847e4ef941401e1b580e93d7058e8413bd131e21)

Conflicts:
doc/conf.py: trivial resolution

doc/conf.py

index fadb5248a86340143b29fb8854633b627f81b4b9..4e924ae32ae09b83e1f761a6829c398322a84acf 100644 (file)
@@ -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)