Skip to content

Commit

Permalink
docs: workaround for sphinx-doc/sphinx#10701
Browse files Browse the repository at this point in the history
add workaround of @yarikoptic to conf.py for Sphinx 5.1.0

fixes #2224
  • Loading branch information
wagner-intevation committed Jul 25, 2022
1 parent 469dc49 commit 2ba2603
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ CHANGELOG
### Documentation
- Feeds: Add documentation for newly supported dataplane feeds, see above (PR#2102 by Mikk Margus Möll).
- Installation: Restructured the whole document to make it clearer and straight-forward (PR#2113 by Sebastian Wagner).
- Add workaround for https://github.com/sphinx-doc/sphinx/issues/10701 (PR#2225 by Sebastian Wagner, kudos @yarikoptic, fixes #2224).

### Packaging

Expand Down
22 changes: 22 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,25 @@ def run_autogen(_):
def setup(app):
app.connect("builder-inited", run_apidoc)
app.connect("builder-inited", run_autogen)



import sphinx
if sphinx.__version__ == '5.1.0':
# see https://github.com/sphinx-doc/sphinx/issues/10701
# workaround copied from https://github.com/datalad/datalad/pull/6883

# Although crash happens within NumpyDocstring, it is subclass of GoogleDocstring
# so we need to overload method there
from sphinx.ext.napoleon.docstring import GoogleDocstring
from functools import wraps


@wraps(GoogleDocstring._consume_inline_attribute)
def _consume_inline_attribute_safe(self):
try:
return self._consume_inline_attribute_safe()
except:
return "", []

GoogleDocstring._consume_inline_attribute = _consume_inline_attribute_safe

0 comments on commit 2ba2603

Please sign in to comment.