MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / run

Method run

misc/python/materialize/cli/mzcompose.py:402–434  ·  view source on GitHub ↗
(self, args: argparse.Namespace)

Source from the content-addressed store, hash-verified

400 help = "describe services and workflows in the composition"
401
402 def run(self, args: argparse.Namespace) -> None:
403 composition = load_composition(args, munge_services=False)
404
405 workflows = []
406 for name, fn in composition.workflows.items():
407 workflows.append((name, inspect.getdoc(fn) or ""))
408 workflows.sort()
409
410 name_width = min(max(len(name) for name, _ in workflows), 16)
411
412 if composition.description:
413 print("Description:")
414 print(composition.description)
415 print()
416
417 print("Services:")
418 for name in sorted(composition.compose["services"]):
419 print(f" {name}")
420
421 print()
422 print("Workflows:")
423 for name, description in workflows:
424 if len(name) <= name_width or not description:
425 print(f" {name: <{name_width}} {description}")
426 else:
427 print(f" {name}")
428 print(f" {' ' * name_width} {description}")
429
430 print()
431 print("""For help on a specific workflow, run:
432
433 $ ./mzcompose run WORKFLOW --help
434""")
435
436
437class DescriptionCommand(Command):

Callers

nothing calls this directly

Calls 4

load_compositionFunction · 0.85
sortMethod · 0.80
itemsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected