-
Notifications
You must be signed in to change notification settings - Fork 333
[Bugfix][Docs] Update documentation build process and configurations for autoapi support #663
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
Conversation
…for autoapi support
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome 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.
Summary of Changes
Hello @xwhzz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly refactors the project's documentation build system by transitioning from a manual sphinx-apidoc setup to an automated sphinx-autoapi workflow for generating Python API documentation. The changes aim to simplify the documentation process, improve maintainability, and ensure more comprehensive API coverage.
Highlights
- Documentation Tooling Migration: The core change involves migrating the Python API documentation generation from the traditional
sphinx-apidocapproach to using thesphinx-autoapiextension. This streamlines the process by allowingautoapito automatically discover and document Python modules. - Sphinx Configuration Updates: The
docs/conf.pyfile has been significantly updated to integrateautoapi. This includes addingautoapi.extensionto the Sphinx extensions, defining the source directories for API generation (../tilelang), and configuringautoapioptions such as including members, handling undocumented members, and ignoring specific modules (e.g.,ast,parser). Oldautodocandautosummaryextensions were removed. - Build Process Refinement: The
docs/Makefilenow includes a dedicatedcleantarget to removeautoapigenerated files, and the manualsphinx-apidoccall has been removed. Themaint/scripts/build_docs.shscript has been simplified by removing unnecessary test and editable package installations, focusing solely on documentation dependencies and adding--no-userfor pip installs. - Dependency Management: The
docs/requirements.txtfile has been updated to includesphinx-autoapiandastroid(a dependency forautoapi), while also removing specific version pins for other Sphinx-related packages to allow for more flexible dependency resolution.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request updates the documentation build process to use sphinx-autoapi instead of sphinx-apidoc. The changes include updating the Makefile, conf.py, and requirements.txt.
My review focuses on ensuring the new documentation build process is robust and maintainable. I've identified a few issues:
- The build script is missing a step to install the project, which is likely necessary for
autoapito function correctly. - Dependencies in
requirements.txthave been unpinned, which could lead to non-reproducible builds. - There are also a couple of minor maintainability and style issues in the configuration and requirements files.
Overall, the switch to autoapi is a good improvement, and the suggested changes should help make the implementation more solid.
| sphinx | ||
| sphinx-reredirects | ||
| sphinx-tabs | ||
| sphinx-toolbox | ||
| sphinxcontrib-napoleon | ||
| sphinxcontrib_httpdomain |
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.
The version pins for several dependencies have been removed. This can lead to non-reproducible builds, as pip might install newer, potentially breaking versions of these packages in the future. It is a best practice to pin dependency versions in requirements.txt to ensure build stability. The newly added sphinx-autoapi is pinned, which is great. The same should be applied to other dependencies.
sphinx == 5.2.3
sphinx-reredirects==0.1.2
sphinx-tabs == 3.4.1
sphinx-toolbox == 3.4.0
sphinxcontrib-napoleon==0.7
sphinxcontrib_httpdomain==1.8.1
| python -m pip install -r docs/requirements.txt | ||
| python -m pip install -e . | ||
| python -m pip install --upgrade pip --no-user | ||
| python -m pip install -r docs/requirements.txt --no-user |
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.
The command to install the project in editable mode (pip install -e .) has been removed. sphinx-autoapi often needs to import the package to inspect it and generate documentation. Without installing the package, the documentation build might fail or produce incomplete results. It's recommended to add back the command to install the project in editable mode.
| python -m pip install -r docs/requirements.txt --no-user | |
| python -m pip install -r docs/requirements.txt --no-user | |
| python -m pip install -e . --no-user |
|
|
||
| autodoc_typehints = 'description' | ||
|
|
||
| autoapi_ignore = ["*language/ast*", "*version*", "*libinfo*", "*parser*"] |
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.
The glob pattern "*parser*" in autoapi_ignore is a bit broad and could potentially match other files or directories unintentionally in the future. For better precision and maintainability, it's recommended to use a more specific pattern like "*language/parser*".
| autoapi_ignore = ["*language/ast*", "*version*", "*libinfo*", "*parser*"] | |
| autoapi_ignore = ["*language/ast*", "*version*", "*libinfo*", "*language/parser*"] |
docs/conf.py
Outdated
| # # add additional overrides | ||
| # templates_path += [tlcpack_sphinx_addon.get_templates_path()] | ||
| # html_static_path += [tlcpack_sphinx_addon.get_static_path()] | ||
| } |
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.
| uvicorn | ||
| myst-parser | ||
| sphinx-autoapi == 3.6.0 | ||
| astroid |
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.
…for autoapi support (tile-ai#663) * [Bugfix][Docs] Update documentation build process and configurations for autoapi support * lint fix
No description provided.