Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4458,6 +4458,15 @@ def load_graph(
if dep in graph:
st.add_dependency(dep)
manager.missing_modules.pop(dep, None)
# Suppressing a dependency and adding it back appends it to the end of
# the list, so a module whose dependency list order changed only due to
# that round trip would be considered stale by the order-sensitive
# freshness check (State.is_fresh), even though nothing actually
# changed. Restore the cached order when the dependency set is
# unchanged; a genuine change keeps the new order and the module is
# (correctly) rechecked.
if st.meta is not None and st.dependencies_set == set(st.meta.dependencies):
st.dependencies = list(st.meta.dependencies)
# Second, in the initial loop we skip indirect dependencies, so to make indirect dependencies
# behave more consistently with regular ones, we suppress them manually here (when needed).
for st in graph.values():
Expand Down
Loading
Loading