Skip to content

Commit 207868b

Browse files
joverlee521tsibley
andcommitted
version: Declutter pathogen workflow listing
List the workflow names on the same line as the pathogen name@version when there are any workflows and emit nothing when there aren't. This fits more in the style of the rest of `nextstrain version` and is much less cluttered (more information dense), particularly considering that we, in short order too, expect ~all of our pathogens (and all their future versions) to have the same 2–3 workflows listed (nextclade, ingest, phylogenetic). Prompted by feedback from @tsibley.¹ ¹ <#472 (comment)> Co-authored-by: Thomas Sibley <tsibley@fredhutch.org>
1 parent f82c2e8 commit 207868b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

nextstrain/cli/command/version.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,11 @@ def run(opts):
6868
print(" " + name)
6969
for version in versions.values():
7070
is_default = version == defaults.get(name)
71-
print(" " + str(version) + (f"={version.url or ''}" if opts.verbose else ""), "(default)" if is_default else "")
71+
compatible_workflows = version.compatible_workflows("nextstrain run")
72+
print(" " + str(version) + (f"={version.url or ''}" if opts.verbose else "")
73+
+ (" (default)" if is_default else "")
74+
+ (f" {{{', '.join(compatible_workflows)}}}" if compatible_workflows else ""))
7275
if opts.verbose:
7376
print(" " + str(version.path))
74-
75-
if compatible_workflows := version.compatible_workflows("nextstrain run"):
76-
print(" " + "Compatible workflows:")
77-
for workflow in compatible_workflows:
78-
print(" " + workflow)
79-
else:
80-
print(" " + "No workflows listed, please refer to pathogen docs.")
8177
else:
8278
print(" (none)")

0 commit comments

Comments
 (0)