-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Daemon dmypy
crashes with disable_error_code
configuration option
#14671
Comments
Probably related to the following issues: |
What happens when you run mypy with the same config in normal (non-daemon) mode? I.e. if you use |
From a first look at it, it seems like using
Same |
Hm, did you check it actually picked up the config file when you use |
Yes, i confirm that removing the In fact, i added other codes as well to further customize the linting task. |
Interesting... pypi wheel it's using: mypy-1.2.0-cp311-cp311-win_amd64.whl |
The only significant difference between zipball release-1.2 and pypi 1.2 is the *.pyc and *.pyd files. Removing those files from sites_packages makes dmypy work! |
More findings:
|
Yes, this must be it. We had a similar crash in regular (non-daemon) incremental mode, when it was trying to compute hash of options. That one I fixed by switching codes to plain strings. Something similar should work here. Thanks for investigating this! |
(This is the I meant PR https://github.com/python/mypy/pull/13523/files) |
Managed to produce the options data and pass it to the daemon in the foreground. This is the error:
Looks like it's not properly passing in the ErrorCode. (I just now saw your comment as well, looking into the PR) |
Yeah, making pickle work with this may be tricky (especially with |
I think that's the easiest way. I still don't understand why this works with interpreted python, but not with compiled python, on Windows. (works with pyd files removed, doesn't work with them) The options.snapshot() is probably not working correctly. (but still playing with it) |
Actually, I think it might be as simple as mypyc not being able to pickle the ErrorCode class - https://mypyc.readthedocs.io/en/latest/differences_from_python.html#pickling-and-copying-objects Will play around with mypyc and see if I can compile it on windows and make sure that works. |
When starting mypy daemon, we pickle options. Error codes are part of options and need to be pickle-able. This decorator is needed for this to be possible with mypyc. Fixes #14671 --------- Co-authored-by: Valentin Stanciu <250871+svalentin@users.noreply.github> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Thank you all for the attention and effort! Has this change been release to the public or will be included in future releases? |
Description
Evertything was working until i tried to disable some error codes using the
disable_error_code = 'no-untyped-def,empty-body'
option in thepyproject.toml
file.After restarting the daemon, it crashed with the error
Timed out waiting for daemon to start
Log
To Reproduce
Use the
disable_error_code
configuration option either in thepyproject.toml
or in themypy.ini
files.Your Environment
mypy 1.0.0 (compiled: yes)
mypy.ini
(and other config files):Python 3.9.6
Windows 10 (version 10.0.19044 Build 19044)
The text was updated successfully, but these errors were encountered: