Open emernic opened 2 weeks ago
Thanks for the report!
I'm having some trouble reproducing this locally. After uncommenting the second line in test_package/test.py
and re-running dmypy run -- -p test_package
, I'm getting the original error as expected.
Can you think of any other details that might help narrow this down?
I just tried and failed reproduce it on another machine running the same Python and mypy versions, so it's definitely environment-specific. There's a lot going on in the environment I'm seeing the error in (it's a GitHub Codespace with git, pre-commit, poetry, and a lot of other stuff) so I might not have time to isolate the determining factor for quite a while. Feel free to close.
Could be the same issue as https://github.com/python/mypy/issues/15677#issuecomment-2453553739
Bug Report
dmypy
is failing to notice type errors when they are introduced into a file that has already passed type checking. I'm observing this even on extremely minimal examples. It seems like once a file passes checks once it is never checked again bydmypy
.Specifically, this seems to happen when
dmypy
is given a package. Explicitly passing the filename still gives the expected errors.To Reproduce Create a package called
test_package
containing an empty__init__.py
and a file calledtest.py
with the contents:Run the following commands:
Expected Behavior The last command should raise the "Incompatible types in assignment" error.
Actual Behavior No issues are found, despite the contents of
test.py
being exactly the same as the first run.Your Environment
mypy.ini
(and other config files): None