Skip to content

Commit 92d1f4b

Browse files
committed
fix: mock imports
1 parent c33c25e commit 92d1f4b

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

docs/source/conf.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@
1818
sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())
1919

2020
# import MOCK
21-
autodoc_mock_imports = ["torch",
22-
"pysam",
23-
"pybedtools",
24-
"pyfasta",
25-
"pyBigWig",
26-
"pytorch_lightning",
27-
"webdataset"]
21+
from unittest import mock
22+
23+
# Mock open3d because it fails to build in readthedocs
24+
MOCK_MODULES = ["torch",
25+
"pysam",
26+
"pybedtools",
27+
"pyfasta",
28+
"pyBigWig",
29+
"pytorch_lightning",
30+
"webdataset"]
31+
for mod_name in MOCK_MODULES:
32+
sys.modules[mod_name] = mock.Mock()
2833

2934
# -- Project information -----------------------------------------------------
3035

@@ -54,12 +59,6 @@
5459
# This pattern also affects html_static_path and html_extra_path.
5560
exclude_patterns = []
5661

57-
58-
# -- Options for HTML output -------------------------------------------------
59-
60-
# The theme to use for HTML and HTML Help pages. See the documentation for
61-
# a list of builtin themes.
62-
#
6362
intersphinx_mapping = {
6463
'python': ('https://docs.python.org/3/', None),
6564
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),

0 commit comments

Comments
 (0)