Skip to content

[docs] Fix moved intersphinx inventory URLs and document mock/intersphinx build behavior#64516

Open
dstrodtman wants to merge 4 commits into
ray-project:masterfrom
dstrodtman:djs-260702-intersphinx-moved-urls
Open

[docs] Fix moved intersphinx inventory URLs and document mock/intersphinx build behavior#64516
dstrodtman wants to merge 4 commits into
ray-project:masterfrom
dstrodtman:djs-260702-intersphinx-moved-urls

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

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 -> B for 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 existing torch entry)

Both now point at the redirect target, dropping the extra hop and avoiding a hard 404 if the old URLs ever stop redirecting. pandas and scipy are left untouched — their logged "moved" targets are GitHub's normal signed, expiring release-asset URLs, not real moves.

2. Document non-obvious conf.py settings (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, and autosummary_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:

  • 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; add new heavy deps to the mock list.
  • External types in public signatures link to their upstream docs via 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

…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>
@dstrodtman dstrodtman requested review from a team as code owners July 2, 2026 19:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 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.

Comment thread doc/source/ray-contribute/docs.md Outdated
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Jul 2, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Douglas Strodtman <douglas@anyscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant