Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sowmyakth committed Apr 4, 2019
2 parents 4c407f5 + 99c8a0b commit 346a4c6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('..'))
import sphinx_rtd_theme


Expand All @@ -33,6 +34,41 @@
# The full version, including alpha/beta/rc tags
release = '0.1'

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

from mock import Mock as MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()
def __mul__(self, other):
return Mock()
def __rmul__(self, other):
return Mock()
def __pow__(self, other):
return Mock()
def __div__(self, other):
return Mock()

MOCK_MODULES = [
'numpy',
'numpy.ma',
'numpy.linalg',
'scipy',
'scipy.spatial',
'astropy',
'astropy.table',
'astropy.io',
'astropy.io.fits',
'fitsio',
'galsim',
'lmfit',
'descwl',
]
if on_rtd:
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# -- General configuration ---------------------------------------------------

Expand Down

0 comments on commit 346a4c6

Please sign in to comment.