Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
2f5d8985
Unverified
Commit
2f5d8985
authored
Nov 28, 2021
by
Nikita Titov
Committed by
GitHub
Nov 28, 2021
Browse files
[docs][python] simplify mocking in docs (#4830)
parent
953915f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
docs/conf.py
docs/conf.py
+13
-18
No files found.
docs/conf.py
View file @
2f5d8985
...
...
@@ -25,7 +25,6 @@ from re import compile
from
shutil
import
copytree
from
subprocess
import
PIPE
,
Popen
from
typing
import
Any
,
List
from
unittest.mock
import
Mock
import
sphinx
from
docutils.nodes
import
reference
...
...
@@ -40,22 +39,6 @@ sys.path.insert(0, str(LIB_PATH))
INTERNAL_REF_REGEX
=
compile
(
r
"(?P<url>\.\/.+)(?P<extension>\.rst)(?P<anchor>$|#)"
)
# -- mock out modules
MOCK_MODULES
=
[
'dask'
,
'dask.distributed'
,
'datatable'
,
'graphviz'
,
'matplotlib'
,
'numpy'
,
'pandas'
,
'scipy'
,
'scipy.sparse'
,
'sklearn'
]
for
mod_name
in
MOCK_MODULES
:
sys
.
modules
[
mod_name
]
=
Mock
()
class
InternalRefTransform
(
Transform
):
"""Replaces '.rst' with '.html' in all internal links like './[Something].rst[#anchor]'."""
...
...
@@ -109,7 +92,19 @@ autodoc_default_options = {
"inherited-members"
:
True
,
"show-inheritance"
:
True
,
}
# mock out modules
autodoc_mock_imports
=
[
'dask'
,
'dask.distributed'
,
'datatable'
,
'graphviz'
,
'matplotlib'
,
'numpy'
,
'pandas'
,
'scipy'
,
'scipy.sparse'
,
'sklearn'
]
# hide type hints in API docs
autodoc_typehints
=
"none"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment