-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Don't run mypy self-test? #4333
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
Comments
What about only running mypy self check, as discussed in #4332? It runs pretty quickly. I assume we'd still verify that mypy can type check the stubs without errors? I wonder how fast we could make the CI. For example, it would be nice if the CI would run in, say, under 5 minutes for most PRs. Also, once we get to a certain level of CI performance, we can have a policy of rejecting new tests that take longer than that to run, as otherwise things tend to regress over time. |
Running mypy over the stubs would not be affected. I like the idea of running the self check, but not the test suite. I especially like Jelle's suggestion for a black-prime-like system. Testing stubs against real work code bases is very useful. |
To clarify my suggestion:
|
To make CI faster, perhaps we can somehow set up a system that checks only the files changed by a PR; that could especially make sense once we move to modular typeshed. |
#4337 is a draft PR that adds a "real" mypy self test. For now it just renames (but still runs) the existing self test to "mypy test suite". Interestingly, it flags a few things in mypy's code base. |
I got #4337 green and merged. I propose for now we change "mypy test suite" to run a subset of tests that are more relevant to typeshed: python/mypy#9638 |
Only a subset of mypy's test suite should be relevant to typeshed: python/mypy#9638 This should make things faster. (Also the -n12 argument to pytest is weird; note mypy's pytest.ini automatically specificies -nauto which is what we should want) Resolves python#4333
Only a subset of mypy's test suite should be relevant to typeshed: python/mypy#9638 This should make things faster. (Also the -n12 argument to pytest is weird; note mypy's pytest.ini automatically specificies -nauto which is what we should want) Resolves #4333 Co-authored-by: hauntsaninja <>
I suggest to turn off the mypy self test in CI. These tests are the slowest tests by far, taking over 20 minutes to complete, compared to the 7 minutes it takes the pytest tests to complete. When they fail, they also require the feared "typeshed/mypy" shuffle that only mypy/typeshed maintainers (effectively Jelle) can do.
On the other hand, I can't remember the last time these tests flagged a genuine problem with the stubs. (But I don't have the best memory.) If they fail, it's usually due to a tight coupling between the self test and the way things are typed in typeshed.
As with #4332, the main disadvantage of not running those tests is a higher change of failure of the typeshed sync for mypy failing. But I'd argue that it is easier to resolve at sync time than to do the whole shuffle.
The text was updated successfully, but these errors were encountered: