Closed uolot closed 6 years ago
Try passing the --incremental
flag to mypy. It's experimental, but it should provide a good speed up.
Maybe the plugin should add it by default?
@dbader I think it would be useful to add a warning to the README about this (I can make the change if you want).
In my case, my tests take 5:48 when using this plugin. If I run mypy without the plugin, the total test time goes down to 0:35.
The way pytest-mypy
runs is a lot like @uolot's second example, but with xargs -n1 mypy
:
(vtes-S40RGN8u) david@kahuna:~/Projects/vtes $ time (find . -name \*.py | xargs mypy ; pytest)
...
real 0m11.797s
user 0m10.878s
sys 0m0.845s
(vtes-S40RGN8u) david@kahuna:~/Projects/vtes $ time (find . -name \*.py | xargs -n1 mypy ; pytest)
...
real 0m21.884s
user 0m20.383s
sys 0m1.215s
(vtes-S40RGN8u) david@kahuna:~/Projects/vtes $ time pytest --mypy
...
real 0m22.912s
user 0m21.448s
sys 0m1.156s
I've opened a PR that implements @ingolemo's suggestion which should help remedy this.
It looks like a nice and useful plugin, but unfortunately is terribly slow: