Open SamWilsn opened 2 years ago
Thank you so much for providing a reproducible case. This helped greatly.
The issue here is partly AutoAPI's fault and partly Sphinx's. AutoAPI documents file3 something like this:
.. py:data:: Transaction
.. py:function:: foo(x: Transaction)
However xrefs in a type annotation can only be resolved to a class (https://github.com/sphinx-doc/sphinx/blob/d3c91f951255c6729a53e38c895ddc0af036b5b9/sphinx/domains/python.py#L105-L257). So Sphinx then tries to resolve the xref in foo
s signature to one of the classes define in file1 or file2.
However there's no correct way to document a type alias currently (https://github.com/sphinx-doc/sphinx/issues/7896). So while AutoAPI could document the type alias as a class to get the xref to resolve, it's not really correct to do so. Really we should get a type alias directive added to Sphinx so that we can document type aliases correctly.
Hey! Our build is popping up a new warning after upgrading to the latest sphinx and autoapi.
Here's the setup:
file1.py
file2.py
file3.py
conf.py
Repro
You can find the whole repro here: https://github.com/SamWilsn/autoapi-mre
Build with:
tox -e doc
.