|
14 | 14 | #
|
15 | 15 | import os
|
16 | 16 | import sys
|
| 17 | +from unittest import mock |
| 18 | +import tempfile |
| 19 | + |
17 | 20 | from packaging.version import Version
|
| 21 | +import templateflow |
| 22 | + |
| 23 | +# Prevent etelemetry from loading at all |
| 24 | +# Could set NO_ET environment variable, but why? |
| 25 | +MOCKS = [ |
| 26 | + "etelemetry", |
| 27 | + "matplotlib", |
| 28 | + "matplotlib.pyplot", |
| 29 | + "matplotlib.cm", |
| 30 | + "matplotlib.colors", |
| 31 | + "matplotlib.colorbar", |
| 32 | +] |
| 33 | +sys.modules.update({mod: mock.Mock() for mod in MOCKS}) |
| 34 | + |
| 35 | +# Keep templateflow API intact except for fetching files. |
| 36 | +# Return an existent but empty temporary file |
| 37 | +tffiledesc, tffilename = tempfile.mkstemp() |
| 38 | +os.close(tffiledesc) |
| 39 | +templateflow.api.get = mock.MagicMock(return_value=tffilename) |
18 | 40 |
|
19 | 41 | from niworkflows import __version__, __copyright__, __packagename__
|
20 | 42 |
|
|
47 | 69 | ]
|
48 | 70 |
|
49 | 71 | autodoc_mock_imports = [
|
50 |
| - "matplotlib", |
51 | 72 | "nilearn",
|
52 | 73 | "nitime",
|
53 | 74 | "numpy",
|
|
57 | 78 | "svgutils",
|
58 | 79 | "templateflow",
|
59 | 80 | "transforms3d",
|
| 81 | + "yaml", |
60 | 82 | ]
|
61 | 83 |
|
62 | 84 | # Accept custom section names to be parsed for numpy-style docstrings
|
|
225 | 247 |
|
226 | 248 | apidoc_module_dir = "../niworkflows"
|
227 | 249 | apidoc_output_dir = "api"
|
228 |
| -apidoc_excluded_paths = ["conftest.py", "*/tests/*", "tests/*", "data/*"] |
| 250 | +apidoc_excluded_paths = ["conftest.py", "*/tests/*", "tests/*", "data/*", "testing.py"] |
229 | 251 | apidoc_separate_modules = True
|
230 | 252 | apidoc_extra_args = ["--module-first", "-d 1", "-T"]
|
231 | 253 |
|
|
234 | 256 | # Example configuration for intersphinx: refer to the Python standard library.
|
235 | 257 | intersphinx_mapping = {
|
236 | 258 | "bids": ("https://bids-standard.github.io/pybids/", None),
|
237 |
| - "matplotlib": ("https://matplotlib.org/", None), |
| 259 | + "matplotlib": ("https://matplotlib.org/stable", None), |
238 | 260 | "nibabel": ("https://nipy.org/nibabel/", None),
|
239 | 261 | "nipype": ("https://nipype.readthedocs.io/en/latest/", None),
|
240 | 262 | "numpy": ("https://numpy.org/doc/stable/", None),
|
241 | 263 | "pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
|
242 | 264 | "python": ("https://docs.python.org/3/", None),
|
243 |
| - "scipy": ("https://docs.scipy.org/doc/scipy-1.8.0/html-scipyorg/", None), |
| 265 | + "scipy": ("https://docs.scipy.org/doc/scipy/", None), |
244 | 266 | "smriprep": ("https://www.nipreps.org/smriprep/", None),
|
245 | 267 | "surfplot": ("https://surfplot.readthedocs.io/en/latest/", None),
|
246 | 268 | "templateflow": ("https://www.templateflow.org/python-client", None),
|
|
0 commit comments