Skip to content

Commit 19c4bbf

Browse files
committed
Don't mark a module as stale if its children change
This was introduced in #1865 to fix an issue with new children modules being added. I think we have fixed this issue in another way also since then, since the important part of the test passes with the check removed. (I added some more stuff to the test to increase my confidence in this change). I want to remove this check because it causes a *ton* of trouble with our internal bazel integrations, where we try to generate cache artifacts for each bazel target separately. This check means that bazel targets for packages have their caches invalidated all the time, since they were generated without the children.
1 parent 7e65f1e commit 19c4bbf

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

mypy/build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,8 +1855,7 @@ def is_fresh(self) -> bool:
18551855
# dependency is added back we find out later in the process.
18561856
return (self.meta is not None
18571857
and self.is_interface_fresh()
1858-
and self.dependencies == self.meta.dependencies
1859-
and self.child_modules == set(self.meta.child_modules))
1858+
and self.dependencies == self.meta.dependencies)
18601859

18611860
def is_interface_fresh(self) -> bool:
18621861
return self.externally_same

test-data/unit/check-incremental.test

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,11 +947,15 @@ from parent import a
947947

948948
[file parent/a.py.2]
949949
from parent import b
950+
reveal_type(b.x)
950951

951952
[file parent/b.py.2]
953+
x = 10
952954

953-
[stale parent.a, parent.b]
954-
[rechecked parent, parent.a, parent.b]
955+
[stale parent.b]
956+
[rechecked parent.a, parent.b]
957+
[out2]
958+
tmp/parent/a.py:2: note: Revealed type is 'builtins.int'
955959

956960
[case testIncrementalReferenceExistingFileWithImportFrom]
957961
from parent import a, b

0 commit comments

Comments
 (0)