Closed asford closed 3 years ago
@Richardk2n Friendly ping, I'm not sure if you'd like to fold this in along with #2 but it'd be great to include this if possible.
I've fixed up the lingering 3.6 syntax failures.
Referenced in https://github.com/tomv564/pyls-mypy/issues/51
Once #2 is successfully merged (probably in a few minutes), I will look at this (maybe ask some questions) and then probably merge it as well.
@asford Should the daemon be closed for example atexit ?
@asford Should the daemon be closed for example atexit ?
I don't think the daemon should be closed, as the daemon can persist expensive cached state between editor sessions.
For example, I use vim-lsp
and end-up reusing the dmypy
daemon as I hop between vim sessions.
In some codebases, where dmypy
is ...extremely useful... starting the daemon for a first run is extremely expensive.
Most users are probably just calling dmypy run
from the command line, which doesn't stop the server after the run.
The codebase is now formatted with black after #4 was merged. @asford you can pull from master, ignore all changes to plugin.py and then run black .
to blacken your changes.
@asford please note that 90a37e118a8af3c1fab845a425071ec742bfdb4d contains how I would like to have this merged. I put it in a commit to make sure it does not get lost when you pull/merge from master.
Roger, thanks for the through review. I've squash-rebased on the most-recent upstream, so this should be a minimal mergeable diff.
I've noticed that using dmypy
through pylsp creates a .dmypy.json
file in every project. Ideally that wouldn't happen. Is it possible to create that file in a temp directory?
I've noticed that using
dmypy
through pylsp creates a.dmypy.json
file in every project. Ideally that wouldn't happen. Is it possible to create that file in a temp directory?
mypy also creates a .mypy_cache
folder, which seems to not be a problem?
Why is .dmypy.json
a problem?
I guess I'm used to .mypy_cache
being git-ignored while .dmypy.json
is new to me and from the naming looks like a configuration file rather than something that should be ignored.
From the documentation it looks like it's in fact a temporary file that could be ignored but in that case can't we actually define its location to be .mypy_cache/.dmypy.json
? I think that would be nice if it worked.
But in the worse case, git-ignoring .dmypy.json
is an acceptable solution of course. But it would require updating .gitignore file in many projects.
https://github.com/palantir/python-language-server/issues/391
Update plugin flow for non-live-mode dmypy invocation via
mypy.api.run_dmypy
.Minor fix to update detect
.mypy.ini
as well asmypy.ini
: https://mypy.readthedocs.io/en/stable/config_file.html