docs: Source the advertised API version from client.config.API_VERSION#11787
Open
rapsealk wants to merge 9 commits into
Open
docs: Source the advertised API version from client.config.API_VERSION#11787rapsealk wants to merge 9 commits into
client.config.API_VERSION#11787rapsealk wants to merge 9 commits into
Conversation
The homepage and install guide still advertised v6.20220615 as the latest API version, ~4 years out of date. Rather than hand-edit the strings on every release, source the value from `ai.backend.client.config.API_VERSION` and expose it as the Sphinx substitution `|api_version|` so the rendered docs stay in sync with the client's source of truth. The install guide's sample `curl` output now uses `parsed-literal::` instead of `code-block:: console` so both `|api_version|` and the existing `|release|` substitutions expand inside the block. Refs #11786. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
11786.doc.md -> 11787.doc.md Co-authored-by: octodog <mu001@lablup.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the documentation to avoid hard-coding the “Latest API version” string by sourcing it directly from the Python client’s ai.backend.client.config.API_VERSION, ensuring the rendered docs stay in sync with the codebase over time.
Changes:
- Add a Sphinx
|api_version|substitution indocs/conf.py, derived fromai.backend.client.config.API_VERSION. - Replace hard-coded API version strings in the docs with
|api_version|, including in a command output sample (viaparsed-literalto allow substitutions). - Update the Korean translation catalog entry to match the new placeholder-based source string.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/conf.py | Imports API_VERSION and defines rst_prolog substitution ` |
| docs/index.rst | Replaces hard-coded latest API version with ` |
| docs/install/install-from-package/install-manager.rst | Switches the curl example to parsed-literal and substitutes ` |
| docs/locales/ko/LC_MESSAGES/index.po | Updates the msgid/msgstr for the homepage API version line to use ` |
| changes/11786.doc.md | Adds a changelog fragment describing the documentation change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Importing `ai.backend.client.config` from `docs/conf.py` transitively imports `ai.backend.client.session`, which requires `aiohttp` — not installed in the docs build environment. Read the `API_VERSION` literal out of `client/config.py` with `ast.parse` instead so the docs build no longer depends on the client runtime. Verified locally: `make clean html` succeeds and the homepage renders "Latest API version: v9.20250722"; the install-manager curl example renders the version and `|release|` substitutions inside the parsed literal block. Refs #11786. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… add config back-pointer - `docs/install/install-from-package/install-manager.rst`: revert the switch to `parsed-literal::` and keep `code-block:: console` for the sample `curl` output. The substitution-based block lost the `console` lexer's prompt styling, leaving the page inconsistent with its sibling blocks. The version inside this one block is now hand-maintained again, but the prominent homepage advert (the more visible stale spot) still uses `|api_version|`. - `docs/conf.py`: move `import ast` to the top-level imports block. - `src/ai/backend/client/config.py`: add a comment next to `API_VERSION` pointing at `docs/conf.py:_read_api_version()` so future refactors of the constant surface the docs coupling. Refs #11786. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
client.config.API_VERSION
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ai.backend.client.config.API_VERSIONintodocs/conf.pyas the Sphinxsubstitution
|api_version|so the rendered API version stays in sync withthe client's source of truth.
v6.20220615string indocs/index.rstwith|api_version|.curlblock fromcode-block:: consoleto
parsed-literal::so|api_version|and|release|expand inside it..poentry to track the new placeholder-based msgid(drop stale
#, fuzzy).Resolves #11786.
Test plan
make htmlindocs/rendersv9.20250722on the homepage and insidethe
curl bai-m1:8081example.grep -rn "v6\.20220615" docs/hits remain..pomsgidfor the homepage version line contains|api_version|(not a literal version string).
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--11787.org.readthedocs.build/en/11787/
📚 Documentation preview 📚: https://sorna-ko--11787.org.readthedocs.build/ko/11787/