From e6d8683c7de84fb6049382b37031c4a7da232538 Mon Sep 17 00:00:00 2001 From: PerseoGI Date: Fri, 21 Jun 2024 14:15:02 +0200 Subject: [PATCH] Highlight missing or invalid requirements while computing dependency graph --- conan/cli/printers/graph.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/conan/cli/printers/graph.py b/conan/cli/printers/graph.py index 404ca7c97f5..5790f8e84cf 100644 --- a/conan/cli/printers/graph.py +++ b/conan/cli/printers/graph.py @@ -1,5 +1,5 @@ from conan.api.output import ConanOutput, Color, LEVEL_VERBOSE -from conans.client.graph.graph import RECIPE_CONSUMER, RECIPE_VIRTUAL, CONTEXT_BUILD, BINARY_SKIP,\ +from conans.client.graph.graph import BINARY_INVALID, BINARY_MISSING, RECIPE_CONSUMER, RECIPE_VIRTUAL, CONTEXT_BUILD, BINARY_SKIP,\ BINARY_PLATFORM @@ -122,13 +122,18 @@ def _format_requires(title, reqs_to_print): output.info(title, Color.BRIGHT_YELLOW) for pref, (status, remote) in sorted(reqs_to_print.items(), key=repr): name = pref.repr_notime() if status != BINARY_PLATFORM else str(pref.ref) - msg = f"{tab}{name} - {status}" - if remote is not None and status != BINARY_SKIP: - msg += f" ({remote.name})" + msg = f"{tab}{name} - " if status == BINARY_SKIP: skipped_requires.append(str(pref.ref)) - output.verbose(msg, Color.BRIGHT_CYAN) + output.verbose(f"{msg}{status}", Color.BRIGHT_CYAN) + elif status == BINARY_MISSING or status == BINARY_INVALID: + output.write(msg, Color.BRIGHT_CYAN) + output.writeln(status, Color.BRIGHT_RED) else: + # Support python36 + msg += status + if remote: + msg += f" ({remote.name})" output.info(msg, Color.BRIGHT_CYAN) _format_requires("Requirements", requires)