fix readthedocs builds
http://alot.readthedocs.io/en/latest/api/interface.html#module-alot.ui

autodoc does not seem to work properly. I suspect this is some import problem on their servers.
diff --git a/.travis.yml b/.travis.yml
index d7fc5916..c7d29749 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -74,6 +74,8 @@ install:
   - |
     set -e
     if [[ $JOB = docs ]]; then
+      # install docs dependencies
+      pip install '.[docs]'
       pip install configobj twisted python-magic urwidtrees
       # Mock all "difficult" dependencies of alot in order to be able to import
       # alot when rebuilding the documentation.  Notmuch would have to be
diff --git a/docs/source/conf.py b/docs/source/conf.py
index f1df2bb4..e2607b73 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,28 +1,24 @@
 # -*- coding: utf-8 -*-
 # alot documentation build configuration file
 
-import sys, os
+import sys
+import os
 
 ###############################
 # readthedocs.org hack,
 # needed to use autodocs on their build-servers:
 # http://readthedocs.org/docs/read-the-docs/en/latest/faq.html?highlight=autodocs#where-do-i-need-to-put-my-docs-for-rtd-to-find-it
 
-class Mock(object):
-    def __init__(self, *args, **kwargs):
-        pass
+try:
+    from unittest.mock import MagicMock
+except ImportError:
+    from mock import Mock as MagicMock
 
-    def __call__(self, *args, **kwargs):
-        return Mock()
 
+class Mock(MagicMock):
     @classmethod
     def __getattr__(cls, name):
-        return Mock() if name not in ('__file__', '__path__') else '/dev/null'
-
-class MockModule(object):
-    @classmethod
-    def __getattr__(cls, name):
-        return Mock if name not in ('__file__', '__path__') else '/dev/null'
+            return MagicMock()
 
 MOCK_MODULES = ['twisted', 'twisted.internet',
                 'twisted.internet.defer',
@@ -34,12 +30,9 @@ MOCK_MODULES = ['twisted', 'twisted.internet',
                 'gpgme',
                 'configobj',
                 'validate',
-                'argparse']
-MOCK_DIRTY = ['notmuch']
-for mod_name in MOCK_MODULES:
-    sys.modules[mod_name] = MockModule()
-for mod_name in MOCK_DIRTY:
-    sys.modules[mod_name] = Mock()
+                'notmuch',
+                ]
+sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
 
 # end of readthedocs.org hack
 ##############################
diff --git a/setup.py b/setup.py
index a3f6f908..c79e8932 100755
--- a/setup.py
+++ b/setup.py
@@ -34,8 +34,13 @@ setup(name='alot',
         'configobj>=4.7.0',
         'pygpgme>=0.2'],
       tests_require=[
-          'mock',
+        'mock',
       ],
+      extras_require={
+        'docs': [
+            'mock',
+        ],
+      },
       provides=['alot'],
       test_suite="tests",
       )
['setup.py', 'docs/source/conf.py', '.travis.yml']