docs/conf.py

changeset 98
aacf4fcdd4dd
parent 95
efa2d8e1a2e5
child 99
7f307b98889b
equal deleted inserted replaced
97:07ff83e2990f 98:aacf4fcdd4dd
18 # 18 #
19 import os 19 import os
20 import sys 20 import sys
21 sys.path.insert(0, os.path.abspath('../')) 21 sys.path.insert(0, os.path.abspath('../'))
22 22
23
24 # Mock modules for read the docs
25 on_rtd = os.environ.get('READTHEDOCS') == 'True'
26
27 if on_rtd:
28 from mock import Mock as MagicMock
29
30 class Mock(MagicMock):
31 @classmethod
32 def __getattr__(cls, name):
33 return MagicMock()
34
35 MOCK_MODULES = ['netCDF4', 'numpy', 'scipy',]
36 sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
23 37
24 # -- General configuration ------------------------------------------------ 38 # -- General configuration ------------------------------------------------
25 39
26 # If your documentation needs a minimal Sphinx version, state it here. 40 # If your documentation needs a minimal Sphinx version, state it here.
27 # 41 #

mercurial