]> 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, 26 Nov 2020 09:27:49 +0000 (17:27 +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: remove ceph-common as it does not exist back in
                     mimic.

doc/conf.py

index 9c1f4c5a25af4ecca34e42efefb4365ebcdcc147..0280e561b57f44a4bbeba43cdfd092c7f9f1d1f6 100644 (file)
@@ -103,7 +103,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)