-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] Auto-generate Python API docs from code #15822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[py] Auto-generate Python API docs from code #15822
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Were the changes to api.rst performed by the script? |
Yes, they were. There are some minor differences from the old |
Sweet, good work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
User description
🔗 Related Issues
Fixes #14178
💥 What does this PR do?
This PR updates the Python documentation build process so API documentation is auto-generated from code. Previously, we had to manually keep
./py/docs/source/api.rst
updated when new modules were added so they were included in the API docs (which was often forgotten).Now, we have a script (
./py/generate_api_module_listing.py
) that scans the codebase for Python modules and generates a newapi.rst
file. This file is later used bysphinx-autogen
to generate sphinx autodoc stub pages used in the Python API documentation.The docs can be built using
tox -c py/tox.ini -e docs
or./go py:docs
.Other changes:
.readthedocs.yaml
config file to use the new scriptMakefile
🔄 Types of changes
PR Type
Enhancement, Documentation
Description
Automate generation of Python API docs from codebase
api.rst
from modulesUpdate documentation build process and configs
Regenerate and restructure
api.rst
for autodocChanges walkthrough 📝
generate_api_module_listing.py
Add script to auto-generate API module listing
py/generate_api_module_listing.py
selenium
package for modulesdocs/source/api.rst
for Sphinx autodoc.readthedocs.yaml
Update ReadTheDocs config for auto-generated API docs
py/docs/.readthedocs.yaml
api.rst
tox.ini
Update tox docs environment for auto-generated API docs
py/tox.ini
Makefile
Remove obsolete Sphinx Makefile
py/docs/Makefile
README.rst
Update docs for automated API doc generation
py/docs/README.rst
api.rst
maintenance and Makefileapi.rst
Regenerate and restructure API reference file
py/docs/source/api.rst