Hi! I have the following setup (the questions are at the end of the post):
sphinx==3.1.1 (also using sphinx.ext.napoleon and sphinx_autodoc_typehints(typehints_fully_qualified=True, always_document_param_types=True), but turning the extensions on/off changes literally nothing).
------------------
- docs
- source
- bar.rst
- baz.rst
- foo
- bar.py
- baz.py
------------------
foo/bar.py:
class Bar:
"""..."""
pass
foo/baz.py:
from third_part import Qux
from .bar import Bar
def baz(x: Bar, y: Qux):
"""..."""
...
docs/source/baz.rst:
foo.baz
=======
.. currentmodule:: foo.baz
.. automodule:: foo.baz
:members:
The problem: everything is correctly parsed in displayed, but "Bar" and "Qux" in the signature of "baz" are not links, it is plain text. Intersphinx is correctly configured for "third_party".
1. I've seen somewhere that with third-party modules there are no ways to make this work. Is it correct?
2. Ok, even if true, is the problem also unsolvable even for .Bar, which is a part of my package?
I know that I can "solve" 1-2 by putting the types manually in the docstring, but the whole point is not to duplicate types in the signature and in the docstring.
In the source code, they don't do anything special, the just say "data (Tensor): ...". How did they do that?