|
10 | 10 | # add these directories to sys.path here. If the directory is relative to the |
11 | 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
12 | 12 | # |
13 | | -import os |
14 | | -import sys |
15 | 13 | from packaging.version import Version |
16 | | - |
17 | 14 | from templateflow import __version__, __copyright__, __packagename__ |
18 | 15 |
|
19 | | -sys.path.append(os.path.abspath("sphinxext")) |
20 | | - |
21 | 16 | # -- Project information ----------------------------------------------------- |
22 | 17 | project = __packagename__ |
23 | 18 | copyright = __copyright__ |
24 | 19 | author = "The TemplateFlow Developers" |
25 | 20 |
|
26 | | -# The short X.Y version |
27 | | -version = Version(__version__).public |
28 | 21 | # The full version, including alpha/beta/rc tags |
29 | 22 | release = __version__ |
30 | 23 |
|
| 24 | +# The short X.Y version |
| 25 | +version = ( |
| 26 | + __version__ if Version(release).public == release |
| 27 | + else f"dev ({release.partition('+')[0]})" |
| 28 | +) |
31 | 29 |
|
32 | 30 | # -- General configuration --------------------------------------------------- |
33 | 31 | extensions = [ |
34 | 32 | "sphinx.ext.autodoc", |
| 33 | + "sphinx.ext.coverage", |
35 | 34 | "sphinx.ext.doctest", |
| 35 | + "sphinx.ext.githubpages", |
| 36 | + "sphinx.ext.ifconfig", |
36 | 37 | "sphinx.ext.intersphinx", |
37 | | - "sphinx.ext.coverage", |
38 | 38 | "sphinx.ext.mathjax", |
39 | | - "sphinx.ext.ifconfig", |
| 39 | + "sphinx.ext.napoleon", |
40 | 40 | "sphinx.ext.viewcode", |
41 | | - "sphinx.ext.githubpages", |
42 | 41 | "sphinxcontrib.apidoc", |
43 | | - "sphinxcontrib.napoleon", |
| 42 | + "sphinx_multiversion", |
44 | 43 | ] |
45 | 44 |
|
46 | 45 | autodoc_mock_imports = [ |
|
55 | 54 | "svgutils", |
56 | 55 | "transforms3d", |
57 | 56 | ] |
| 57 | +autodoc_autoreload = True |
58 | 58 |
|
59 | 59 | # Accept custom section names to be parsed for numpy-style docstrings |
60 | 60 | # of parameters. |
61 | 61 | # Requires pinning sphinxcontrib-napoleon to a specific commit while |
62 | 62 | # https://github.com/sphinx-contrib/napoleon/pull/10 is merged. |
63 | | -napoleon_use_param = False |
64 | | -napoleon_custom_sections = [ |
65 | | - ("Inputs", "Parameters"), |
66 | | - ("Outputs", "Parameters"), |
67 | | -] |
| 63 | +# napoleon_use_param = False |
| 64 | +# napoleon_custom_sections = [ |
| 65 | +# ("Inputs", "Parameters"), |
| 66 | +# ("Outputs", "Parameters"), |
| 67 | +# ] |
68 | 68 |
|
69 | 69 | # Add any paths that contain templates here, relative to this directory. |
70 | 70 | templates_path = ["_templates"] |
|
213 | 213 |
|
214 | 214 | apidoc_module_dir = "../templateflow" |
215 | 215 | apidoc_output_dir = "api" |
216 | | -apidoc_excluded_paths = ["conftest.py", "*/tests/*", "tests/*", "data/*"] |
| 216 | +apidoc_excluded_paths = [ |
| 217 | + "conftest.py", |
| 218 | + "*/tests/*", |
| 219 | + "tests/*", |
| 220 | + "data/*", |
| 221 | +] |
217 | 222 | apidoc_separate_modules = True |
218 | 223 | apidoc_extra_args = ["--module-first", "-d 1", "-T"] |
219 | 224 |
|
220 | 225 | # -- Options for intersphinx extension --------------------------------------- |
221 | 226 |
|
222 | 227 | # Example configuration for intersphinx: refer to the Python standard library. |
223 | | -intersphinx_mapping = {"https://docs.python.org/": None} |
| 228 | +intersphinx_mapping = { |
| 229 | + "bids": ("https://bids-standard.github.io/pybids/", None), |
| 230 | + "matplotlib": ("https://matplotlib.org/", None), |
| 231 | + "nibabel": ("https://nipy.org/nibabel/", None), |
| 232 | + "nipype": ("https://nipype.readthedocs.io/en/latest/", None), |
| 233 | + "numpy": ("https://numpy.org/doc/stable/", None), |
| 234 | + "pandas": ("http://pandas.pydata.org/pandas-docs/dev", None), |
| 235 | + "python": ("https://docs.python.org/3/", None), |
| 236 | + "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), |
| 237 | +} |
224 | 238 |
|
225 | 239 | # -- Options for versioning extension ---------------------------------------- |
226 | | -scv_show_banner = True |
| 240 | +smv_branch_whitelist = r"^master$" |
| 241 | +smv_tag_whitelist = r"^\d+\.\d+\.\d+(?!rc|dev).*$" |
| 242 | +smv_released_pattern = r'^tags/.*$' |
| 243 | +smv_rebuild_tags = False |
0 commit comments