diff -r 07ff83e2990f -r aacf4fcdd4dd docs/conf.py --- a/docs/conf.py Thu Dec 07 17:51:06 2017 +0200 +++ b/docs/conf.py Thu Dec 07 17:54:46 2017 +0200 @@ -21,6 +21,20 @@ sys.path.insert(0, os.path.abspath('../')) +# Mock modules for read the docs +on_rtd = os.environ.get('READTHEDOCS') == 'True' + +if on_rtd: + from mock import Mock as MagicMock + + class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return MagicMock() + + MOCK_MODULES = ['netCDF4', 'numpy', 'scipy',] + sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here.