From 4fab405b36aed7ec2bf2d280d3be0f345224f2fc Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 7 May 2019 20:03:13 +0800 Subject: [PATCH] manual: ligher mock for artiq.gui.applets. Closes #1293 --- doc/manual/conf.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/manual/conf.py b/doc/manual/conf.py index db73a32e8..17e569a2c 100644 --- a/doc/manual/conf.py +++ b/doc/manual/conf.py @@ -26,6 +26,7 @@ from sphinx.ext import autodoc autodoc.repr = str +# we cannot use autodoc_mock_imports (does not help with argparse) mock_modules = ["artiq.gui.waitingspinnerwidget", "artiq.gui.flowlayout", "artiq.compiler.module", @@ -39,6 +40,14 @@ for module in mock_modules: 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, # 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.