mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 13:56:23 +02:00
Adding pylab mock module
This commit is contained in:
parent
1fb7ebe67a
commit
a605416d06
1 changed files with 23 additions and 0 deletions
23
doc/conf.py
23
doc/conf.py
|
|
@ -13,6 +13,29 @@
|
|||
|
||||
import sys, os
|
||||
|
||||
#Mocking uninstalled modules: https://read-the-docs.readthedocs.org/en/latest/faq.html
|
||||
class Mock(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
return Mock()
|
||||
|
||||
@classmethod
|
||||
def __getattr__(cls, name):
|
||||
if name in ('__file__', '__path__'):
|
||||
return '/dev/null'
|
||||
elif name[0] == name[0].upper():
|
||||
mockType = type(name, (), {})
|
||||
mockType.__module__ = __name__
|
||||
return mockType
|
||||
else:
|
||||
return Mock()
|
||||
|
||||
MOCK_MODULES = ['pylab']
|
||||
for mod_name in MOCK_MODULES:
|
||||
sys.modules[mod_name] = Mock()
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue