Skip to content

dmypy does not recheck files when they are removed and then re-added. #5343

Closed

Description

@ramLlama
  • Are you reporting a bug, or opening a feature request?
    Bug
  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.

In a folder, have two files test1.py and test2.py. Contents are:

test1.py:

x: str = 1

test2.py:

y: int = 'hello'
  • What is the actual behavior/output?
$ python -m mypy --follow-imports=skip --ignore-missing-imports --cache-fine-grained test1.py
test1.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
$ python -m mypy --follow-imports=skip --ignore-missing-imports --cache-fine-grained test2.py
test2.py:1: error: Incompatible types in assignment (expression has type "str", variable has type "int")
$ dmypy start -- --follow-imports=skip --ignore-missing-imports --use-fine-grained-cache
Daemon started
$ dmypy check test1.py
test1.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
$ dmypy check test1.py
test1.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
$ dmypy check test2.py
test2.py:1: error: Incompatible types in assignment (expression has type "str", variable has type "int")
$ dmypy check test2.py
test2.py:1: error: Incompatible types in assignment (expression has type "str", variable has type "int")
$ dmypy check test1.py
$ dmypy check test2.py
$
  • What is the behavior/output you expect?
    I expect that files are rechecked and errors re-outputted after being removed and then re-added to dmypy.
  • What are the versions of mypy and Python you are using?
    mypy 0.610, python 3.6.3

Activity

  1. self-assigned this
    on Nov 1, 2018
  2. msullivan commented on Nov 1, 2018

    @msullivan
    Collaborator

    Self-assigning this because I'm about to rampage through the relevant code and think a fix for this might come out the other end.

  3. removed their assignment
    on Jun 18, 2020
  4. msullivan commented on Jun 18, 2020

    @msullivan
    Collaborator

    This might have gotten fixed though?

  5. JukkaL commented on Jun 19, 2020

    @JukkaL
    Collaborator

    This still seems to be an issue. I was able to reproduce the problem with using dmypy run -- <files>. Increasing priority since this is pretty bad. Also I somehow got errors from typeshed by doing this.

  6. added a commit that references this issue on Jun 15, 2023
    ceb4d7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions