Updated method

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2024-05-10 22:46:13 +03:00
parent e57478cee7
commit d1c2560782

View file

@ -332,17 +332,17 @@ class View(Configs): # pylint: disable=[R0902]
print() print()
def missing_dependencies(self, packages: list) -> None: def missing_dependencies(self, packages: list) -> None:
""" Checks for missing dependencies. """ View for missing dependencies.
""" """
not_found: dict = {} missing_deps: dict = {}
for package in packages: for package in packages:
requires: list = self.data[package]['requires'] requires: list = self.data[package]['requires']
for req in requires: for req in requires:
if req not in self.data: if req not in self.data:
not_found[package] = [req for req in requires if req not in self.data] missing_deps[package] = [req for req in requires if req not in self.data]
if not_found: if missing_deps:
print('\nPackages with missing dependencies:') print('\nPackages with missing dependencies:')
for pkg, deps in not_found.items(): for pkg, deps in missing_deps.items():
print(f"> {self.cyan}{pkg}{self.endc}: Requires " print(f"> {self.cyan}{pkg}{self.endc}: Requires "
f"({len(deps)}) -> {self.red}{', '.join(deps)}{self.endc}") f"({len(deps)}) -> {self.red}{', '.join(deps)}{self.endc}")