You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dmypy run won't run, prints "Restarting: configuration changed" when ignore_missing_imports = True is configured #10709
Since at least v0.902, executing dmypy run in a project that has ignore_missing_imports = True in mypy.ini is not working anymore.
To Reproduce
(Write your steps here:)
Create src/something.py with some code in it, and create mypy.ini with:
[mypy]files = src
ignore_missing_imports = True
Run dmypy run
Expected Behavior
dmypy run should execute correctly, outputting something like:
Daemon started
src\something.py:1: error: Incompatible types in assignment (expression has type "str", variable has type "int")
Found 1 error in 1 file (checked 26 source files)
I can't reproduce this issue, at least on macOS and Python 3.9.0. Can you provide an example file under src/ that triggers the issue? Also can you try this out in a fresh virtualenv?
OK, I think I figured it out, Options() object may not equal to itself after a pickle roundtrip (which is what we use to communicate with the daemon on Windows), because of two reasons:
There is a nontrivial bit of code applied to ignore_missing_imports after upnickling that also sets ignore_missing_imports_per_module
ErrorCode class doesn't have an __eq__().
The tricky part is that I don't have a Windows machine, but I guess I can tweak Linux code to use Windows logic (and in CI we have Windows).
Activity
tadeu commentedon Jun 24, 2021
I guess it has something to do with these changes: 4642a31#diff-eb09ce67c2059bc9c117d4175e0bd34b1d75bbe8a91c3b9f69a8d14a9c8bc09fR330
tadeu commentedon Jun 24, 2021
A workaround, for now, is to use this undocumented option together:
ignore_missing_imports_per_module = Trueas in:
JukkaL commentedon Jun 24, 2021
I can't reproduce this issue, at least on macOS and Python 3.9.0. Can you provide an example file under
src/that triggers the issue? Also can you try this out in a fresh virtualenv?tadeu commentedon Jun 24, 2021
I was trying it in a fresh venv, the source was just a dummy file
something.pywithPerhaps it's only in Windows? There are some
if sys.platform == 'win32':indmypy:)emmatyping commentedon Jun 25, 2021
I can indeed repro this on Windows with the latest mypy in a fresh venv... strange
It also appears the .dmypy.json file sticks around afterwards as well...
adam-grant-hendry commentedon Jun 22, 2022
It's on my machine on Windows too.
adam-grant-hendry commentedon Jun 22, 2022
Interestingly, the "temporary" fix does not work if
is also set.
MartinBernstorff commentedon Mar 10, 2023
I'm getting this same error on windows. The same project works fine on MacOS :-)
Avasam commentedon Jun 13, 2023
It appears to also be the case with
--follow-imports=silentEdit: nvm
[info] dmypy: follow-imports=silent not supportedilevkivskyi commentedon Jun 13, 2023
OK, I think I figured it out,
Options()object may not equal to itself after apickleroundtrip (which is what we use to communicate with the daemon on Windows), because of two reasons:ignore_missing_importsafter upnickling that also setsignore_missing_imports_per_moduleErrorCodeclass doesn't have an__eq__().The tricky part is that I don't have a Windows machine, but I guess I can tweak Linux code to use Windows logic (and in CI we have Windows).
ilevkivskyi commentedon Jun 13, 2023
Can someone who has a Windows machine please check if #15429 fixes their issue?
Fix dmypy run on Windows (#15429)