Skip to content

Commit 20eb82d

Browse files
committed
#53 another experiment to get autodoc working
1 parent b6201aa commit 20eb82d

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

.isort.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[settings]
2-
known_third_party = arviz,matplotlib,mock,numpy,pandas,patsy,pymc,scipy,seaborn,setuptools,sklearn,statsmodels,xarray
2+
known_third_party = arviz,matplotlib,numpy,pandas,patsy,pymc,scipy,seaborn,setuptools,sklearn,statsmodels,xarray

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-20.04
1111
tools:
12-
python: "3.9"
12+
python: "3.10"
1313
# You can also specify other tool versions:
1414
# nodejs: "16"
1515
# rust: "1.55"

docs/conf.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,33 @@
1616

1717

1818
# Need to mock the package dependencies in order for autodoc to work when docs are remotely built on readthedocs
19-
from mock import Mock as MagicMock
19+
# from mock import Mock as MagicMock
2020

2121

22-
class Mock(MagicMock):
23-
@classmethod
24-
def __getattr__(cls, name):
25-
return MagicMock()
22+
# class Mock(MagicMock):
23+
# @classmethod
24+
# def __getattr__(cls, name):
25+
# return MagicMock()
2626

2727

28-
MOCK_MODULES = [
28+
# MOCK_MODULES = [
29+
# "arviz",
30+
# "matplotlib",
31+
# "numpy",
32+
# "pandas",
33+
# "patsy",
34+
# "pymc",
35+
# "scipy",
36+
# "seaborn",
37+
# "sklearn",
38+
# "xarray",
39+
# ]
40+
# sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
41+
42+
# autodoc_mock_imports
43+
# This avoids autodoc breaking when it can't find packages imported in the code.
44+
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports
45+
autodoc_mock_imports = [
2946
"arviz",
3047
"matplotlib",
3148
"numpy",
@@ -37,7 +54,6 @@ def __getattr__(cls, name):
3754
"sklearn",
3855
"xarray",
3956
]
40-
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
4157

4258
# -- Project information -----------------------------------------------------
4359
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@@ -96,19 +112,3 @@ def __getattr__(cls, name):
96112
"github_version": "master", # Version
97113
"conf_py_path": "/docs/", # Path in the checkout to the docs root
98114
}
99-
100-
# # autodoc_mock_imports
101-
# # This avoids autodoc breaking when it can't find packages imported in the code.
102-
# # https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports
103-
# autodoc_mock_imports = [
104-
# "arviz",
105-
# "matplotlib",
106-
# "numpy",
107-
# "pandas",
108-
# "patsy",
109-
# "pymc",
110-
# "scipy",
111-
# "seaborn",
112-
# "sklearn",
113-
# "xarray",
114-
# ]

requirements-docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ipykernel
22
linkify-it-py
3-
mock
3+
# mock
44
myst_parser
55
nbsphinx
66
pathlib

0 commit comments

Comments
 (0)