Skip to content

Commit

Permalink
doc/conf.py: exclude pybindings docs from build for RTD
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tchaikov committed Apr 9, 2020
1 parent 99b75c1 commit 847e4ef
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions doc/conf.py
Expand Up @@ -110,8 +110,21 @@ def __getattr__(cls, name):

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)

0 comments on commit 847e4ef

Please sign in to comment.