Skip to content
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

Use the new mypy daemon to speed up type-checking #32

Open
stlehmann opened this issue May 3, 2018 · 4 comments
Open

Use the new mypy daemon to speed up type-checking #32

stlehmann opened this issue May 3, 2018 · 4 comments

Comments

@stlehmann
Copy link

Since mypy 0.6 there is a daemon included. So instead of running mypy as a command-line tool, one can run it as a long-running daemon (server) process and use a command-line client to send type-checking requests to the server. A speedup of 10x or more for large code bases seems possible. I think that would definetly be a large benefit for the speed of this Plugin. I would also gladly give a hand on implementation. Have a look at the daemon docu http://mypy.readthedocs.io/en/latest/mypy_daemon.html. It is still in beta state but already used in larger scale at Dropbox.

@FichteFoll
Copy link
Collaborator

FichteFoll commented May 3, 2018

Thanks for the reference. I remember reading about it a few releases ago (#14) but didn't find any info about it other than a small mention in the changelog.

From a quick look at that site, I can see a few problems, though. Notably:

  1. It doesn't seem to support --shadow-file.
  2. It doesn't support Windows. (that's not really a problem)

I would probably use the daemon behind a linter flag and have it disabled by default for the time being. The --timeout parameter is especially useful because we can not deinitialize the plugin when ST is closed. Not sure how to tackle the first problem without requesting support for it, though.

@FichteFoll
Copy link
Collaborator

Small update as the upstream issue I was subscribed to was closed.

Not sure it's worth investigating because I'll need to manage the daemon in the plugin code. As long as --incremental does its job well (read: fast) enough, I'll hold back working on this. There are other more important things to manage.

@LawrenceJGD
Copy link

Hello, I wanted to ask if there's going to be any work to implement dmypy soon, it would make it faster to use. Thanks

@kaste
Copy link
Collaborator

kaste commented Aug 30, 2022

Yeah, I tried dmypy but it doesn't lint in the background (aka "while you type") and I hate it a bit when linters or feedback comes after saving only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants