Add pyldap mock for readthedocs (#912)
This commit is contained in:
parent
7106c4fdcf
commit
2ecfaa41cf
12
docs/conf.py
12
docs/conf.py
|
@ -13,12 +13,24 @@
|
|||
# serve to show the default.
|
||||
import sys
|
||||
import os
|
||||
from unittest.mock import 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.
|
||||
sys.path.insert(0, os.path.abspath('..'))
|
||||
|
||||
# Mock packages that cannot be installed on rtd
|
||||
on_rtd = os.environ.get('READTHEDOCS') == 'True'
|
||||
if on_rtd:
|
||||
class Mock(MagicMock):
|
||||
@classmethod
|
||||
def __getattr__(cls, name):
|
||||
return MagicMock()
|
||||
|
||||
MOCK_MODULES = ['ldap']
|
||||
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
|
|
|
@ -28,7 +28,7 @@ tabulate==0.7.7
|
|||
pem==17.1.0
|
||||
raven[flask]==6.1.0
|
||||
jinja2==2.9.6
|
||||
pyldap==2.4.37 # required by ldap auth provider
|
||||
# pyldap==2.4.37 # cannot be installed on rtd - required by ldap auth provider
|
||||
paramiko==2.2.1 # required for lemur_linuxdst plugin
|
||||
sphinx
|
||||
sphinxcontrib-httpdomain
|
||||
|
|
Loading…
Reference in New Issue