diff --git a/requirements.txt b/requirements.txt index d1b506d98..879f6a914 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,6 +30,7 @@ rich>=12.6 scikit-learn>=1.2.2 seaborn>=0.13.0 tabulate>=0.9 +trogon>=0.5.0 types-PyYAML types-requests types-tabulate diff --git a/varats/setup.py b/varats/setup.py index 1986b251d..e035621f6 100644 --- a/varats/setup.py +++ b/varats/setup.py @@ -42,6 +42,7 @@ "scikit-learn>=1.2.2", "seaborn>=0.13.0", "tabulate>=0.9", + "trogon>=0.5.0", "varats-core>=13.0.5", "wllvm>=1.3.1", ], diff --git a/varats/varats/tools/driver_artefacts.py b/varats/varats/tools/driver_artefacts.py index 69632fbcd..c1b1d36b2 100644 --- a/varats/varats/tools/driver_artefacts.py +++ b/varats/varats/tools/driver_artefacts.py @@ -13,6 +13,7 @@ import click import yaml from rich.progress import Progress +from trogon import tui from varats.data.discover_reports import initialize_reports from varats.paper.paper_config import get_paper_config @@ -36,6 +37,7 @@ LOG = logging.getLogger(__name__) +@tui() @click.group( help="Manage artefacts.", context_settings={"help_option_names": ['-h', '--help']} diff --git a/varats/varats/tools/driver_build_setup.py b/varats/varats/tools/driver_build_setup.py index 78e2dbbe1..78f9633c2 100644 --- a/varats/varats/tools/driver_build_setup.py +++ b/varats/varats/tools/driver_build_setup.py @@ -6,6 +6,7 @@ import click from plumbum import colors +from trogon import tui from varats.containers.containers import ( ImageBase, @@ -89,6 +90,7 @@ def show_major_release_prompt( return +@tui() @click.group(context_settings={"help_option_names": ['-h', '--help']}) def main() -> None: """Build VaRA on cli.""" @@ -170,7 +172,7 @@ def update(research_tool: str) -> None: @click.option( "--build-type", type=EnumChoice(BuildType, case_sensitive=False), - default=BuildType.DEV, + default="DEV", help="Build type to use for the tool build configuration." ) @click.option( diff --git a/varats/varats/tools/driver_casestudy.py b/varats/varats/tools/driver_casestudy.py index 2f40a8409..0b245b920 100644 --- a/varats/varats/tools/driver_casestudy.py +++ b/varats/varats/tools/driver_casestudy.py @@ -8,6 +8,7 @@ import click from plumbum import FG, colors, local +from trogon import tui from varats.base.sampling_method import NormalSamplingMethod from varats.data.discover_reports import initialize_reports @@ -86,6 +87,7 @@ def create_plot_type_choice() -> TypedChoice[tp.Type[Plot]]: return TypedChoice(Plot.PLOTS) +@tui() @click.group() @configuration_lookup_error_handler def main() -> None: diff --git a/varats/varats/tools/driver_config.py b/varats/varats/tools/driver_config.py index 2023f8b31..55744f108 100644 --- a/varats/varats/tools/driver_config.py +++ b/varats/varats/tools/driver_config.py @@ -11,10 +11,12 @@ import click import yaml from benchbuild.utils.settings import ConfigDumper, Configuration +from trogon import tui from varats.utils.settings import vara_cfg, save_config +@tui() @click.group("vara-config") def main() -> None: """ diff --git a/varats/varats/tools/driver_container.py b/varats/varats/tools/driver_container.py index c55801bbf..2dcbf4527 100644 --- a/varats/varats/tools/driver_container.py +++ b/varats/varats/tools/driver_container.py @@ -8,6 +8,7 @@ import typing as tp import click +from trogon import tui from varats.containers.containers import ( create_base_images, @@ -26,6 +27,7 @@ LOG = logging.Logger(__name__) +@tui() @click.group( help="Manage base container images.", context_settings={"help_option_names": ['-h', '--help']} @@ -144,7 +146,8 @@ def delete( "-t", "--tool", type=click.Choice([*get_supported_research_tool_names(), "none"]), - default=lambda: vara_cfg()["container"]["research_tool"].value or "none", + required=True, + # default=lambda: vara_cfg()["container"]["research_tool"].value or "none", prompt="Select a research tool to activate.", help="The research tool to activate." ) diff --git a/varats/varats/tools/driver_develop.py b/varats/varats/tools/driver_develop.py index 4e6942f45..9cc8d72e5 100644 --- a/varats/varats/tools/driver_develop.py +++ b/varats/varats/tools/driver_develop.py @@ -3,6 +3,7 @@ import typing as tp import click +from trogon import tui from varats.tools.research_tools import development as dev from varats.tools.research_tools.research_tool import SubProject @@ -13,6 +14,7 @@ from varats.ts_utils.cli_util import initialize_cli_tool +@tui() @click.group(context_settings={"help_option_names": ['-h', '--help']}) @click.option( "-p", diff --git a/varats/varats/tools/driver_gen_benchbuild_config.py b/varats/varats/tools/driver_gen_benchbuild_config.py index 3edd5e726..1e9199061 100644 --- a/varats/varats/tools/driver_gen_benchbuild_config.py +++ b/varats/varats/tools/driver_gen_benchbuild_config.py @@ -6,6 +6,7 @@ import typing as tp import click +from trogon import tui from varats.tools.bb_config import ( create_new_bb_config, @@ -18,6 +19,7 @@ LOG = logging.getLogger(__name__) +@tui() @click.command() @click.option( "--bb-root", diff --git a/varats/varats/tools/driver_paper_config.py b/varats/varats/tools/driver_paper_config.py index d37dcb055..2a231fff9 100644 --- a/varats/varats/tools/driver_paper_config.py +++ b/varats/varats/tools/driver_paper_config.py @@ -9,6 +9,7 @@ from pathlib import Path import click +from trogon import tui from varats.paper.paper_config import get_paper_config from varats.ts_utils.cli_util import cli_list_choice, initialize_cli_tool @@ -23,6 +24,7 @@ LOG = logging.getLogger(__name__) +@tui() @click.group("vara-pc") def main() -> None: """ diff --git a/varats/varats/tools/driver_run.py b/varats/varats/tools/driver_run.py index 7c6ac4e0e..7749909be 100644 --- a/varats/varats/tools/driver_run.py +++ b/varats/varats/tools/driver_run.py @@ -19,6 +19,7 @@ from benchbuild.utils.settings import to_yaml from plumbum import local from plumbum.commands import ProcessExecutionError +from trogon import tui from varats.paper.case_study import CaseStudy from varats.paper.paper_config import get_paper_config @@ -81,6 +82,7 @@ def __validate_project_parameters( return value +@tui() @click.command(context_settings={"help_option_names": ['-h', '--help']}) @click.option('-v', '--verbose', count=True) @click.option("--slurm", is_flag=True, help="Run experiments on slurm.")