[py] Auto-generate Python API docs from code by cgoldberg ยท Pull Request #15822 ยท SeleniumHQ/selenium
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 new api.rst file. This file is later used by sphinx-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:
- update
.readthedocs.yamlconfig file to use the new script - remove unused
Makefile
๐ Types of changes
- build infrastructure
- documentation
PR Type
Enhancement, Documentation
Description
-
Automate generation of Python API docs from codebase
- Add script to generate
api.rstfrom modules - Remove manual maintenance of API module list
- Add script to generate
-
Update documentation build process and configs
- Modify tox and ReadTheDocs to use new script
- Remove obsolete Makefile and update README
-
Regenerate and restructure
api.rstfor autodoc
Changes walkthrough ๐
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
| ||||
| Configuration changes |
| ||||
| Cleanup |
| ||||
| Documentation |
|
Need help?
Type /help how to ...in the comments thread for any questions about Qodo Merge usage.Check out the documentation for more information.