MyPy
and Pylint
partition inputs via CoarsenedTarget
(Cherry-pick of #15141)
#15244
+154
−99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CoarsenedTarget
s are structure shared, and because they preserve their internal structure, they can service requests for transitive targets for different roots from the same datastructure. Concretely: Mypy and Pylint can consumeCoarsenedTargets
to execute a single@rule
-level graph walk, and then compute per-root closures from the resultingCoarsenedTarget
instances.This does not address #11270 in a general way (and it punts on #15241, which means that we still need per-root transitive walks), but it might provide a prototypical way to solve that problem on a case-by-case basis.
Performance wise, this moves cold
check ::
for ~1k files from:main
: 32s total, and 26s spent in partitioningbranch
: 19s total, and 13s spent in partitioningThe rest of the time is wrapped up in #15241.