From 64a461379cf7f55b4e1513b94ebe87d9ce58475d Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Thu, 26 Oct 2023 14:33:11 +0200 Subject: [PATCH] Update CLI command messages for weasel usage (#71) * Update CLI command messages for weasel usage * Remove import --- weasel/cli/clone.py | 2 +- weasel/cli/dvc.py | 2 +- weasel/cli/run.py | 8 ++++---- weasel/util/validation.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/weasel/cli/clone.py b/weasel/cli/clone.py index 303f64f..1545f03 100644 --- a/weasel/cli/clone.py +++ b/weasel/cli/clone.py @@ -85,7 +85,7 @@ def project_clone( msg.warn(f"No {PROJECT_FILE} found in directory") else: msg.good("Your project is now ready!") - print(f"To fetch the assets, run:\n{COMMAND} project assets {dest}") + print(f"To fetch the assets, run:\n{COMMAND} assets {dest}") def check_clone(name: str, dest: Path, repo: str) -> None: diff --git a/weasel/cli/dvc.py b/weasel/cli/dvc.py index 48522ab..d2dca4d 100644 --- a/weasel/cli/dvc.py +++ b/weasel/cli/dvc.py @@ -14,7 +14,7 @@ UPDATE_COMMAND = "dvc" DVC_CONFIG_COMMENT = f"""# This file is auto-generated by Weasel based on your {PROJECT_FILE}. If you've # edited your {PROJECT_FILE}, you can regenerate this file by running: -# {COMMAND} project {UPDATE_COMMAND}""" +# {COMMAND} {UPDATE_COMMAND}""" @app.command(UPDATE_COMMAND) diff --git a/weasel/cli/run.py b/weasel/cli/run.py index ce0b2cf..392864d 100644 --- a/weasel/cli/run.py +++ b/weasel/cli/run.py @@ -118,7 +118,7 @@ def print_run_help(project_dir: Path, subcommand: Optional[str] = None) -> None: project_loc = "" if is_cwd(project_dir) else project_dir if subcommand: validate_subcommand(list(commands.keys()), list(workflows.keys()), subcommand) - print(f"Usage: {COMMAND} project run {subcommand} {project_loc}") + print(f"Usage: {COMMAND} run {subcommand} {project_loc}") if subcommand in commands: help_text = commands[subcommand].get("help") if help_text: @@ -131,7 +131,7 @@ def print_run_help(project_dir: Path, subcommand: Optional[str] = None) -> None: for i, step in enumerate(steps) ] msg.table(steps_data) - help_cmd = f"{COMMAND} project run [COMMAND] {project_loc} --help" + help_cmd = f"{COMMAND} run [COMMAND] {project_loc} --help" print(f"For command details, run: {help_cmd}") else: print("") @@ -140,11 +140,11 @@ def print_run_help(project_dir: Path, subcommand: Optional[str] = None) -> None: print(f"{locale_escape(title)}\n") if config_commands: print(f"Available commands in {PROJECT_FILE}") - print(f"Usage: {COMMAND} project run [COMMAND] {project_loc}") + print(f"Usage: {COMMAND} run [COMMAND] {project_loc}") msg.table([(cmd["name"], cmd.get("help", "")) for cmd in config_commands]) if workflows: print(f"Available workflows in {PROJECT_FILE}") - print(f"Usage: {COMMAND} project run [WORKFLOW] {project_loc}") + print(f"Usage: {COMMAND} run [WORKFLOW] {project_loc}") msg.table([(name, " -> ".join(steps)) for name, steps in workflows.items()]) diff --git a/weasel/util/validation.py b/weasel/util/validation.py index 65c87d3..0d218ea 100644 --- a/weasel/util/validation.py +++ b/weasel/util/validation.py @@ -7,7 +7,7 @@ from confection import ConfigValidationError from wasabi import msg -from ..cli.main import COMMAND, PROJECT_FILE +from ..cli.main import PROJECT_FILE if TYPE_CHECKING: pass @@ -51,7 +51,7 @@ def show_validation_error( "fill-config' command to fill in all the defaults, if possible:", spaced=True, ) - print(f"{COMMAND} init fill-config {config_path} {config_path} \n") + print(f"python -m spacy init fill-config {config_path} {config_path} \n") sys.exit(1) except InterpolationError as e: msg.fail("Config validation error", e, exits=1)