Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rework (and heavily optimize!) mypy.ini per-module configuration #4894
Currently, we compute the options for each module by scanning through
To fix this, we instead precompute an Options object for each config
This cuts down the processing time from 23s to about 80ms.
The catch is that this is actually a backwards-incompatible semantics
I had a really pretty trie-based solution that I wrote before realizing I could do it this way and it would probably be good enough. The trie-based solution is faster, but not enough faster to justify the extra complication :(
Looks good! This fixed the performance regression in the S repo for me.
Left a few minor comments. Also, the typeshed update seems unrelated.
Apr 13, 2018
Hi; just to clarify the change that's needed to existing config files: Does this mean that if you have a directory (say, "repositories"), which contains a bunch of subdirs, (call them "a" through "e"), all of which contain a "migrations" directory that should be ignored, we need to go from:
[mypy-*migrations*] ignore_errors = True
[mypy-repositories.a.migrations.*,repositories.b.migrations.*,repositories.c.migrations.*,repositories.d.migrations.*,repositories.e.migrations.*] ignore_errors = True
Or is there a more concise option, or one that would be robust to the hypothetical future addition of "f/migrations", "g/migrations", etc? Thanks!