Skip to content

DM-56680: Stop using the tuple interface of intersphinx inventory items in autotypes - #557

Merged
jonathansick merged 2 commits into
mainfrom
tickets/DM-56680-autotypes-inventory-uri
Nov 10, 2026
Merged

jonathansick merged 2 commits into
mainfrom
tickets/DM-56680-autotypes-inventory-uri

Conversation

@jonathansick

Copy link
Copy Markdown
Member

Summary

documenteer.ext.autotypes.xrefs read an intersphinx inventory item's URI as entries[name][2] in two places (_resolve_intersphinx and _intersphinx_terminal_index). Sphinx 8.2 deprecated that tuple interface (RemovedInSphinx10Warning) and Sphinx 10 removes it.

  • Both call sites now go through a new _inventory_item_uri helper, which reads the item's uri attribute and falls back to item[2] only when the item has none.
  • The fallback is needed because pyproject.toml allows Sphinx>=8: I checked Sphinx 8.0.2 and 8.1.3, and there inventory items are still plain tuples with no uri attribute (_InventoryItem first appears in 8.2.0). Keeping the fallback avoids raising the Sphinx floor.
  • The cast("str", ...) wrappers and the now-unused cast import are gone.

Validation steps

  • nox -s "test-3.13(sphinx='8')", "test-3.13(sphinx='9')", and "test-3.13(sphinx='dev')": 1182 passed on each.
  • test_autotypes_inherited_docstring_links now asserts the build emits no "tuple interface" warning, and two unit tests cover the helper for a plain tuple and for an attribute-style item.
  • The full test output on all three Sphinx sessions contains no RemovedInSphinx10Warning from any source, which covers the issue's "grep before widening to Sphinx 10" item for the current test suite.
  • typing-3.13 on Sphinx 8 and 9, and nox -s lint, pass.

Not run: the test suite against Sphinx 8.0 or 8.1 (the nox sphinx='8' session resolves a later 8.x); the tuple fallback for those versions is covered by the unit test only.

References

Closes #556

Sphinx 8.2 deprecated the tuple interface of intersphinx inventory
items and Sphinx 10 removes it. Read the item's uri attribute when it
has one, and index it as a tuple only on Sphinx 8.0 and 8.1, where
inventory items are still plain tuples.
@github-actions

Copy link
Copy Markdown

Documentation preview

Edition URL
DM-56680-autotypes-inventory-uri https://documenteer.lsst.io/v/DM-56680-autotypes-inventory-uri/

Build 1xxz-vqka-ekc5-75 processed successfully.

@jonathansick
jonathansick merged commit 83fc71c into main Nov 10, 2026
15 checks passed
@jonathansick
jonathansick deleted the tickets/DM-56680-autotypes-inventory-uri branch November 10, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

autotypes: stop using the deprecated tuple interface of intersphinx inventory items (RemovedInSphinx10Warning)

1 participant