Skip to content

Bump types-docutils and fix ty type checker errors#14328

Open
adamtheturtle wants to merge 2 commits intosphinx-doc:masterfrom
adamtheturtle:adamtheturtle/fix-ty-issues-docutils
Open

Bump types-docutils and fix ty type checker errors#14328
adamtheturtle wants to merge 2 commits intosphinx-doc:masterfrom
adamtheturtle:adamtheturtle/fix-ty-issues-docutils

Conversation

@adamtheturtle
Copy link
Copy Markdown
Contributor

Purpose

Bump types-docutils to the latest version (0.22.3.20260223) and fix all ty type checker errors to align with the new version.

The new types-docutils version added __slots__ = () to the VersionInfo class. Combined with a newer ty version (0.0.18), this revealed 115 type checking errors in the Sphinx codebase that were previously undetected by older ty versions.

Changes

  • pyproject.toml: Updated types-docutils from 0.22.3.20251115 to 0.22.3.20260223
  • ty.toml: Renamed non-subscriptablenot-subscriptable (15 errors fixed)
  • Code fixes: Added inline # ty: ignore[rule] comments for 100+ false positives:
    • Napoleon config attribute access (20 suppressions)
    • Autosummary entry attribute access (7 suppressions)
    • C/C++ domain symbol/AST attribute access (40+ suppressions where ty can't narrow union types)
    • Jinja2 SandboxedEnvironment, regex patterns, type forms, and other edge cases
    • Added None checks for reference node access in intersphinx

Status

  • ✅ ty check: 0 errors
  • ✅ mypy: Passing (243 source files)

Resolves #14317

adamtheturtle and others added 2 commits March 1, 2026 06:43
- Update types-docutils from 0.22.3.20251115 to 0.22.3.20260223
- Fix 115 ty errors by updating renamed rule names and adding inline suppressions
- Update ty.toml: rename non-subscriptable → not-subscriptable
- Add ty ignore comments for false positives in Napoleon config, autosummary,
  C/C++ domain code, and other modules where ty can't narrow union types
- Add None checks for reference node access in intersphinx

ty check now passes with 0 errors while keeping mypy passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove redundant inline comment from line 153 to bring it within
the 95-character line length limit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2026
@adamtheturtle adamtheturtle reopened this Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant