Commit Graph
46 Commits
Author SHA1 Message Date
Alex Waygood 89d00519b4 [ty] Mark spark as a flaky project (#29966) 2026-11-03 16:18:56 +00:00
Alex Waygood 463826d2a4 [ty] Update flaky primer projects (#27597) 2026-08-08 17:52:59 +01:00
Alex Waygood 8aaa13eceb Run ecosystem-analyzer on all mypy_primer projects (#25549)
Update to the latest version of ecosystem-analyzer. This version does
away with the `--projects-old` and `--projects-new` flags, instead
running ecosystem-analyzer on all mypy_primer projects. If panics on
panicking projects are fixed, that will be celebrated by
ecosystem-analyzer; if new panics are introduced, that will be announced
loudly by ecosystem-analyzer, but we don't need to worry about adding
the project to a bad.txt file anymore. We also don't need to worry
anymore about keeping these lists up to date with the upstream list of
projects in mypy_primer itself.
2026-06-02 16:09:41 +01:00
Alex Waygood 0fb46b21c9 Add missing primer projects to good.txt (#25461)
## Summary
Add `django-modern-rest` and `pytest-autoprofile` to the ty primer
`good.txt` list. These upstream projects completed `uvx ty check`
without crashing, panicking, or timing out
2026-05-29 20:16:58 +01:00
Alex Waygood ec1d5358ab make ecosystem-analyzer self-aware (#25460)
## Summary

Update to the latest upstream commit of ecosyste-analyzer following
https://github.com/hauntsaninja/mypy_primer/pull/249 and
https://github.com/astral-sh/ecosystem-analyzer/pull/72. This means that
ecosystem-analyzer now checks ty by running ty on ecosystem-analyzer, a
very satifsying ouroboros

## Test Plan

ci on this pr
2026-05-29 15:58:20 +00:00
David Peter 7734c74dd0 [ty] update flaky projects (#25417) 2026-05-27 12:40:17 +00:00
Charlie Marsh 258ca11050 [ty] Remove Prefect from flaky project list (#25394)
## Summary

Interestingly, it appears that this was "fixed" by
https://github.com/astral-sh/ruff/pull/24927 based on a local basic,
which suggest that the source of the non-determinism is in the
inferred-variance computation, and we now avoid that in Prefect.
2026-05-26 16:16:37 +01:00
Alex Waygood c0d692ef2a [ty] Add dd-trace-py to flaky.txt (#25391)
Unfortunately this project is now flaky following
https://github.com/astral-sh/ruff/commit/95eec58af266ba0f98bb923cf204f442523e813d.
Adding it to flaky.txt means we don't get spurious/confusing diffs like
https://github.com/astral-sh/ruff/pull/25017#issuecomment-4390844917
anymore, because ecosystem-analyzer will run the project several times
to ensure that newly reported diagnostic diffs are not flaky. The cost
is that ecosystem-analyzer will take a little longer in CI
2026-05-26 13:08:52 +00:00
David Peter 65d5edc319 [ty] Include CPython projects in ecosystem-analyzer runs (#23995)
## Summary

There are three special projects in mypy_primer's list: they are all
part of the cpython repository, but in different subfolders. Previously,
`good.txt` only included the pattern "cpython" to include all of them
for mypy_primer runs. However, ecosystem-analyzer expects an exact
match. I don't really want to change that behavior in
ecosystem-analyzer, so instead, we now include the full project names,
and map those back to "cpython" for mypy_primer (which matches the regex
against the projects URL, not the name).

## Test Plan

- Made sure that mypy_primer still runs as expected, with the new
selector (regex-escaping leads to a slightly different project selector)
- Made sure that CPython projects are now included in ecosystem-analyzer
runs
2026-03-16 11:33:37 +01:00
Charlie Marsh 7e477c21d5 [ty] Reduce the number of potentially-flaky projects (#23698)
## Summary

Our results are much more stable now, but these three still appear as
flaky (see, e.g., https://287ce299.ty-ecosystem-ext.pages.dev/diff).
2026-03-03 11:18:30 -05:00
David Peter 586ab6d98f [ty] Add pylox to flaky projects (#23390)
## Summary

See the run here: https://6b842609.ty-ecosystem-ext.pages.dev/diff
2026-02-18 09:54:23 +00:00
David Peter a14f344dc6 [ty] Update flaky projects (#23337)
## Summary

😢

Based on a new [ecosystem-report
run](https://github.com/astral-sh/ruff/actions/runs/22060979308/job/63740868564).
I kept `setuptools` and `porcpuine` in the list for now, even if they
were *not* detected as flaky in the latest run.
2026-02-16 13:23:21 +01:00
Ibraheem Ahmed bbaa769822 [ty] More detailed memory usage reports (#23128)
Based on the feedback from https://github.com/astral-sh/ruff/pull/22899,
upload a memory usage report comment similar to the typing conformance
suit results.
2026-02-10 02:28:19 +00:00
Douglas Creager dc842db062 [ty] Detect flaky projects during ecosystem CI jobs (#23178)
This brings in an `ecosystem-analyzer` update that detects when we
produce flaky results for a project.

We do this by running `ty` multiple times against each project, looking
for when we produce a different diagnostic at the same file/line/column
location. If we do, we consider that diagnostic as flaky. The `diff` and
`analyze` HTML reports have been updated to show flakiness information.
(A diagnostic changing from "flaky" to "not flaky", or vice versa, is
now considered a change, as is a different set of diagnostic
codes/messages appearing for a flaky diagnostic.)

Since most projects aren't flaky 🤞, in the per-PR CI
job, we only run flake detection against the projects that we known are
flaky. For the others, we still run `ty` once and don't consider any of
the diagnostics flaky. In the weekly background job, we run flake
detection more aggressively, and on all projects, so that we can update
the flaky project list when needed.
2026-02-09 17:09:00 -05:00
Micha Reiser cfed34334c Update mypy primer pin (#22490) 2026-01-10 14:00:00 +01:00
David Peter bc6517a807 [ty] Add missing projects to good.txt (#21721)
## Summary

These projects from `mypy_primer` were missing from both `good.txt` and
`bad.txt` for some reason. I thought about writing a script that would
verify that `good.txt` + `bad.txt` = `mypy_primer.projects`, but that's
not completely trivial since there are projects like `cpython` only
appear once in `good.txt`. Given that we can hopefully soon get rid of
both of these files (and always run on all projects), it's probably not
worth the effort. We are usually notified of all `mypy_primer` changes.

## Test Plan

CI on this PR
2025-12-01 11:18:41 +01:00
Micha Reiser e92fd51a2c [ty] Add cycle handling to lazy_default (#20967) 2025-10-23 10:05:08 +02:00
Micha Reiser 5fb142374d Fix run-away for mutually referential instance attributes (#20645) 2025-10-16 13:24:41 +02:00
David Peter a82833a998 [ty] Update mypy_primer and project lists (#20798)
## Summary

Pulls in two updates to `mypy_primer` projects:

* https://github.com/hauntsaninja/mypy_primer/pull/201 (add
`django-test-migrations`)
* https://github.com/hauntsaninja/mypy_primer/pull/122 (remove
`SinbadCogs`)

## Test Plan

CI on this PR
2025-10-10 11:08:39 +02:00
Carl Meyer 7e464b8150 [ty] move graphql-core to good.txt (#20447)
## Summary

With https://github.com/astral-sh/ruff/pull/20446, graphql-core now
checks without error; we can move it to `good.txt`.

## Test Plan

CI
2025-09-17 10:09:32 +02:00
David Peter ffd650e5fd [ty] Update mypy_primer (#20433)
## Summary

Revert the materialize-changes, see
https://github.com/hauntsaninja/mypy_primer/pull/208

## Test Plan

CI
2025-09-17 09:51:48 +02:00
Carl Meyer 681ad2fd92 [ty] move primer projects to good.txt (#20444)
## Summary

After https://github.com/astral-sh/ruff/pull/20359 we can move all but
three remaining projects over to `good.txt`.

## Test Plan

CI
2025-09-17 09:31:27 +02:00
David Peter 02c58f1beb [ty] Remove 'materialize' from the ecosystem projects (#20412)
## Summary

This project was [recently removed from
mypy_primer](https://github.com/astral-sh/ruff/pull/20378), so we need
to remove it from `good.txt` in order for ecosystem-analyzer to work
correctly.

## Test Plan

Run mypy_primer and ecosystem-analyzer on this branch.
2025-09-15 10:42:35 +02:00
David Peter fdfb51b595 [ty] Update mypy_primer, add egglog-python project (#20078)
Now that https://github.com/astral-sh/ruff/pull/20263 is merged, we can
update mypy_primer and add the new `egglog-python` project to
`good.txt`. The ecosystem-analyzer run shows that we now add 1,356
diagnostics (where we had over 5,000 previously, due to the unsupported
project layout).
2025-09-05 14:17:07 +02:00
Carl Meyer 8eb8d25565 [ty] add six ecosystem projects to good.txt (#20157)
## Summary

These projects all check successfully now.

(Pandas still takes 9s, as the comment in `bad.txt` said, but I don't
think this is slow enough to exclude it; mypy-primer overall still runs
in 4 minutes, faster than e.g. the test suite on Windows.)

## Test Plan

mypy-primer CI.
2025-08-29 11:37:29 -07:00
Alex WaygoodandBrent Westbrook 9f6146a13d [ty] Add precise inference for indexing, slicing and unpacking NamedTuple instances (#19560)
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
2025-08-13 15:19:44 +00:00
Alex Waygood d2d4b115e3 [ty] Move pandas-stubs to bad.txt (#19659) 2025-07-31 12:33:24 +01:00
Alex Waygood 859262bd49 [ty] Move zope.interface to good.txt for primer runs (#19208) 2025-07-25 14:12:17 +01:00
Alex Waygood 7533a0bfdb [ty] Upgrade mypy_primer (#19207) 2025-07-08 15:56:54 +01:00
Ibraheem Ahmed cd848986d7 [ty] Add separate CI job for memory usage stats (#19134)
## Summary

As discussed in https://github.com/astral-sh/ruff/pull/19059.
2025-07-07 12:17:02 -04:00
Carl Meyer 2ae0bd9464 [ty] Normalize recursive types using Any (#19003)
## Summary

This just replaces one temporary solution to recursive protocols (the
`SelfReference` mechanism) with another one (track seen types when
recursively descending in `normalize` and replace recursive references
with `Any`). But this temporary solution can handle mutually-recursive
types, not just self-referential ones, and it's sufficient for the
primer ecosystem and some other projects we are testing on to no longer
stack overflow.

The follow-up here will be to properly handle these self-references
instead of replacing them with `Any`.

We will also eventually need cycle detection on more recursive-descent
type transformations and tests.

## Test Plan

Existing tests (including recursive-protocol tests) and primer.

Added mdtest for mutually-recursive protocols that stack-overflowed
before this PR.
2025-06-30 12:07:57 -07:00
David Peter 907c291877 [ty] Update mypy_primer, add two new projects (#18891)
## Summary

Pull in latest changes to mypy_primer:
https://github.com/hauntsaninja/mypy_primer/compare/01a7ca325f674433c58e02416a867178d1571128..e5f55447969d33ae3c7ccdb183e2a37101867270
2025-06-23 13:08:11 +02:00
Douglas CreagerandAlex Waygood ea812d0813 [ty] Homogeneous and mixed tuples (#18600)
We already had support for homogeneous tuples (`tuple[int, ...]`). This
PR extends this to also support mixed tuples (`tuple[str, str,
*tuple[int, ...], str str]`).

A mixed tuple consists of a fixed-length (possibly empty) prefix and
suffix, and a variable-length portion in the middle. Every element of
the variable-length portion must be of the same type. A homogeneous
tuple is then just a mixed tuple with an empty prefix and suffix.

The new data representation uses different Rust types for a fixed-length
(aka heterogeneous) tuple. Another option would have been to use the
`VariableLengthTuple` representation for all tuples, and to wrap the
"variable + suffix" portion in an `Option`. I don't think that would
simplify the method implementations much, though, since we would still
have a 2×2 case analysis for most of them.

One wrinkle is that the definition of the `tuple` class in the typeshed
has a single typevar, and canonically represents a homogeneous tuple.
When getting the class of a tuple instance, that means that we have to
summarize our detailed mixed tuple type information into its
"homogeneous supertype". (We were already doing this for heterogeneous
types.)

A similar thing happens when concatenating two mixed tuples: the
variable-length portion and suffix of the LHS, and the prefix and
variable-length portion of the RHS, all get unioned into the
variable-length portion of the result. The LHS prefix and RHS suffix
carry through unchanged.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-06-20 18:23:54 -04:00
Shunsuke ShibayamaandDavid Peter 342b2665db [ty] basic narrowing on attribute and subscript expressions (#17643)
## Summary

This PR closes astral-sh/ty#164.

This PR introduces a basic type narrowing mechanism for
attribute/subscript expressions.
Member accesses, int literal subscripts, string literal subscripts are
supported (same as mypy and pyright).

## Test Plan

New test cases are added to `mdtest/narrow/complex_target.md`.

---------

Co-authored-by: David Peter <mail@david-peter.de>
2025-06-17 11:07:46 +02:00
David Peter a1c69ca460 [ty] Enable ecosystem check for 'pywin32' (#18716)
## Summary

Follow-up to #18621
2025-06-17 09:52:26 +02:00
Micha Reiser 220ab88779 [ty] Promote projects to good that now no longer hang (#18370) 2025-06-01 17:25:46 +02:00
Micha Reiser 54f597658c [ty] Fix multithreading related hangs and panics (#18238) 2025-06-01 11:07:55 +02:00
Alex Waygood 9ec4a178a4 [ty] Move arviz off the list of selected primer projects (#18336) 2025-05-27 17:51:19 +01:00
Alex Waygood d1bb10a66b [ty] Understand classes that inherit from subscripted Protocol[] as generic (#17832) 2025-05-09 17:39:15 +01:00
Carl Meyer 6c177e2bbe [ty] primer updates (#17903)
## Summary

Update ecosystem project lists in light of
https://github.com/astral-sh/ruff/pull/17758

## Test Plan

CI on this PR.
2025-05-08 20:43:31 -07:00
David Peter fab862c8cd [ty] Ecosystem checks: activate running on 'manticore' (#17916)
## Summary

This is sort of an anticlimactic resolution to #17863, but now that we
understand what the root cause for the stack overflows was, I think it's
fine to enable running on this project. See the linked ticket for the
full analysis.

closes #17863

## Test Plan

Ran lots of times locally and never observed a crash at worker thread
stack sizes > 8 MiB.
2025-05-07 06:27:36 -07:00
David Peter 9a6633da0b [ty] ecosystem: activate running on 'sympy' (#17870)
## Summary

Following #17869, we can now run `ty` on `sympy`.
2025-05-05 21:50:13 +02:00
Carl Meyer 20d64b9c85 [ty] add passing projects to primer (#17834)
Add projects to primer that now pass, with
https://github.com/astral-sh/ruff/pull/17833
2025-05-05 12:21:06 -07:00
David Peter 90c12f4177 [ty] ecosystem: Activate running on 'materialize' (#17862) 2025-05-05 16:34:23 +02:00
David Peter 5a91badb8b [ty] Move 'scipy' to list of 'good' projects (#17850)
## Summary

Adds `scipy` as a new project to `good.txt` as a follow-up to #17849.
2025-05-05 13:52:57 +02:00
Micha Reiser b51c4f82ea Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00