Skip to content

Commit

Permalink
rtd-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
untzag committed Aug 8, 2017
1 parent d8936a8 commit ee6c9ab
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: wrighttools

dependencies:
- h5py
- matplotlib
- numpy
- python-dateutil
- pytz
- scipy
- pip:
- sphinx-gallery>=0.1.9

20 changes: 16 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#
import os
import sys
from unittest.mock import MagicMock
import sphinx_gallery
import math

Expand All @@ -30,13 +29,26 @@
# -- Mocked Modules -------------------------------------------------------


class Mock(MagicMock):
class Mock(object):

def __init__(self, *args, **kwargs):
pass

def __call__(self, *args, **kwargs):
return Mock()

@classmethod
def __getattr__(cls, name):
return MagicMock()
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
return type(name, (), {})
else:
return Mock()

MOCK_MODULES = ['matplotlib', 'numpy', 'h5py', 'scipy']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()


# -- General configuration ------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
conda:
file: .rtd-environment.yml

python:
setup_py_install: true

formats:
- none

0 comments on commit ee6c9ab

Please sign in to comment.