From a762d8aa08a0499e1a52fe6d7bb081f667bbb610 Mon Sep 17 00:00:00 2001 From: Miles Price <119885516+milesp-nvidia@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:24:47 -0700 Subject: [PATCH] Update conf.py (#201) Signed-off-by: Miles Price <119885516+milesp-nvidia@users.noreply.github.com> --- docs/sphinx/conf.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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