Skip to content

Pin ty to 0.0.10 and clear remaining check failures - #14538

Merged
picnixz merged 7 commits into
sphinx-doc:masterfrom
adamtheturtle:adamtheturtle/fix-ty-failing
Aug 6, 2026
Merged

picnixz merged 7 commits into
sphinx-doc:masterfrom
adamtheturtle:adamtheturtle/fix-ty-failing

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Pin ty to 0.0.10 (newest release that stays green with the existing ty.toml ignores).
  • Rename ignored rule non-subscriptable → not-subscriptable.
  • Rewrite three call sites that are the only remaining failures under that pin

adamtheturtle and others added 4 commits July 17, 2026 14:52
Stop floating to the latest ty release, and rename `non-subscriptable` to `not-subscriptable` for current ty.

Co-authored-by: Cursor <[email protected]>
Expand ty.toml ignores so the pinned checker is green, and remove `# ty: ignore` comments that are unused under those rules.

Co-authored-by: Cursor <[email protected]>
0.0.59 still reports hundreds of diagnostics with the current rule
ignores. Pin the newest release that stays green without expanding
ty.toml, rename `not-subscriptable`, and rewrite the three call sites
that fail under that pin.

Co-authored-by: Cursor <[email protected]>
@adamtheturtle adamtheturtle changed the title Pin ty to 0.0.59 and update renamed rule Pin ty to 0.0.10 and avoid three false-positive patterns Jul 17, 2026
Keep the ty pin and ty.toml rule rename only.

Co-authored-by: Cursor <[email protected]>
@adamtheturtle adamtheturtle changed the title Pin ty to 0.0.10 and avoid three false-positive patterns Pin ty to 0.0.10 and rename not-subscriptable rule Jul 17, 2026
These are the only diagnostics left with the current ty.toml ignores.

Co-authored-by: Cursor <[email protected]>
@adamtheturtle adamtheturtle changed the title Pin ty to 0.0.10 and rename not-subscriptable rule Pin ty to 0.0.10 and clear remaining check failures Jul 17, 2026
@jdillard

jdillard commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

This seems to also contain the change in #14537, should that be separate or should it be closed and included in here?

edit: I ended up closing #14537 to keep things together.

@jdillard

jdillard commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

I think 0.0.10 is great to get CI passing again, but the relase is from 2026-01-07 and we should have a follow up plan to update it.

basename == '__init__' + suffix
for suffix in sorted(PY_SUFFIXES, key=len, reverse=True)
)
return any(basename == '__init__' + suffix for suffix in PY_SUFFIXES)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sort cannot affect equality-based results, and removing it avoids rebuilding and sorting the suffix list on every call while restoring .py as the first/common case.

Also, existing apidoc tests seem to cover relevant suffix behavior. So this looks good to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and it's clearer that way I should say.

@jdillard jdillard added this to the 9.1.1 milestone Jul 23, 2026
@jdillard

Copy link
Copy Markdown
Member

@picnixz you think this is a good quick fix to get the ty check passing again?

@kaycebasques

Copy link
Copy Markdown
Contributor

Re: the failing Python 3.12 (Docutils 0.21) check, I can't reproduce locally. I tried a bunch of parallelization and randomization options (see below) but I was never able to get that test_numfig_disabled_warn test failure to repeat.

uv run --python 3.12 --group test --with 'docutils==0.21.*' pytest tests/ -q
uv run --python 3.12 --group test --with 'docutils==0.21.*' --with pytest-randomly pytest tests/ -q
uv run --python 3.12 --group test --with 'docutils==0.21.*' --with pytest-xdist pytest tests/ -n auto -q
uv run --python 3.12 --group test --with 'docutils==0.21.*' --with pytest-xdist --with pytest-randomly pytest tests/ -n auto -q
uv run --python 3.12 --group test --with 'docutils==0.21.*' --with pytest-reverse pytest tests/ --reverse -q

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

thank you @adamtheturtle I think your approach is the most logical first step towards fixing the failing ty check. more comments here: #14238 (comment)

Comment thread sphinx/util/_serialise.py Outdated
if isinstance(obj, (list, tuple, set, frozenset)):
# Convert to a sorted list
return sorted(map(_stable_str_prep, obj), key=str)
return sorted((_stable_str_prep(x) for x in obj), key=str)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this one, please just add a ty ignore guard or whatever that would be convenient for us. Likewise for the filter() usage in matching.py

Comment thread pyproject.toml
"mypy==1.19.1",
"pyrefly",
"pyright==1.1.407",
"ty",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment about why we need to pin it?

@kaycebasques

Copy link
Copy Markdown
Contributor

I think everything is done and resolved, let's merge? @picnixz I think you need to do the merge because of the failing checks? Those failing tests (test_epub_anchor_id and test_text_figure_captions) seem to be failing everywhere e.g. https://github.com/sphinx-doc/sphinx/actions/runs/30857663593/job/91832340742?pr=14578 i.e. they don't seem related to the ty changes introduced here

@picnixz
picnixz merged commit b06d92e into sphinx-doc:master Aug 6, 2026
25 of 27 checks passed
@picnixz

picnixz commented Aug 6, 2026

Copy link
Copy Markdown
Member

Sorry I was away for the past 2 weeks and I forgot about this PR. Thanks for the ping!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants