Skip to content

Move documentation to use sphinx.ext.autodoc - #1393

Open
r266-tech wants to merge 2 commits into
pypa:mainfrom
r266-tech:oss-autonomy/e5b8ed4ff12b-d3841dd76855
Open

Move documentation to use sphinx.ext.autodoc#1393
r266-tech wants to merge 2 commits into
pypa:mainfrom
r266-tech:oss-autonomy/e5b8ed4ff12b-d3841dd76855

Conversation

@r266-tech

@r266-tech r266-tech commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This contribution advances #567 by moving duplicated API-reference text into source docstrings and rendering the requirements and pylock modules through Sphinx autodoc.

The review rework follows the module-level automodule pattern established by #572 instead of listing individual classes and fields in the RST files. The pylock module docstring preserves the frozen, keyword-only dataclass contract, while class docstrings carry the field semantics without duplicate undoc-members rendering.

The changes remain limited to docs/requirements.rst, docs/pylock.rst, src/packaging/requirements.py, and src/packaging/pylock.py.

Verification:

  • uvx nox -s lint
  • uvx nox -s docs (strict HTML and LaTeX builds; 418 doctests, 0 failures)
  • git diff --check

@brettcannon brettcannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't following the practices used in the rest of the repo for documentation even when autodoc is used.

Comment thread src/packaging/pylock.py
class PackageVcs:
"""A package installed from a version control system.

:ivar str type: The version control system type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This :ivar stuff isn't used anywhere else and it pollutes the docstring such that help() becomes less readable.

@r266-tech

Copy link
Copy Markdown
Contributor Author

Reworked this to follow the module-level automodule approach used in merged #572 instead of enumerating individual classes and fields in the RST files.

I also kept the pylock frozen/keyword-only data-model contract in the module docstring and removed undoc-members so field descriptions are not rendered twice. I ran uvx nox -s lint and uvx nox -s docs; both passed, with the docs session completing strict HTML and LaTeX builds plus 418 doctests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants