Skip to content

Commit 02d0568

Browse files
committed
Some cleanups
1 parent 5c9e84c commit 02d0568

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

mypy/build.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,7 +2506,7 @@ def process_graph(graph: Graph, manager: BuildManager) -> None:
25062506
# TODO: see if it's possible to determine if we need to process only a
25072507
# _subset_ of the past SCCs instead of having to process them all.
25082508
for prev_scc in fresh_scc_queue:
2509-
process_fresh_scc(graph, prev_scc, manager)
2509+
process_fresh_modules(graph, prev_scc, manager)
25102510
fresh_scc_queue = []
25112511
size = len(scc)
25122512
if size == 1:
@@ -2587,16 +2587,17 @@ def order_ascc(graph: Graph, ascc: AbstractSet[str], pri_max: int = PRI_ALL) ->
25872587
return [s for ss in sccs for s in order_ascc(graph, ss, pri_max)]
25882588

25892589

2590-
def process_fresh_scc(graph: Graph, scc: List[str], manager: BuildManager) -> None:
2591-
"""Process the modules in one SCC from their cached data.
2590+
def process_fresh_modules(graph: Graph, modules: List[str], manager: BuildManager) -> None:
2591+
"""Process the modules in one group of modules from their cached data.
25922592
2593+
This can be used to process an SCC of modules
25932594
This involves loading the tree from JSON and then doing various cleanups.
25942595
"""
2595-
for id in scc:
2596+
for id in modules:
25962597
graph[id].load_tree()
2597-
for id in scc:
2598+
for id in modules:
25982599
graph[id].fix_cross_refs()
2599-
for id in scc:
2600+
for id in modules:
26002601
graph[id].patch_dependency_parents()
26012602

26022603

mypy/server/update.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122

123123
from mypy.build import (
124124
BuildManager, State, BuildSource, BuildResult, Graph, load_graph, module_not_found,
125-
process_fresh_scc,
125+
process_fresh_modules,
126126
PRI_INDIRECT, DEBUG_FINE_GRAINED,
127127
)
128128
from mypy.checker import DeferredNode
@@ -376,7 +376,7 @@ def find_unloaded_deps(manager: BuildManager, graph: Dict[str, State],
376376
module, we don't need to explore its dependencies. (This
377377
invariant is slightly violated when dependencies are added, which
378378
can be handled by calling find_unloaded_deps directly on the new
379-
dependencies)
379+
dependencies.)
380380
"""
381381
worklist = list(initial)
382382
seen = set() # type: Set[str]
@@ -398,12 +398,12 @@ def find_unloaded_deps(manager: BuildManager, graph: Dict[str, State],
398398

399399
def ensure_trees_loaded(manager: BuildManager, graph: Dict[str, State],
400400
initial: Sequence[str]) -> None:
401-
"""Ensure that the modules in initial and their deps have loaded trees"""
401+
"""Ensure that the modules in initial and their deps have loaded trees."""
402402
to_process = find_unloaded_deps(manager, graph, initial)
403403
if to_process:
404-
manager.log("Calling process_fresh_scc on an 'scc' of size {} ({})".format(
404+
manager.log_fine_grained("Calling process_fresh_modules on set of size {} ({})".format(
405405
len(to_process), to_process))
406-
process_fresh_scc(graph, to_process, manager)
406+
process_fresh_modules(graph, to_process, manager)
407407

408408

409409
def get_all_dependencies(manager: BuildManager, graph: Dict[str, State]) -> Dict[str, Set[str]]:
@@ -770,9 +770,9 @@ def find_targets_recursive(
770770
Set[str]]:
771771
"""Find names of all targets that need to reprocessed, given some triggers.
772772
773-
Returns: a tuple containing a:
773+
Returns: A tuple containing a:
774774
* Dictionary from module id to a set of stale targets.
775-
* A set of module ids for unparsed modules with stale targets
775+
* A set of module ids for unparsed modules with stale targets.
776776
"""
777777
result = {} # type: Dict[str, Set[DeferredNode]]
778778
worklist = triggers

0 commit comments

Comments
 (0)