Package: nipype / 1.6.0-2

sphinx.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 20 Feb 2020 19:39:13 +0100
Description: Get sphinx doc somehow building

--- a/doc/conf.py
+++ b/doc/conf.py
@@ -35,7 +35,9 @@ shutil.rmtree(python_dir, ignore_errors=
 ex2rst = str(conf_py.parent.parent / "tools" / "ex2rst")
 
 with TemporaryDirectory() as tmpdir:
-    sp.run(
+    # Debian: no online resources should be accessed during build
+    if False:
+        sp.run(
         [
             "git",
             "clone",
@@ -47,6 +49,7 @@ with TemporaryDirectory() as tmpdir:
         check=True,
     )
     source_dir = Path(tmpdir) / "package" / "niflow" / "nipype1" / "examples"
+    source_dir.mkdir(parents=True)  # Debian: fake one, no content
     shutil.copytree(
         source_dir,
         python_dir,
@@ -69,7 +72,8 @@ sp.run(
     ],
     check=True,
 )
-sp.run(
+if False:
+    sp.run(
     [
         sys.executable,
         ex2rst,
@@ -120,18 +124,19 @@ autodoc_mock_imports = [
     "vtk",
 ]
 
-# Accept custom section names to be parsed for numpy-style docstrings
-# of parameters.
-# Requires pinning sphinxcontrib-napoleon to a specific commit while
-# https://github.com/sphinx-contrib/napoleon/pull/10 is merged.
-napoleon_use_param = False
-napoleon_custom_sections = [
-    ("Inputs", "Parameters"),
-    ("Outputs", "Parameters"),
-    ("Attributes", "Parameters"),
-    ("Mandatory Inputs", "Parameters"),
-    ("Optional Inputs", "Parameters"),
-]
+# Debian: comes as sphinx.ext.napoleon, we do not use pinned one
+# # Accept custom section names to be parsed for numpy-style docstrings
+# # of parameters.
+# # Requires pinning sphinxcontrib-napoleon to a specific commit while
+# # https://github.com/sphinx-contrib/napoleon/pull/10 is merged.
+# napoleon_use_param = False
+# napoleon_custom_sections = [
+#     ("Inputs", "Parameters"),
+#     ("Outputs", "Parameters"),
+#     ("Attributes", "Parameters"),
+#     ("Mandatory Inputs", "Parameters"),
+#     ("Optional Inputs", "Parameters"),
+# ]
 
 
 on_rtd = os.environ.get("READTHEDOCS") == "True"
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -5,5 +5,3 @@ nbsphinx
 sphinx-argparse
 sphinx>=2.1.2
 sphinxcontrib-apidoc
-sphinxcontrib-napoleon
-niflow-nipype1-workflows
--- a/nipype/sphinxext/apidoc/docstring.py
+++ b/nipype/sphinxext/apidoc/docstring.py
@@ -2,8 +2,8 @@
 # vi: set ft=python sts=4 ts=4 sw=4 et:
 """Reformat interface docstrings."""
 import re
-from sphinxcontrib.napoleon._upstream import _
-from sphinxcontrib.napoleon.docstring import NumpyDocstring
+from sphinx.locale import _
+from sphinx.ext.napoleon.docstring import NumpyDocstring
 
 
 class NipypeDocstring(NumpyDocstring):
--- a/nipype/sphinxext/apidoc/__init__.py
+++ b/nipype/sphinxext/apidoc/__init__.py
@@ -2,7 +2,7 @@
 # vi: set ft=python sts=4 ts=4 sw=4 et:
 """Settings for sphinxext.interfaces and connection to sphinx-apidoc."""
 import re
-from sphinxcontrib.napoleon import (
+from sphinx.ext.napoleon import (
     Config as NapoleonConfig,
     _patch_python_domain,
     _skip_member as _napoleon_skip_member,