From a76efd98a1ef3819a4c234fa8febd2f58ea910fb Mon Sep 17 00:00:00 2001 From: josemiotto Date: Mon, 20 Aug 2018 10:16:38 +0200 Subject: [PATCH] add mock packages in conf.py to fix documentation compilation --- docs/source/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 0c8433c..73d6956 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,6 +14,7 @@ # import os import sys +from unittest.mock import MagicMock sys.path.insert(0, os.path.abspath('../../../')) # -- Project information ----------------------------------------------------- @@ -43,6 +44,16 @@ 'sphinx.ext.intersphinx', ] + +class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return MagicMock() + + +MOCK_MODULES = ['numpy', 'scipy'] +sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']