Skip to content

Commit

Permalink
fix(build):Workaround for sphinx build process see sphinx-doc/sphinx#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBaker0 committed Jul 25, 2022
1 parent 5fd1eeb commit ee7bc4f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/conf.py
Expand Up @@ -34,3 +34,24 @@
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"


# Temporary workaround for 5.1.0 bug
import sphinx
if sphinx.__version__ == '5.1.0':
# see https://github.com/sphinx-doc/sphinx/issues/10701
# hope is it would get fixed for the next release

# 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 ee7bc4f

Please sign in to comment.