Skip to content

Incremental mode does extra work with --follow-imports=skip #21102

@JukkaL

Description

@JukkaL

In this case the warm run should do no work, since nothing changes:

[case testIncrementalFollowImportsSkipStubWithSkippedRuntimeDependency]
# flags: --follow-imports=skip
import pkg.foo
[file pkg/__init__.py]

[file pkg/foo.pyi]
from pkg import helper

x = 1
[file pkg/helper.py]
y = 2
[rechecked]
[stale]
[out2]
[out3]

However, pkg.foo is rechecked, which means mypy does redundant work:

________________ testIncrementalFollowImportsSkipStubWithSkippedRuntimeDependency _________________
data: /Users/jukka/src/alt-mypy/test-data/unit/check-incremental.test:4743:
Failed: Actual modules (pkg.foo) do not match expected modules () for "[rechecked ...]"
-------------------------------------- Captured stderr call ---------------------------------------
Expected:
Actual:
  pkg.foo (diff)

The second incremental run works as expected -- only the first warm run appears to do extra work.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions