MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / check_imports_all_exist

Function check_imports_all_exist

diffusers/utils/tests_fetcher.py:812–825  ·  view source on GitHub ↗

Isn't used per se by the test fetcher but might be used later as a quality check. Putting this here for now so the code is not lost. This checks all imports in a given file do exist.

()

Source from the content-addressed store, hash-verified

810
811
812def check_imports_all_exist():
813 """
814 Isn't used per se by the test fetcher but might be used later as a quality check. Putting this here for now so the
815 code is not lost. This checks all imports in a given file do exist.
816 """
817 cache = {}
818 all_modules = list(PATH_TO_DIFFUSERS.glob("**/*.py")) + list(PATH_TO_TESTS.glob("**/*.py"))
819 all_modules = [str(mod.relative_to(PATH_TO_REPO)) for mod in all_modules]
820 direct_deps = {m: get_module_dependencies(m, cache=cache) for m in all_modules}
821
822 for module, deps in direct_deps.items():
823 for dep in deps:
824 if not (PATH_TO_REPO / dep).is_file():
825 print(f"{module} has dependency on {dep} which does not exist.")
826
827
828def _print_list(l) -> str:

Callers

nothing calls this directly

Calls 1

get_module_dependenciesFunction · 0.85

Tested by

no test coverage detected