From 585433d427552e70f2ccfea2ab520a13ebddba49 Mon Sep 17 00:00:00 2001 From: fliu <10025-fliu@users.noreply.salsa.debian.org> Date: Tue, 17 Aug 2021 18:51:49 -0700 Subject: [PATCH] doc/dev: Using mocking instead of importing external modules [sunil: Expand the full list of modules] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- doc/dev/conf.py | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/doc/dev/conf.py b/doc/dev/conf.py index 80d680a1b..937d93efd 100644 --- a/doc/dev/conf.py +++ b/doc/dev/conf.py @@ -16,24 +16,8 @@ list see the documentation: http://www.sphinx-doc.org/en/master/config import os import sys -import django -import django.conf - sys.path.insert(0, os.path.abspath('../../')) -# -- Django setup ------------------------------------------------------------ - -# Ensure that Django models can be imported by Sphinx -import plinth.settings # noqa pylint: disable=E402 isort:skip - -kwargs = {} -for setting in dir(plinth.settings): - if setting.isupper(): - kwargs[setting] = getattr(plinth.settings, setting) - -django.conf.settings.configure(**kwargs) -django.setup(set_prefix=True) - # -- Project information ----------------------------------------------------- # pylint: disable=invalid-name @@ -209,4 +193,29 @@ autodoc_default_options = { 'special-members': '__init__', } +# Mock importing packages +autodoc_mock_imports = [ + 'apt', + 'augeas', + 'axes', + 'bootstrapform', + 'captcha', + 'cherrypy', + 'configobj', + 'dbus', + 'django', + 'gi', + 'markupsafe', + 'OpenSSL', + 'pam', + 'paramiko', + 'psutil', + 'pytest', + 'requests', + 'ruamel', + 'setuptools', + 'stronghold', + 'yaml', +] + html_favicon = './_static/favicon.ico'