readthedocs / sphinx-autoapi

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

`autoapimodule` directive in "manual mode": Imported members are documented #342

Open tony opened 2 years ago

tony commented 2 years ago

image

Above: Imports visible in documentation with .. autoapimodule directive

Related: #262, #317

Reproduction

https://github.com/vcs-python/libvcs/tree/autoapi-duplicates

Versions

sphinx 5.1.0 sphinx-autoapi 1.9.0

Configuration

conf.py

extensions = [
    "sphinx.ext.napoleon",
    "autoapi.extension",
    "sphinx.ext.autodoc",
    "sphinx.ext.todo",
    "sphinx.ext.intersphinx",
    "myst_parser",
]

# sphinx-autoapi
autoapi_type = "python"
autoapi_dirs = [project_root / "libvcs"]
autoapi_generate_api_docs = False  # when False, use directives

Directions

![image](https://user-images.githubusercontent.com/26336/177055330-93b97de5-fc31-46bd-808b-3ad46dbf3986.png)

Workaround

Workaround ATM exclude-members for each usage:

  .. autoapimodule:: libvcs.projects.git
     :members:
     :show-inheritance:
     :undoc-members:
     :exclude-members: BaseProject, StrOrBytesPath, StrPath

Discussion

tony commented 1 year ago

Updated example from sphinx 5.0 to 5.1, autoapi 1.8.0 -> 1.9.0

ashb commented 1 year ago

Not sure if this is the same issue, related or something else entirely, but the autoapi-skip-member event also doesn't seem to fire for things documented by autoapimodule directives.