forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partition MyPy based on interpreter constraints (pantsbuild#10817)
In a mixed repository, such as some Py27-only code and some Py3 code, we partition based on interpreter constraints for Flake8, Bandit, and Pylint, which ensures that we run with the correct interpreter for each. This means, that Py2-only syntax and Py3-only syntax can co-exist at the same time. This brings that feature to MyPy. It's a similar implementation, except that we must set `--python-version` ourselves to influence which AST is used. If the user already set this, we respect it but log a warning. We also must consider the transitive closure in order to determine the final resulting compatibility (the new test demonstrates why this is the case.) ### Benchmark We expect that running `TransitiveTargets` on every single input `FieldSet` is going to be expensive. When running `./pants typecheck ::`, using `time.time()` around the `await Get` block that resolves transitive deps: * Before, running only once for everything: `3.65` * After, running once per input target: `5.41` [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
1 parent
1d5a34d
commit 905f849
Showing
5 changed files
with
306 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.