-
Notifications
You must be signed in to change notification settings - Fork 37
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
default config causes mypy cache invalidation due to --follow-imports silent
#81
Comments
I think the solution to this issue is that |
This would effectively be a revert to tomv564#12. cc @eliwe. |
This essentially reverts 83df547. The main reason for doing this is that this is not the default option when running `mypy`, which means that (absent other configuration) running `mypy .` and using `pylsp-mypy` will invalidate each others caches, which will cause both things to slow down. `--follow-imports silent` is also incompatible with `dmypy`, so working around this issue by specifying `follow_imports = 'silent'` in your `pyproject.toml` is a non-starter if you want to use `dmypy`. Closes python-lsp#81
Can you give an example for an error that would be lost? |
After trying to reproduce this, I think I was wrong. The error in question was several instances of The reason I got confused is because of the reason I modified the config: So, remove one reason for eliminating |
The default way that
mypy
gets invoked is with the arguments--show-error-end --no-error-summary --incremental --follow-imports silent
. Most of those are OK, but--follow-imports silent
will invalidate the cache if the same value isn't also present in the[tool.mypy]
section ofpyproject.toml
.The default value for this option is
normal
.The cache invalidation causes commandline invocations of
mypy
to take much longer after having opened the editor, and causes the editor to take longer after having runmypy
from the commandline.It's possible to reproduce this problem doing something like:
There's two workarounds for this, either (somewhat inelegantly) hack the value back to its default:
or just use 'silent' mode for all mypy invocations:
A third option is to give
mypy
a separate--cache-dir
when run frompylsp
, but this loses the benefit of sharing the cache between the two invocation modes (which is otherwise substantial).The text was updated successfully, but these errors were encountered: