manual: ligher mock for artiq.gui.applets. Closes #1293

This commit is contained in:
Sebastien Bourdeauducq 2019-05-07 20:03:13 +08:00
parent 948ea396c0
commit 4fab405b36
1 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,7 @@ from sphinx.ext import autodoc
autodoc.repr = str autodoc.repr = str
# we cannot use autodoc_mock_imports (does not help with argparse)
mock_modules = ["artiq.gui.waitingspinnerwidget", mock_modules = ["artiq.gui.waitingspinnerwidget",
"artiq.gui.flowlayout", "artiq.gui.flowlayout",
"artiq.compiler.module", "artiq.compiler.module",
@ -39,6 +40,14 @@ for module in mock_modules:
sys.modules[module] = Mock() sys.modules[module] = Mock()
# https://stackoverflow.com/questions/29992444/sphinx-autodoc-skips-classes-inherited-from-mock
class MockApplets:
class AppletsDock:
pass
sys.modules["artiq.gui.applets"] = MockApplets
# If extensions (or modules to document with autodoc) are in another directory, # 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 # 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. # documentation root, use os.path.abspath to make it absolute, like shown here.