readthedocs / readthedocs/sphinx-autoapi

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

Open
#342 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Language: Python
Dominant language
Python
Stars
494
Forks
147
Avg merge
9m
Merged PRs (30d)
1

Description

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.