]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Fake out backports.ssl while building docs
authorMenno Smits <menno@freshfoo.com>
Tue, 25 Aug 2015 06:13:06 +0000 (18:13 +1200)
committerMenno Smits <menno@freshfoo.com>
Tue, 25 Aug 2015 06:13:06 +0000 (18:13 +1200)
ReadTheDocs doesn't have it on their build servers.

doc/src/conf.py
setup.py

index a50c1cad7f9ca40f607040d49d5af5f7356c6cb1..f008281ec9d4bd2b36b063e1592e274c19a7e188 100644 (file)
@@ -5,9 +5,15 @@
 
 import sys
 from os import path
+from mock import MagicMock
 
 sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..', '..')))
 
+# Fake out backports(.ssl) so that it's not needed in order to build
+# the docs (ReadTheDocs doesn't have backports.ssl installed).
+MOCK_MODULES = ['backports']
+sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
+
 import imapclient
 
 # -- General configuration -----------------------------------------------------
index 23e5430f027f5b6b888315f20bdcee6c6f547eaa..5a8f6ea6c6910c3fddaf42cb3bade3e532031d41 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -65,11 +65,12 @@ main_deps = [
     'backports.ssl>=0.0.6',
     'pyopenssl>=0.15.1',
     'six',
+    'mock==1.3.0'
 ]
 
 setup_deps = main_deps + ['sphinx']
 
-test_deps = ['mock==1.3.0']
+test_deps = []
 if IS_PY_26_OR_OLDER:
     test_deps.append('unittest2')