Skip to content

Commit

Permalink
add mock packages in conf.py to fix documentation compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
josemiotto committed Aug 20, 2018
1 parent 8ce3ca2 commit a76efd9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
import os
import sys
from unittest.mock import MagicMock
sys.path.insert(0, os.path.abspath('../../../'))

# -- Project information -----------------------------------------------------
Expand Down Expand Up @@ -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']

Expand Down

0 comments on commit a76efd9

Please sign in to comment.