-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit the number of generated errors if stubs are missing #10529
Comments
@JukkaL possibly stupid question, but is this already happening? I tried to create a small reproducible test where I imported some of these packages and did some basic type checking against their functions, but all I'm seeing is the stub errors. I'm sure I'm either misunderstanding or doing something wrong, but can you at least point me in the right direction with a small reproducible example (i.e., one import stub error + one other mypy error off of that import) so I can build on it? Here's a test I tried adding to
But all I see is the stub errors (even though I was expecting to see errors on the function calls where I would be assigning an implicit |
Hmm not sure what is going on there. I got syntax errors when I tried the test case, but after fixing them I get errors about missing stubs and Anyway, I have an implementation now and will prepare a PR shortly. |
) When upgrading to mypy 0.900, most projects will see some errors about missing stubs. Projects with strict settings could see thousands of errors, since missing stubs will generate many additional Any types. After 200 errors (only if some of them are about imports) we will now only show errors about unresolved imports or missing stubs, so that the likely root causes won't be obscured in a high volume of errors. Fixes #10529.
) When upgrading to mypy 0.900, most projects will see some errors about missing stubs. Projects with strict settings could see thousands of errors, since missing stubs will generate many additional Any types. After 200 errors (only if some of them are about imports) we will now only show errors about unresolved imports or missing stubs, so that the likely root causes won't be obscured in a high volume of errors. Fixes #10529.
If stubs for third-party libraries have not been installed, mypy may generate thousands of errors, making it hard to figure out what's going on. One reason for this is that missing stubs cause many
Any
types to be inferred, and these may trigger additional errors, depending on the strictness options being used.One way to address this is to use some heuristic to silence errors that are not about missing stubs after a threshold. For example, if we've reported N errors about missing stubs and at least M errors overall, hide any remaining errors that are not about stubs.
This could be a significant issue for some users after the next mypy release (0.900), which unbundles stubs for third-party libraries. Thus users are likely to see errors about missing stubs as soon they update to mypy 0.900.
The text was updated successfully, but these errors were encountered: