Browse Source

[DOC] add autodoc mock

pull/6/head
troyyyyy 1 year ago
parent
commit
bff0b65b4f
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      docs/conf.py

+ 11
- 0
docs/conf.py View File

@@ -12,6 +12,17 @@ from sphinx.application import Sphinx
sys.path.insert(0, os.path.abspath("..")) sys.path.insert(0, os.path.abspath(".."))


import ablkit # noqa: E402 import ablkit # noqa: E402
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)


# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------




Loading…
Cancel
Save