From 506d0f382d9b2ab1c28075b2ab28fabfaf2ddc9d Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Fri, 8 Nov 2024 10:22:35 -0500 Subject: [PATCH 01/13] feat(pyproject.toml): add name to the .toml file. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dd17371..040975c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "execexam" version = "0.3.0" description = "ExecExam runs executable examinations, providing feedback and assistance!" -authors = ["Gregory M. Kapfhammer "] +authors = ["Hemani Alaparthi ","Gregory M. Kapfhammer "] readme = "README.md" [tool.poetry.scripts] From 12c65e8f94ffc2f86e7d8c1523ef65ae30a92ec7 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Fri, 8 Nov 2024 10:25:06 -0500 Subject: [PATCH 02/13] add(display.py): change the commands into a dictionary for long term maintainablitiy. --- execexam/display.py | 88 +++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index 0abd723..058c491 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -32,57 +32,43 @@ def get_display_return_code(return_code: int, fancy: bool) -> str: def display_tldr(console: Console) -> None: """Display a list of example commands and their descriptions.""" - console.print( - "[bold yellow]Too Lazy; Didn't Read: Example Commands[/bold yellow]\n" - ) - console.print( - "[bold red]Please ensure you are in the directory with the pyproject.toml file to run these commands.[/bold red]\n" - ) - - console.print( - "[bold cyan]poetry run execexam [/bold cyan]" - ) - console.print( - " Run executable exam for a project with the specified test files." - ) - - console.print( - "[bold cyan]poetry run execexam --mark [/bold cyan]" - ) - console.print(" Run the tests with the specified mark(s).") - - console.print( - "[bold cyan]poetry run execexam --maxfail[/bold cyan]" - ) - console.print(" Limit the number of test failures before stopping.") - - console.print( - "[bold cyan]poetry run execexam --report /[/bold cyan]" - ) - console.print( - " Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." - ) - - console.print( - "[bold cyan]poetry run execexam --advice-model --advice-method [/bold cyan]" - ) - console.print( - " Use specified LLM model and method for providing advice on test failures." - ) - - console.print( - "[bold cyan]poetry run execexam <--debug>/<--no-debug>[/bold cyan]" - ) - console.print(" Display or disable debugging information.") - - console.print( - "[bold cyan]poetry run execexam <--fancy>/<--no-fancy>[/bold cyan]" - ) - console.print(" Display or disable fancy output formatting.") - - console.print( - "\n[bold yellow]help:[/bold yellow] Use [bold yellow]--help[/bold yellow] to see more options." - ) + console.print("[bold yellow]Too Lazy; Didn't Read: Example Commands[/bold yellow]\n") + console.print("[bold red]Please ensure you are in the directory with the pyproject.toml file to run these commands.[/bold red]\n") + + commands = { + "mark": { + "command": "poetry run execexam --mark ", + "description": "Run tests that match the specified mark type. Useful for targeted testing of specific groups." + }, + "report": { + "command": "poetry run execexam --report /", + "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." + }, + "advice-model": { + "command": "poetry run execexam --advice-model --advice-method ", + "description": "Specify the LLM model and advice method to use. Consult documentation for available models and methods." + }, + "debug": { + "command": "poetry run execexam --debug/--no-debug", + "description": "Enable or disable debug mode to collect additional debugging information during execution." + }, + "fancy": { + "command": "poetry run execexam --fancy/--no-fancy", + "description": "Toggle fancy output formatting. Disable for simpler output in plain-text environments." + }, + "verbose": { + "command": "poetry run execexam --verbose/--no-verbose", + "description": "Enable or disable verbose output to see more detailed logs of the program's execution." + } + } + + for command_name, command_info in commands.items(): + console.print(f"[bold green]{command_name}[/bold green]") + console.print(f"[bold white]Command:[/bold white] [bold cyan]{command_info['command']}[/bold cyan]") + console.print(f"[bold white]Description:[/bold white] {command_info['description']}") + console.print() + + console.print("\n[bold yellow]help:[/bold yellow] Use [bold yellow]--help[/bold yellow] to see more options.") def display_advice(return_code: int) -> str: From 4ff3f2eaca7dea8dee38a478aad38df0808c5232 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Fri, 8 Nov 2024 10:42:06 -0500 Subject: [PATCH 03/13] feat(main.py): change the tldr to set to false so that it can be disabled. --- execexam/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/execexam/main.py b/execexam/main.py index 9629bda..65fb35e 100644 --- a/execexam/main.py +++ b/execexam/main.py @@ -62,7 +62,7 @@ def run( # noqa: PLR0913, PLR0915 callback=tldr_callback, help="Display summary of commands", ), - ] = None, + ] = False, report: Optional[List[enumerations.ReportType]] = typer.Option( None, help="Types of reports to generate", @@ -103,8 +103,9 @@ def run( # noqa: PLR0913, PLR0915 litellm_thread = threading.Thread(target=advise.load_litellm) # if --tldr was specified, then display the TLDR summary # of the commands and then exit the program - if tldr is not None: - return + if tldr: + display.display_tldr(console) + raise typer.Exit() # if execexam was configured to produce the report for advice # or if it was configured to produce all of the possible reports, # then start the litellm thread that provides the advice From f3c54b097568e817ae86f4870bbbae1a19c99e09 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Sat, 9 Nov 2024 13:25:35 -0500 Subject: [PATCH 04/13] add(display.py): all the commands in the cli and also their descriptions --- execexam/display.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index 058c491..cb1cf14 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -37,16 +37,20 @@ def display_tldr(console: Console) -> None: commands = { "mark": { - "command": "poetry run execexam --mark ", - "description": "Run tests that match the specified mark type. Useful for targeted testing of specific groups." + "command": "poetry run execexam --mark mark_type", + "description": "Run tests with specific markers (e.g., unit, integration, functional)" + }, + "maxfail": { + "command": "poetry run execexam --maxfail number", + "description": "Set maximum number of test failures before stopping test execution (default: 10)" }, "report": { - "command": "poetry run execexam --report /", + "command": "poetry run execexam --report report_type/all", "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." }, "advice-model": { "command": "poetry run execexam --advice-model --advice-method ", - "description": "Specify the LLM model and advice method to use. Consult documentation for available models and methods." + "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods." }, "debug": { "command": "poetry run execexam --debug/--no-debug", @@ -59,6 +63,10 @@ def display_tldr(console: Console) -> None: "verbose": { "command": "poetry run execexam --verbose/--no-verbose", "description": "Enable or disable verbose output to see more detailed logs of the program's execution." + }, + "syntax-theme": { + "command": "poetry run execexam --syntax-theme theme_name", + "description": "Choose syntax highlighting theme for code output (options: ansi_dark, ansi_light)" } } From 7681eb22dccd7a4c74aa11fe88eb5ca670d7b2a8 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Sat, 9 Nov 2024 13:37:38 -0500 Subject: [PATCH 05/13] remove(display.py): the poetry command since it can be used with other dependencies. --- execexam/display.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index cb1cf14..fecc79d 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -37,35 +37,35 @@ def display_tldr(console: Console) -> None: commands = { "mark": { - "command": "poetry run execexam --mark mark_type", + "command": "run execexam --mark mark_type", "description": "Run tests with specific markers (e.g., unit, integration, functional)" }, "maxfail": { - "command": "poetry run execexam --maxfail number", + "command": "run execexam --maxfail number", "description": "Set maximum number of test failures before stopping test execution (default: 10)" }, "report": { - "command": "poetry run execexam --report report_type/all", + "command": "run execexam --report report_type/all", "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." }, "advice-model": { - "command": "poetry run execexam --advice-model --advice-method ", + "command": "run execexam --advice-model --advice-method ", "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods." }, "debug": { - "command": "poetry run execexam --debug/--no-debug", + "command": "run execexam --debug/--no-debug", "description": "Enable or disable debug mode to collect additional debugging information during execution." }, "fancy": { - "command": "poetry run execexam --fancy/--no-fancy", + "command": "run execexam --fancy/--no-fancy", "description": "Toggle fancy output formatting. Disable for simpler output in plain-text environments." }, "verbose": { - "command": "poetry run execexam --verbose/--no-verbose", + "command": "run execexam --verbose/--no-verbose", "description": "Enable or disable verbose output to see more detailed logs of the program's execution." }, "syntax-theme": { - "command": "poetry run execexam --syntax-theme theme_name", + "command": "run execexam --syntax-theme theme_name", "description": "Choose syntax highlighting theme for code output (options: ansi_dark, ansi_light)" } } From b03cb6f66a8df41c7f640699fc313ac20a44207b Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Sat, 9 Nov 2024 13:46:20 -0500 Subject: [PATCH 06/13] remove(diosplay.py): remove the <> in the model and method --- execexam/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/execexam/display.py b/execexam/display.py index fecc79d..103d4d5 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -49,7 +49,7 @@ def display_tldr(console: Console) -> None: "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." }, "advice-model": { - "command": "run execexam --advice-model --advice-method ", + "command": "run execexam --advice-model model --advice-method method", "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods." }, "debug": { From abadf05dc4cf694066d1c18eacaf6f67de7d7652 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Sat, 9 Nov 2024 14:47:25 -0500 Subject: [PATCH 07/13] fix(display.py): fix the formatting by running ruff format. --- execexam/display.py | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index 103d4d5..ab17d44 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -32,51 +32,61 @@ def get_display_return_code(return_code: int, fancy: bool) -> str: def display_tldr(console: Console) -> None: """Display a list of example commands and their descriptions.""" - console.print("[bold yellow]Too Lazy; Didn't Read: Example Commands[/bold yellow]\n") - console.print("[bold red]Please ensure you are in the directory with the pyproject.toml file to run these commands.[/bold red]\n") + console.print( + "[bold yellow]Too Lazy; Didn't Read: Example Commands[/bold yellow]\n" + ) + console.print( + "[bold red]Please ensure you are in the directory with the pyproject.toml file to run these commands.[/bold red]\n" + ) commands = { "mark": { "command": "run execexam --mark mark_type", - "description": "Run tests with specific markers (e.g., unit, integration, functional)" + "description": "Run tests with specific markers (e.g., unit, integration, functional)", }, "maxfail": { "command": "run execexam --maxfail number", - "description": "Set maximum number of test failures before stopping test execution (default: 10)" + "description": "Set maximum number of test failures before stopping test execution (default: 10)", }, "report": { "command": "run execexam --report report_type/all", - "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." + "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types.", }, "advice-model": { "command": "run execexam --advice-model model --advice-method method", - "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods." + "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods.", }, "debug": { "command": "run execexam --debug/--no-debug", - "description": "Enable or disable debug mode to collect additional debugging information during execution." + "description": "Enable or disable debug mode to collect additional debugging information during execution.", }, "fancy": { "command": "run execexam --fancy/--no-fancy", - "description": "Toggle fancy output formatting. Disable for simpler output in plain-text environments." + "description": "Toggle fancy output formatting. Disable for simpler output in plain-text environments.", }, "verbose": { "command": "run execexam --verbose/--no-verbose", - "description": "Enable or disable verbose output to see more detailed logs of the program's execution." + "description": "Enable or disable verbose output to see more detailed logs of the program's execution.", }, "syntax-theme": { "command": "run execexam --syntax-theme theme_name", - "description": "Choose syntax highlighting theme for code output (options: ansi_dark, ansi_light)" - } + "description": "Choose syntax highlighting theme for code output (options: ansi_dark, ansi_light)", + }, } for command_name, command_info in commands.items(): console.print(f"[bold green]{command_name}[/bold green]") - console.print(f"[bold white]Command:[/bold white] [bold cyan]{command_info['command']}[/bold cyan]") - console.print(f"[bold white]Description:[/bold white] {command_info['description']}") + console.print( + f"[bold white]Command:[/bold white] [bold cyan]{command_info['command']}[/bold cyan]" + ) + console.print( + f"[bold white]Description:[/bold white] {command_info['description']}" + ) console.print() - console.print("\n[bold yellow]help:[/bold yellow] Use [bold yellow]--help[/bold yellow] to see more options.") + console.print( + "\n[bold yellow]help:[/bold yellow] Use [bold yellow]--help[/bold yellow] to see more options." + ) def display_advice(return_code: int) -> str: From 0cdbcefa93c1ad59ae7c1fc7f59b7acaffef7bb2 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Sat, 9 Nov 2024 14:50:08 -0500 Subject: [PATCH 08/13] add(display.py): the <> to the advice method for better readabitlity --- execexam/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/execexam/display.py b/execexam/display.py index ab17d44..e3ce8a7 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -53,7 +53,7 @@ def display_tldr(console: Console) -> None: "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types.", }, "advice-model": { - "command": "run execexam --advice-model model --advice-method method", + "command": "run execexam --advice-model --advice-method ", "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods.", }, "debug": { From ed9c1f9c767b746f66e182e3b95db6ef91e52905 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Sat, 9 Nov 2024 14:52:17 -0500 Subject: [PATCH 09/13] fix(display.py): the advice-method for better clarity on how to run the coding mentor. --- execexam/display.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index e3ce8a7..951f898 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -52,8 +52,8 @@ def display_tldr(console: Console) -> None: "command": "run execexam --report report_type/all", "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types.", }, - "advice-model": { - "command": "run execexam --advice-model --advice-method ", + "advice-method": { + "command": " --advice-method --advice-model --advice-server ", "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods.", }, "debug": { From 13b1404a1688bf8f92a43ff63e9172704b6db53d Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Mon, 11 Nov 2024 18:42:38 -0500 Subject: [PATCH 10/13] remove(display.py): the .toml file output for more user clarity --- execexam/display.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index 951f898..5483584 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -35,9 +35,6 @@ def display_tldr(console: Console) -> None: console.print( "[bold yellow]Too Lazy; Didn't Read: Example Commands[/bold yellow]\n" ) - console.print( - "[bold red]Please ensure you are in the directory with the pyproject.toml file to run these commands.[/bold red]\n" - ) commands = { "mark": { From 84a7c4401fd8d48391c86a85eb53c65f6eddb229 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Tue, 12 Nov 2024 18:23:27 -0500 Subject: [PATCH 11/13] remove(display.py): examples --- execexam/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/execexam/display.py b/execexam/display.py index 5483584..29a2c81 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -39,7 +39,7 @@ def display_tldr(console: Console) -> None: commands = { "mark": { "command": "run execexam --mark mark_type", - "description": "Run tests with specific markers (e.g., unit, integration, functional)", + "description": "Run tests with specific markers.", }, "maxfail": { "command": "run execexam --maxfail number", From c1d92cbf7557bdbd98e1c28b8903ba4a4d871d05 Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Tue, 12 Nov 2024 18:24:03 -0500 Subject: [PATCH 12/13] fix(pyproject.toml): change version to 0.3.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cdbcdd4..11bb85d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "execexam" -version = "0.3.0" +version = "0.3.2" description = "ExecExam runs executable examinations, providing feedback and assistance!" authors = ["Hemani Alaparthi ","Gregory M. Kapfhammer "] readme = "README.md" From e8136ca9826afd492ef61f4ea1ef3d5a196df7ec Mon Sep 17 00:00:00 2001 From: hemanialaparthi Date: Thu, 14 Nov 2024 15:14:43 -0500 Subject: [PATCH 13/13] remove(display.py): the 'run' infront of all commands because that is not needed --- execexam/display.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/execexam/display.py b/execexam/display.py index 29a2c81..f283eda 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -38,35 +38,35 @@ def display_tldr(console: Console) -> None: commands = { "mark": { - "command": "run execexam --mark mark_type", + "command": "execexam --mark mark_type", "description": "Run tests with specific markers.", }, "maxfail": { - "command": "run execexam --maxfail number", + "command": "execexam --maxfail number", "description": "Set maximum number of test failures before stopping test execution (default: 10)", }, "report": { - "command": "run execexam --report report_type/all", + "command": "execexam --report report_type/all", "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types.", }, "advice-method": { - "command": " --advice-method --advice-model --advice-server ", + "command": "execexam --advice-method --advice-model --advice-server ", "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods.", }, "debug": { - "command": "run execexam --debug/--no-debug", + "command": "execexam --debug/--no-debug", "description": "Enable or disable debug mode to collect additional debugging information during execution.", }, "fancy": { - "command": "run execexam --fancy/--no-fancy", + "command": "execexam --fancy/--no-fancy", "description": "Toggle fancy output formatting. Disable for simpler output in plain-text environments.", }, "verbose": { - "command": "run execexam --verbose/--no-verbose", + "command": "execexam --verbose/--no-verbose", "description": "Enable or disable verbose output to see more detailed logs of the program's execution.", }, "syntax-theme": { - "command": "run execexam --syntax-theme theme_name", + "command": "execexam --syntax-theme theme_name", "description": "Choose syntax highlighting theme for code output (options: ansi_dark, ansi_light)", }, }