readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
432 stars 128 forks source link

__all__ doesn't seem to be respected #435

Closed wbthomason closed 4 months ago

wbthomason commented 5 months ago

Apologies if this is just me missing something - I'm new to both sphinx and autoapi, but: in contrast to the docs, __all__ does not seem to be respected in my package.

Specifically, I have a directory structure like:

src/mymodule
  __init__.py
  _impl/
    sub_a.py
    sub_b.py

In __init__.py I have from ._impl import sub_a as sub_a, etc., as well as __all__ = ("sub_a", "sub_b").

I would expect this to result in mymodule.sub_a and mymodule.sub_b being documented - but neither is, unless I enable documentation of private members, in which case they're documented as mymodule._impl.sub_a.

Is this expected behavior, and I'm making some mistake? If so, is there anything I can do (ideally short of template customization, if possible) to get the behavior I'm after?

Thanks, and thanks for autoapi - it's quite nice to use!

Ozaq commented 4 months ago

Seems to be related to #298.

AWhetter commented 4 months ago

Closing as a duplicate of #298