MCPcopy Index your code
hub / github.com/huggingface/diffusers / create_reverse_dependency_tree

Function create_reverse_dependency_tree

utils/tests_fetcher.py:620–629  ·  view source on GitHub ↗

Create a list of all edges (a, b) which mean that modifying a impacts b with a going over all module and test files.

()

Source from the content-addressed store, hash-verified

618
619
620def create_reverse_dependency_tree() -> List[Tuple[str, str]]:
621 """
622 Create a list of all edges (a, b) which mean that modifying a impacts b with a going over all module and test files.
623 """
624 cache = {}
625 all_modules = list(PATH_TO_DIFFUSERS.glob("**/*.py")) + list(PATH_TO_TESTS.glob("**/*.py"))
626 all_modules = [str(mod.relative_to(PATH_TO_REPO)) for mod in all_modules]
627 edges = [(dep, mod) for mod in all_modules for dep in get_module_dependencies(mod, cache=cache)]
628
629 return list(set(edges))
630
631
632def get_tree_starting_at(module: str, edges: List[Tuple[str, str]]) -> List[Union[str, List[str]]]:

Callers 1

print_tree_deps_ofFunction · 0.85

Calls 1

get_module_dependenciesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…