Commits

Andy Mikhailenko committed df322d5

Mock external modules to build the documentation in environments without them

Comments (0)

Files changed (2)

 
 import sys, os
 
+import mock
+
+
+MOCK_MODULES = [
+    'pymongo', 'pymongo.objectid', 'bson', 'bson.objectid',
+    'shove',
+    'tokyo', 'tokyo.cabinet',
+    'pyrant', 'pyrant.query',
+]
+for mod_name in MOCK_MODULES:
+    sys.modules[mod_name] = mock.MagicMock()
+
 # 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.

requirements/docs.txt

+Sphinx == 1.1.3
+Mock == 1.0.1
+
+# too hard to mock, just install as is
+-r ext_forms.txt