From 14f4f6beebd20e64061821b80ca90ae9a5997f9c Mon Sep 17 00:00:00 2001 From: troyyyyy Date: Mon, 8 Jan 2024 16:03:38 +0800 Subject: [PATCH] [DOC] remove surplus requirements --- docs/conf.py | 13 +++++++++++++ docs/requirements.txt | 8 +------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 326b4ce..311f774 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,6 +11,19 @@ from sphinx.application import Sphinx sys.path.insert(0, os.path.abspath("..")) +from unittest.mock import MagicMock + + +class Mock(MagicMock): + @classmethod + def __getattr__(cls, name): + return MagicMock() + + +MOCK_MODULES = ["numpy", "pyswip", "torch", "torchvision", "zoopt", "termcolor"] +sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) + + import ablkit # noqa: E402 # -- Project information ----------------------------------------------------- diff --git a/docs/requirements.txt b/docs/requirements.txt index ebde2fe..88bedfb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,10 +2,4 @@ sphinx sphinx-rtd-theme recommonmark sphinx-markdown-tables -sphinx-copybutton -numpy -pyswip -torch -torchvision -zoopt -termcolor \ No newline at end of file +sphinx-copybutton \ No newline at end of file