Comments (6)
I see. Checked the daemon docs and it does support specifying a list of directories/files, both on the initial run and on subsequent runs (using dmypy check <files>
). Naturally, if you wanted to use the daemon to its full extent you'd need to manage the running process in some way (doesn't sound too bad, dmypy provides a status
command that tells you if it's running). I don't know if starting/stopping the daemon constantly would yield the same performance increases as leaving it constantly running. I'll try to do some experimenting and see what makes sense. I'll also take a look at what Dropbox is doing since their speed is incredible. I'll post back here with my findings!
from mypy-pycharm.
Hey thanks a lot for the investigation! Fell free to make a PR for your changes, I'll try to have a look at it soon (hopefully over the weekend).
Just be sure to target the mater branch and not the release branch.
from mypy-pycharm.
When I first started developing the plugin I tried to use the daemon but I don't remember why I ended up not using it.
Maybe it does not allow to send a list of files to scan and always scans the entire project? I should check again but lately I have very little free time.
It would be really great if someone else could help testing this (e.g. testing and reporting what are the differences in using the daemon or the normal binary, not from a performance POV, but from feature/CLI parameter POV.
from mypy-pycharm.
Did some quick research and concluded the following:
- If you run
dmypy run -- <command>
it will work essentially just like the normal mypy command except that it will leave the daemon running in the background, meaning that the first run (before the daemon has been started) is just as slow as a normal mypy run - If you run
dmypy run -- <command>
again, with any command, it will automatically utilize the existing daemon and cache and therefore run really fast - This is how Dropbox does it. It is a very simple way that does not require "caring" about the daemon stuff, all you do is keep executing
run
from the same work dir- The downside is that the daemon is left running even when you close IntelliJ
- This could be mitigated a tad by passing the
--timeout
option todmypy
with a configurable timeout (e.g. an hour by default) which would cause the daemon to stop after said time in case it hasn't received any commands. It's better than nothing. - The real way to do it would be to configure a plugin listener to the project closing (assuming the work dir is the project dir) and kill the daemon if it's still running, should be simple enough I think
So yeah it sounds like it would be easy enough to switch to the daemon by simply just using the run command. Cleaning up any running daemon could be done in a later release. I'm gonna try to compile this plugin with the daemon set to true and see what happens.
from mypy-pycharm.
Got it running with the daemon, just had to make some minor changes to the code:
- Instead of calling
status
use-V
on both dmypy and mypy - follow-imports silent is not supported on dmypy, so I set it to error for now
- I think the best option here is to just copy the "silent" behavior by discarding errors that match some patterns or something
So in short, looks like it would be possible to use dmypy without many changes at all :)
Scans are blazingly fast now! I'm down to submit a PR for this in case you feel like you don't got the time!
from mypy-pycharm.
This issue has been automatically marked as stale because it has not had activity in the last 60 days.
from mypy-pycharm.
Related Issues (20)
- Mypy failed with code 2 HOT 1
- Add option to use mypy from project venv HOT 1
- Unable to use the plugin due to a file not found error
- Mypy failed with code 2 HOT 5
- (🐞) Doesn't detect mypy when using a poetry interpreter HOT 9
- Enabling plugin for CLion: de-prioritise presence of Python project SDK when checking `mypy` availability
- Icons not visible in new Jetbrains UI HOT 3
- "Mypy found no problems" after adding "[plugins]" part in mypy.ini HOT 5
- Support for mypy using WSL interpreter HOT 6
- MyPy crashes if file has changes not yet written to disc
- "Check project" 10× slower than running mypy CLI on all files instead HOT 6
- Harmless crash on macOS
- Scan failed due to an error
- mypy_path in the .ini file doesn't work as I expected when running checks on one file or module
- Check-* ignores exclude directive in mypy.ini
- Mypy tool window button icons missing in 2022.1 EAP HOT 3
- xxx is not a valid Python package name HOT 5
- Configure working directory/env vars when running mypy
- If mypy fails and only prints to stdout, not stderr, this leads to a cryptic event log message without details or stacktrace HOT 13
- Mypy executable is reported missing despite successful test HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mypy-pycharm.