mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
doc/dev: Using mocking instead of importing external modules
[sunil: Expand the full list of modules] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
3def7706db
commit
585433d427
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user