readthedocs / readthedocs/sphinx-autoapi
`autoapimodule` directive in "manual mode": Imported members are documented
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 494
- Forks
- 147
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description

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
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
git clone https://github.com/vcs-python/libvcs.git --branch autoapi-duplicatescd libvcspoetry installmake start_docs- http://localhost:127.0.0.1
- Examples:
projects.git
localhost: http://localhost:8064/projects/git.html
markdown source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/docs/projects/git.md
python source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/libvcs/projects/git.pycmd.git
localhost: http://localhost:8064/cmd/git.html
markdown source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/docs/cmd/git.md
python source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/libvcs/cmd/git.py_internal.run
localhost: http://localhost:8064/internals/run.html, e.g.StrOrBytesPath
markdown source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/docs/internals/run.md
python source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/libvcs/_internal/run.py
- Workarounds to scope:
__all__does not work:projects.hg
localhost: http://localhost:8064/projects/hg.html
markdown source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/docs/projects/hg.md
python source: https://github.com/vcs-python/libvcs/blob/autoapi-duplicates/libvcs/projects/hg.py

Workaround
Workaround ATM exclude-members for each usage:
.. autoapimodule:: libvcs.projects.git
:members:
:show-inheritance:
:undoc-members:
:exclude-members: BaseProject, StrOrBytesPath, StrPath
Discussion
- Any better workarounds?
- Is this a bug or expected behavior?
- Could my package structure be playing a role?
- Anyone else experiencing this? Ideas / workarounds?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction branch and docs/conf.py, then run make start_docs and inspect the projects.git, cmd.git, and _internal.run pages. Compare each Markdown directive with its Python source under libvcs; done means manual-mode autoapimodule pages no longer document imported members without relying on per-use exclude-members.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100