Skip to content

Commit

Permalink
Highlight missing or invalid requirements while computing dependency …
Browse files Browse the repository at this point in the history
…graph
  • Loading branch information
perseoGI committed Jun 21, 2024
1 parent 0a15ae2 commit e476e71
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions conan/cli/printers/graph.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -122,14 +122,15 @@ 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:
output.info(msg, Color.BRIGHT_CYAN)
output.info(f"{msg}{status}{f" ({remote.name})" if remote else ""}", Color.BRIGHT_CYAN)

_format_requires("Requirements", requires)
_format_requires("Test requirements", test_requires)
Expand Down

0 comments on commit e476e71

Please sign in to comment.