-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
I have a method in a private module which references in a type hint another class from another private module.
Both are then reexported in the __init__ file.
autodoc can render the references as expected: Return type: Foo. autoapi however cannot do that: Return type: project._other.Foo
project/__init__
from __future__ import annotations
from project._other import Foo
from project._private import create_foo
__all__ = ["Foo", "create_foo"]_project/other.py
class Foo:
"""A simple Foo class."""_project/private.py
from project._other import Foo
def create_foo() -> Foo:
"""Factory function to create a Foo instance."""
return Foo()project_docs/conf.py
from __future__ import annotations
project = "Project"
extensions = [
"sphinx.ext.napoleon",
"autoapi.extension",
"sphinx.ext.autodoc",
]
autoapi_dirs = ["../project"]
autoapi_root = "api"
autodoc_typehints = "description"
autoapi_options = [
"members",
"undoc-members",
"show-inheritance",
"show-module-summary",
"imported-members",
"special-members",
]
autoapi_ignore = ["_[^_].*"]
autoapi_add_toctree_entry = False
autoapi_keep_files = True
```
_project_docs/index.rst_
```rst
Project
=======
.. toctree::
:maxdepth: 2
:caption: Contents:
api/project/index
.. automodule:: project
:members:
```Metadata
Metadata
Assignees
Labels
No labels