Describe the bug
I am using Sphinx for autodoc . This bug is regression issue caused in Sphinx==3.2.0, which relates to
[https://github.com/sphinx-doc/sphinx/issues/965]
I am using absolute path of my class kartothek.core.dataset.DatasetMetadata and Sphinx3.2.0 throws below error.
This worked well, when I used sphinx==3.1.2
`Warning, treated as error:
docstring of xx.yy.zz:py:class reference target not found: A.B.C.D]]
To Reproduce
Steps to reproduce the behavior:
Install sphinx==3.2.0
Use absolute path of a class in the documentation.
Expected behavior
Sphinx to accept the absolute path of the class.
Some more details for the bug above:
from sphinx import __version__ as version
from sphinx.ext.napoleon import NumpyDocstring
print(version)
print("=== Variant 1 ===")
docstring1 = """
Parameters
----------
arg: Union[str, my_package.MyClass]
An argument.
"""
print(str(NumpyDocstring(docstring1)))
print("=== Variant 2 ===")
docstring2 = """
Parameters
----------
arg: Union[str,my_package.MyClass]
An argument.
"""
print(str(NumpyDocstring(docstring2)))
It seems that the arg parser should not split spaces within the type description:
3.2.0
=== Variant 1 ===
:param arg: An argument.
:type arg: :class:`Union[str`, :class:`my_package.MyClass]`
=== Variant 2 ===
:param arg: An argument.
:type arg: :class:`Union[str,my_package.MyClass]`
Here it doesn't matter at all because types are not automatically linked:
3.1.2
=== Variant 1 ===
:param arg: An argument.
:type arg: Union[str, my_package.MyClass]
=== Variant 2 ===
:param arg: An argument.
:type arg: Union[str,my_package.MyClass]
Sorry for the inconvenience. This was fixed by #8095.
Most helpful comment
Sorry for the inconvenience. This was fixed by #8095.