MCPcopy Index your code
hub / github.com/python/mypy / dump_all_dependencies

Function dump_all_dependencies

mypy/server/deps.py:1114–1136  ·  view source on GitHub ↗

Generate dependencies for all interesting modules and print them to stdout.

(
    modules: dict[str, MypyFile],
    type_map: dict[Expression, Type],
    python_version: tuple[int, int],
    options: Options,
)

Source from the content-addressed store, hash-verified

1112
1113
1114def dump_all_dependencies(
1115 modules: dict[str, MypyFile],
1116 type_map: dict[Expression, Type],
1117 python_version: tuple[int, int],
1118 options: Options,
1119) -> None:
1120 """Generate dependencies for all interesting modules and print them to stdout."""
1121 all_deps: dict[str, set[str]] = {}
1122 for id, node in modules.items():
1123 # Uncomment for debugging:
1124 # print('processing', id)
1125 if id in ("builtins", "typing") or "/typeshed/" in node.path:
1126 continue
1127 assert id == node.fullname
1128 deps = get_dependencies(node, type_map, python_version, options)
1129 for trigger, targets in deps.items():
1130 all_deps.setdefault(trigger, set()).update(targets)
1131 type_state.add_all_protocol_deps(all_deps)
1132
1133 for trigger, targets in sorted(all_deps.items(), key=lambda x: x[0]):
1134 print(trigger)
1135 for target in sorted(targets):
1136 print(f" {target}")

Callers 1

dispatchFunction · 0.90

Calls 8

get_dependenciesFunction · 0.85
setClass · 0.85
sortedFunction · 0.85
printFunction · 0.85
setdefaultMethod · 0.80
add_all_protocol_depsMethod · 0.80
itemsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…