-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[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.rstupdated 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.rstfile. This file is later used bysphinx-autogento generate sphinx autodoc stub pages used in the Python API documentation.The docs can be built using
tox -c py/tox.ini -e docsor./go py:docs.Other changes:
.readthedocs.yamlconfig file to use the new scriptMakefile🔄 Types of changes
PR Type
Enhancement, Documentation
Description
Automate generation of Python API docs from codebase
api.rstfrom modulesUpdate documentation build process and configs
Regenerate and restructure
api.rstfor autodocChanges walkthrough 📝
generate_api_module_listing.py
Add script to auto-generate API module listingpy/generate_api_module_listing.py
seleniumpackage for modulesdocs/source/api.rstfor Sphinx autodoc.readthedocs.yaml
Update ReadTheDocs config for auto-generated API docspy/docs/.readthedocs.yaml
api.rsttox.ini
Update tox docs environment for auto-generated API docspy/tox.ini
Makefile
Remove obsolete Sphinx Makefilepy/docs/Makefile
README.rst
Update docs for automated API doc generationpy/docs/README.rst
api.rstmaintenance and Makefileapi.rst
Regenerate and restructure API reference filepy/docs/source/api.rst