Browse files

ugly-ass mocking for RTD

  • Loading branch information...
1 parent 0421241 commit f039f54bac50eca69acc06f873496c29984b9bf5 @tyarkoni tyarkoni committed Dec 31, 2014
Showing with 13 additions and 5 deletions.
  1. +10 −2 docs/
  2. +1 −1 neurosynth/analysis/
  3. +2 −2 neurosynth/base/
@@ -19,14 +19,22 @@
# ReadTheDocks doesn't support necessary C dependencies (e.g., Atlas), so we
# mock them out per
-from mock import Mock as MagicMock
+ from unittest.mock import MagicMock
+except ImportError:
+ from mock import MagicMock
class Mock(MagicMock):
def __getattr__(cls, name):
return Mock()
-MOCK_MODULES = ['numpy', 'scipy', 'pandas', 'ply', 'scikit-learn', 'nibabel']
+# Ugh.
+MOCK_MODULES = ['numpy', 'scipy', 'pandas', 'ply', 'sklearn', 'nibabel',
+'matplotlib', 'sklearn.feature_selection.univariate_selection',
+'scipy.stats', 'sklearn.feature_selection', 'sklearn.preprocessing',
+'sklearn.metrics', 'sklearn.svm', 'sklearn.ensemble', 'sklearn.dummy',
+'sklearn.grid_search', 'numpy.testing']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# If extensions (or modules to document with autodoc) are in another directory,
@@ -14,7 +14,7 @@
from copy import deepcopy
from shutil import copyfile
import simplejson as json
-import matplotlib.pyplot as plt
+from matplotlib import pyplot as plt
logger = logging.getLogger('neurosynth.cluster')
@@ -2,8 +2,8 @@
# ex: set sts=2 ts=2 sw=2 et:
""" Parsing expression grammar for feature-based study selection. """
-import ply.lex as lex
-import ply.yacc as yacc
+from ply import lex
+from ply import yacc
import pandas as pd
import logging

0 comments on commit f039f54

Please sign in to comment.