diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 9ab82fd6..756c3e1a 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -28,6 +28,7 @@ import os import sys +from unittest.mock import MagicMock import sphinx_rtd_theme @@ -43,6 +44,17 @@ lib_path = os.getenv("SPHINX_PYTHON_SRC", default=".") sys.path.insert(0, os.path.abspath(lib_path)) +# -- Module mocking ---------------------------------------------------------- + +class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return MagicMock() + +# List of modules to mock +MOCK_MODULES = ['cvcuda'] +sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) + # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be