[docs] Fix moved intersphinx inventory URLs and document mock/intersphinx build behavior#64516
Open
dstrodtman wants to merge 4 commits into
Open
[docs] Fix moved intersphinx inventory URLs and document mock/intersphinx build behavior#64516dstrodtman wants to merge 4 commits into
dstrodtman wants to merge 4 commits into
Conversation
…vision Both inventories now 301-redirect to new canonical locations: pydantic (docs.pydantic.dev/latest -> pydantic.dev/docs/validation/latest) and torchvision (pytorch.org/vision -> docs.pytorch.org/vision, matching the existing torch entry). Point the config at the redirect targets to drop the extra hop and avoid a hard 404 if the old URLs stop redirecting. Left pandas and scipy untouched: their logged 'has moved' targets are GitHub's normal time-limited signed release-asset URLs, not real moves. Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
Add sourced comments to the settings whose intent isn't self-evident: - intersphinx_mapping: the (base_url, inventory_url) shape, why a few projects pin an explicit mirror inventory, and how to tell a real inventory move from GitHub's normal signed release-asset redirect. - remove_from_toctrees: prunes per-symbol API stubs from the nav tree (pages still built); mirrors the llms_txt_exclude API-ref entries. - html_sidebars: the Read the Docs vs local sidebar-template swap. - autosummary_filename_map: the case-insensitive filename collision it resolves for ray.serve.deployment vs ray.serve.Deployment. Comments only; no behavior change. Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
The API reference is auto-generated from source, so two build behaviors affect what contributors write in code but aren't documented anywhere: - Heavy dependencies are mocked (autodoc_mock_imports), so a module that imports one at import time must keep that import safe or the API-ref build breaks; prefer lazy imports and add new heavy deps to the mock list. - External types in public signatures link to their upstream docs via intersphinx_mapping; new external deps need an entry to resolve. Add a subsection to the docs-contribution guide (labeled for reference) and a pointer from the API policy page, where a contributor changing a public API is more likely to land. Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the documentation configuration and contributor guidelines to clarify how the API reference is built and rendered. Specifically, it adds explanatory comments to conf.py, updates external documentation links for pydantic and torchvision, and introduces a new section in the contributor guidelines explaining dependency mocking and type annotation linking via Intersphinx. The reviewer suggested a valuable improvement to clarify that Sphinx's autodoc sets typing.TYPE_CHECKING to True, meaning imports guarded by if TYPE_CHECKING: will still execute and require mocking.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Douglas Strodtman <douglas@anyscale.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
Two related bits of intersphinx/mocking maintenance for the docs build, plus documenting the build behavior that code contributors need to know about.
Changes
1. Update moved intersphinx inventory URLs (
doc/source/conf.py)The build log emits
intersphinx inventory has moved: A -> Bfor two projects whose docs genuinely relocated:pydantic:docs.pydantic.dev/latest/→pydantic.dev/docs/validation/latest/torchvision:pytorch.org/vision/stable/→docs.pytorch.org/vision/stable/(matching the existingtorchentry)Both now point at the redirect target, dropping the extra hop and avoiding a hard 404 if the old URLs ever stop redirecting.
pandasandscipyare left untouched — their logged "moved" targets are GitHub's normal signed, expiring release-asset URLs, not real moves.2. Document non-obvious
conf.pysettings (doc/source/conf.py, comments only)Comment blocks for
intersphinx_mapping(the(base_url, inventory_url)shape, the mirror-inventory rationale, and how to tell a real move from a signed release-asset redirect),remove_from_toctrees,html_sidebars, andautosummary_filename_map.3. Document API-ref build behavior for contributors (
doc/source/ray-contribute/)The API reference is auto-generated from source, so two build behaviors affect what contributors write in code but weren't documented anywhere:
autodoc_mock_imports), so a module that imports one at import time must keep that import safe or the API-ref build breaks. Prefer lazy imports; add new heavy deps to the mock list.intersphinx_mapping; a new external dependency needs an entry to resolve.Added as a labeled subsection in the docs-contribution guide, with a pointer from the API policy page where a contributor changing a public API is more likely to land.
No behavior change beyond the two URL updates in (1).
🤖 Generated with Claude Code