Skip to content

Commit 80a149a

Browse files
authored
Merge pull request #2225 from certtools/fix-2224
docs: workaround for sphinx-doc/sphinx#10701
2 parents 469dc49 + 2ba2603 commit 80a149a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ CHANGELOG
9898
### Documentation
9999
- Feeds: Add documentation for newly supported dataplane feeds, see above (PR#2102 by Mikk Margus Möll).
100100
- Installation: Restructured the whole document to make it clearer and straight-forward (PR#2113 by Sebastian Wagner).
101+
- Add workaround for https://github.com/sphinx-doc/sphinx/issues/10701 (PR#2225 by Sebastian Wagner, kudos @yarikoptic, fixes #2224).
101102

102103
### Packaging
103104

docs/conf.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,25 @@ def run_autogen(_):
116116
def setup(app):
117117
app.connect("builder-inited", run_apidoc)
118118
app.connect("builder-inited", run_autogen)
119+
120+
121+
122+
import sphinx
123+
if sphinx.__version__ == '5.1.0':
124+
# see https://github.com/sphinx-doc/sphinx/issues/10701
125+
# workaround copied from https://github.com/datalad/datalad/pull/6883
126+
127+
# Although crash happens within NumpyDocstring, it is subclass of GoogleDocstring
128+
# so we need to overload method there
129+
from sphinx.ext.napoleon.docstring import GoogleDocstring
130+
from functools import wraps
131+
132+
133+
@wraps(GoogleDocstring._consume_inline_attribute)
134+
def _consume_inline_attribute_safe(self):
135+
try:
136+
return self._consume_inline_attribute_safe()
137+
except:
138+
return "", []
139+
140+
GoogleDocstring._consume_inline_attribute = _consume_inline_attribute_safe

0 commit comments

Comments
 (0)