You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"Invalid {highlight('REPO_OR_REPO_SPLIT', Colors.RED)}. Must be one of: {valid}",
39
37
param_hint="REPO or REPO_SPLIT",
@@ -53,7 +51,7 @@ def setup(
53
51
base_dir: str=typer.Option("repos/", help="Base directory to clone repos to"),
54
52
) ->None:
55
53
"""Commit0 clone a repo split."""
56
-
is_valid(repo_split, SPLIT)
54
+
check_valid(repo_split, SPLIT)
57
55
58
56
typer.echo(f"Cloning repository for split: {repo_split}")
59
57
typer.echo(f"Dataset name: {dataset_name}")
@@ -81,7 +79,7 @@ def build(
81
79
num_workers: int=typer.Option(8, help="Number of workers"),
82
80
) ->None:
83
81
"""Commit0 build a repository."""
84
-
is_valid(repo_split, SPLIT)
82
+
check_valid(repo_split, SPLIT)
85
83
86
84
typer.echo(f"Building repository for split: {repo_split}")
87
85
typer.echo(f"Dataset name: {dataset_name}")
@@ -104,7 +102,7 @@ def get_tests(
104
102
),
105
103
) ->None:
106
104
"""Get tests for a Commit0 repository."""
107
-
is_valid(repo_name, SPLIT_ALL)
105
+
check_valid(repo_name, SPLIT_ALL)
108
106
109
107
typer.echo(f"Getting tests for repository: {repo_name}")
110
108
@@ -116,8 +114,13 @@ def test(
116
114
repo_or_repo_path: str=typer.Argument(
117
115
..., help="Directory of the repository to test"
118
116
),
119
-
test_ids: str=typer.Argument(..., help="All ways pytest supports to run and select tests. Please provide a single string. Example: \"test_mod.py\", \"testing/\", \"test_mod.py::test_func\", \"-k 'MyClass and not method'\""),
120
-
branch: Union[str, None] =typer.Option(None, help="Branch to test (branch MUST be provided or use --reference)"),
117
+
test_ids: str=typer.Argument(
118
+
...,
119
+
help='All ways pytest supports to run and select tests. Please provide a single string. Example: "test_mod.py", "testing/", "test_mod.py::test_func", "-k \'MyClass and not method\'"',
120
+
),
121
+
branch: Union[str, None] =typer.Option(
122
+
None, help="Branch to test (branch MUST be provided or use --reference)"
123
+
),
121
124
dataset_name: str=typer.Option(
122
125
"wentingzhao/commit0_docstring", help="Name of the Huggingface dataset"
123
126
),
@@ -126,24 +129,26 @@ def test(
126
129
backend: str=typer.Option("local", help="Backend to use for testing"),
127
130
timeout: int=typer.Option(1800, help="Timeout for tests in seconds"),
128
131
num_cpus: int=typer.Option(1, help="Number of CPUs to use"),
129
-
reference: Annotated[bool, typer.Option("--reference", help="Test the reference commit.")] =False
132
+
reference: Annotated[
133
+
bool, typer.Option("--reference", help="Test the reference commit.")
134
+
] =False,
130
135
) ->None:
131
136
"""Run tests on a Commit0 repository."""
132
-
typer.echo(f"Running tests for repository: {repo_or_repo_path}")
0 commit comments