Skip to content

Commit 47606ac

Browse files
committed
Merge pull request #3935 from mboersma/fix-readthedocs
fix(docs): mock out python ldap modules
2 parents dcbb706 + 5a00186 commit 47606ac

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

docs/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
import os
1515
import sys
1616

17+
from mock import MagicMock
18+
19+
# Mock out modules that can't be installed at ReadTheDocs.org.
20+
class MockModule(MagicMock):
21+
@classmethod
22+
def __getattr__(cls, name):
23+
return MockModule()
24+
25+
MOCK_MODULES = ['django_auth_ldap', 'django_auth_ldap.config', 'django_auth_ldap.models', 'ldap']
26+
sys.modules.update((mod_name, MockModule()) for mod_name in MOCK_MODULES)
27+
1728
# If extensions (or modules to document with autodoc) are in another directory,
1829
# add these directories to sys.path here. If the directory is relative to the
1930
# documentation root, use os.path.abspath to make it absolute, like shown here.

docs/docs_requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ django-cors-headers==1.0.0
1313
django-fsm==2.2.0
1414
django-guardian==1.2.5
1515
django-json-field==0.5.7
16-
django-auth-ldap==1.2.5
1716
djangorestframework==3.0.5
1817
docker-py==1.1.0
1918
gunicorn==19.3.0
2019
paramiko==1.15.2
2120
python-etcd==0.3.2
2221
PyYAML==3.11
2322
South==1.0.2
24-
python-ldap==2.4.19
2523

2624
# Deis client requirements, copied from client/requirements.txt
2725
cryptography==0.8.2
@@ -39,3 +37,4 @@ urllib3==1.10.2
3937
# Deis documentation requirements
4038
Sphinx==1.3.1
4139
smartypants==1.8.6
40+
mock==1.0.1

0 commit comments

Comments
 (0)