Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wenting-zhao committed Sep 20, 2024
1 parent f0e9e93 commit e02e743
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion baselines/run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run_agent_for_repo(
repo_name = repo_name.replace(".", "-")

# Call the commit0 get-tests command to retrieve test files
test_files_str = get_tests(repo_name, stdout=False)
test_files_str = get_tests(repo_name, verbose=0)
test_files = sorted(list(set([i.split(":")[0] for i in test_files_str])))

repo_path = os.path.join(commit0_config.base_dir, repo_name)
Expand Down
16 changes: 14 additions & 2 deletions commit0/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ def build(
),
dataset_split: str = typer.Option("test", help="Split of the Huggingface dataset"),
num_workers: int = typer.Option(8, help="Number of workers"),
verbose: int = typer.Option(1, "--verbose", "-v", help="Set this to 2 for more logging information", count=True),
verbose: int = typer.Option(
1,
"--verbose",
"-v",
help="Set this to 2 for more logging information",
count=True,
),
) -> None:
"""Commit0 build a repository."""
check_valid(repo_split, SPLIT)
Expand Down Expand Up @@ -134,7 +140,13 @@ def test(
reference: Annotated[
bool, typer.Option("--reference", help="Test the reference commit.")
] = False,
verbose: int = typer.Option(1, "--verbose", "-v", help="Set this to 2 for more logging information", count=True),
verbose: int = typer.Option(
1,
"--verbose",
"-v",
help="Set this to 2 for more logging information",
count=True,
),
) -> None:
"""Run tests on a Commit0 repository."""
if repo_or_repo_path.endswith("/"):
Expand Down
1 change: 1 addition & 0 deletions commit0/harness/docker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def build_repo_images(
client (docker.DockerClient): Docker client to use for building the images
dataset (list): List of test specs or dataset to build images for
max_workers (int): Maximum number of workers to use for building images
verbose (int): Level of verbosity
Return:
------
Expand Down
4 changes: 3 additions & 1 deletion commit0/harness/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __str__(self):
)


def setup_logger(repo: str, log_file: Path, mode: str = "w", verbose: int = 1) -> logging.Logger:
def setup_logger(
repo: str, log_file: Path, mode: str = "w", verbose: int = 1
) -> logging.Logger:
"""Used for logging the build process of images and running containers.
It writes logs to the log file.
"""
Expand Down

0 comments on commit e02e743

Please sign in to comment.