Skip to content

Commit 83d186a

Browse files
authored
Remove some effectively dead code from build.py (#19833)
We can't have `fresh` True when `stale_deps` is non-empty. I guess this part is a leftover from `--quick-and-dirty` times.
1 parent f0863a5 commit 83d186a

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

mypy/build.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3303,34 +3303,7 @@ def process_graph(graph: Graph, manager: BuildManager) -> None:
33033303
if undeps:
33043304
fresh = False
33053305
if fresh:
3306-
# All cache files are fresh. Check that no dependency's
3307-
# cache file is newer than any scc node's cache file.
3308-
oldest_in_scc = min(graph[id].xmeta.data_mtime for id in scc)
3309-
viable = {id for id in stale_deps if graph[id].meta is not None}
3310-
newest_in_deps = (
3311-
0 if not viable else max(graph[dep].xmeta.data_mtime for dep in viable)
3312-
)
3313-
if manager.options.verbosity >= 3: # Dump all mtimes for extreme debugging.
3314-
all_ids = sorted(ascc | viable, key=lambda id: graph[id].xmeta.data_mtime)
3315-
for id in all_ids:
3316-
if id in scc:
3317-
if graph[id].xmeta.data_mtime < newest_in_deps:
3318-
key = "*id:"
3319-
else:
3320-
key = "id:"
3321-
else:
3322-
if graph[id].xmeta.data_mtime > oldest_in_scc:
3323-
key = "+dep:"
3324-
else:
3325-
key = "dep:"
3326-
manager.trace(" %5s %.0f %s" % (key, graph[id].xmeta.data_mtime, id))
3327-
# If equal, give the benefit of the doubt, due to 1-sec time granularity
3328-
# (on some platforms).
3329-
if oldest_in_scc < newest_in_deps:
3330-
fresh = False
3331-
fresh_msg = f"out of date by {newest_in_deps - oldest_in_scc:.0f} seconds"
3332-
else:
3333-
fresh_msg = "fresh"
3306+
fresh_msg = "fresh"
33343307
elif undeps:
33353308
fresh_msg = f"stale due to changed suppression ({' '.join(sorted(undeps))})"
33363309
elif stale_scc:

0 commit comments

Comments
 (0)