Skip to content

Linting: ty: resolve typechecking failures - #14239

Closed
jayaddison wants to merge 6 commits into
sphinx-doc:masterfrom
jayaddison:issue-14238/ty-resolve-or-suppress-typechecking-failures
Closed

jayaddison wants to merge 6 commits into
sphinx-doc:masterfrom
jayaddison:issue-14238/ty-resolve-or-suppress-typechecking-failures

Conversation

@jayaddison

@jayaddison jayaddison commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Aims to restore a passing result from the ty linting job, by fixing some false-positive error reports, so that commits and pull requests are not misleadingly marked as failures.

Does this by:

NB: Also pins the version of ty, to improve development environment typechecking consistency.

References

Edit: update description to mention added version-pinning.

These have been reported as an upstream bug in `ty`:

  - astral-sh/ty#1970
NB: I'm surprised that `ty` does not also report an instance of
the `no-matching-overload` rule at this location, because there is
use of `sorted(...)` with keywords.

It doesn't report that, though - so I figure it's probably better to
omit it from the ignore-list.  Either it is fixed upstream and never
reports a problem, or it does begin reporting as an error and can be
ignored.

Relates-to commit b2305e6.
@jayaddison

Copy link
Copy Markdown
Contributor Author

There was one reoccurrence of Windows continuous integration bug #12038 at commit eee7b09: https://github.com/sphinx-doc/sphinx/actions/runs/20698476422/job/59417236220#step:9:2564

@AA-Turner do you think it is worth unlocking and reopening that bug?

@danieleades

Copy link
Copy Markdown
Contributor

how did the ty errors creep in?

unpinned linters? merging PRs with failing jobs?

@jayaddison

Copy link
Copy Markdown
Contributor Author

@danieleades

how did the ty errors creep in?

unpinned linters? merging PRs with failing jobs?

It's a regression in a more-recent version of ty than was in use when we began using it, and yep, that's because we don't pin the version. Ref:

"ty",

@danieleades

Copy link
Copy Markdown
Contributor

@jayaddison, worth pinning ty in this PR? or is that stretching the scope a little

@jayaddison

Copy link
Copy Markdown
Contributor Author

@jayaddison, worth pinning ty in this PR? or is that stretching the scope a little

Seems reasonable to me, for development environment consistency. AFAIK Dependabot is able to find and update versions pinned in pyproject.toml groups.

@jayaddison

Copy link
Copy Markdown
Contributor Author

Thanks @danieleades

@danieleades

Copy link
Copy Markdown
Contributor

@AA-Turner it would be really good to get this merged, as this is breaking CI for all open PRs

@jayaddison

Copy link
Copy Markdown
Contributor Author

Note: there have been a few updates to ty since this PR was approved, and I think that upgrading to the latest version would cause a few other warnings/errors during linting -- so, mostly just a reminder that we would want to update the codebase and ty after this, I expect.

@jayaddison

Copy link
Copy Markdown
Contributor Author

Note: from v0.0.11 of ty onwards, the number of detected problems in the codebase increases fairly vastly, to more than 250 or so reported issues. Lots of those are about unused ignore statements -- but mypy does not detect those as problems. I'm not sure whether this is a bug/regression in ty, a limitation in mypy, or something else.

@m-aciek

m-aciek commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

@m-aciek m-aciek mentioned this pull request May 28, 2026
2 tasks
@jayaddison

Copy link
Copy Markdown
Contributor Author

Thanks @m-aciek - I'll try to figure out what to do (or not to do) about those unused ignore statements soon. As you noticed there are a couple of other CI fix pull requests available now too, so I'll take some time to compare with those.

@jayaddison

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #14538 (planned-in for the v9.1.1 release).

@jayaddison jayaddison closed this Jul 25, 2026
@jayaddison
jayaddison deleted the issue-14238/ty-resolve-or-suppress-typechecking-failures branch July 25, 2026 14:10
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 23, 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.

ci: the 'ty' typechecking is failing

3 participants