mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(agent, benchmark): Specify path_type=Path for CLI path options/arguments
Without `path_type=Path`, an option/argument with `type=click.Path()` will return a `str`.
This commit is contained in:
@@ -113,7 +113,7 @@ def cli(ctx: click.Context):
|
||||
@click.option(
|
||||
"--component-config-file",
|
||||
help="Path to a json configuration file",
|
||||
type=click.Path(exists=True, dir_okay=False, resolve_path=True),
|
||||
type=click.Path(exists=True, dir_okay=False, resolve_path=True, path_type=Path),
|
||||
)
|
||||
def run(
|
||||
continuous: bool,
|
||||
|
||||
@@ -19,7 +19,7 @@ from autogpt.app.utils import coroutine
|
||||
help="Path to the git repository",
|
||||
)
|
||||
@coroutine
|
||||
async def generate_release_notes(repo_path: Optional[Path] = None):
|
||||
async def generate_release_notes(repo_path: Optional[str | Path] = None):
|
||||
logger = logging.getLogger(generate_release_notes.name) # pyright: ignore
|
||||
|
||||
repo = Repo(repo_path, search_parent_directories=True)
|
||||
|
||||
@@ -97,7 +97,9 @@ def start():
|
||||
help="Write log output to a file instead of the terminal.",
|
||||
)
|
||||
# @click.argument(
|
||||
# "agent_path", type=click.Path(exists=True, file_okay=False), required=False
|
||||
# "agent_path",
|
||||
# type=click.Path(exists=True, file_okay=False, path_type=Path),
|
||||
# required=False,
|
||||
# )
|
||||
def run(
|
||||
maintain: bool,
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
|
||||
from agbenchmark.reports.processing.report_types import Report
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("report_json_file", type=click.Path(exists=True, dir_okay=False))
|
||||
@click.argument(
|
||||
"report_json_file", type=click.Path(exists=True, dir_okay=False, path_type=Path)
|
||||
)
|
||||
def print_markdown_report(report_json_file: Path):
|
||||
"""
|
||||
Generates a Markdown report from a given report.json file.
|
||||
|
||||
Reference in New Issue
Block a user