Skip to content

Incremental does not re-process module with ignored import if the imported module appears on a new run #1910

Closed
@gvanrossum

Description

@gvanrossum

Suppose I have a.py:

import b  # type: ignore
b.foo()

and there's no b.py or b.pyi on the path. This checks without errors, and in incremental mode does not record b as a dependency of a.

Now I create a valid b.py, and re-run mypy -i a.py (this is with a warm cache). I had expected it would mark a as stale and re-parse it, but it doesn't.

A suspicious change is 4889c0c ("Warn about unused '# type: ignore' comments (#1695)") which apparently made the effect of # type: ignore on imports much more severe, also without -i.

(This seems related to #1904 but I think it's a separate issue. Also, I think it's low priority since it only applies to ignored top-level imports, not to imports of submodules of packages.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions