Skip to content

Commit 598cb8f

Browse files
committed
fixes
1 parent 3d3062a commit 598cb8f

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

agent/run_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def run_agent_for_repo(
134134
local_repo, "HEAD", example["base_commit"]
135135
)
136136
# Call the commit0 get-tests command to retrieve test files
137-
test_files_str = get_tests(repo_name, verbose=0)
137+
test_files_str = [xx for x in get_tests(repo_name, verbose=0) for xx in x]
138138
test_files = sorted(list(set([i.split(":")[0] for i in test_files_str])))
139139

140140
# prepare the log dir

agent/run_agent_no_rich.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def run_agent_for_repo(
9696
local_repo, "HEAD", example["base_commit"]
9797
)
9898
# Call the commit0 get-tests command to retrieve test files
99-
test_files_str = get_tests(repo_name, verbose=0)
99+
test_files_str = [xx for x in get_tests(repo_name, verbose=0) for xx in x]
100100
test_files = sorted(list(set([i.split(":")[0] for i in test_files_str])))
101101

102102
# prepare the log dir

commit0/harness/evaluate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def main(
3434
dataset: Iterator[RepoInstance] = load_dataset(dataset_name, split=dataset_split) # type: ignore
3535
if "swe" in dataset_name.lower():
3636
if repo_split == "all":
37-
repos = dataset["instance_id"]
37+
repos = dataset["instance_id"] # type: ignore
3838
else:
3939
repos = [repo_split]
4040
else:

commit0/harness/get_pytest_ids.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import bz2
2-
from typing import List, Tuple
2+
from typing import List
33
import commit0
44
import os
55

66

7-
def read(bz2_file):
7+
def read(bz2_file: str) -> str:
88
with bz2.open(bz2_file, "rt") as f:
99
out = f.read()
1010
return out
1111

12-
def main(repo: str, verbose: int) -> Tuple[List[str], List[str]]:
12+
13+
def main(repo: str, verbose: int) -> List[List[str]]:
1314
repo = repo.lower()
1415
repo = repo.replace(".", "-")
1516
commit0_path = os.path.dirname(commit0.__file__)
16-
if '__' in repo:
17+
if "__" in repo:
1718
in_file_fail = read(f"{commit0_path}/data/test_ids/{repo}#fail_to_pass.bz2")
1819
in_file_pass = read(f"{commit0_path}/data/test_ids/{repo}#pass_to_pass.bz2")
1920
else:

commit0/harness/run_pytest_ids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def main(
116116
local_repo, example["base_commit"], commit_id
117117
)
118118
patch_file = Path(log_dir / "patch.diff")
119-
patch_file.write_text(patch, encoding='utf-8', errors='ignore')
119+
patch_file.write_text(patch, encoding="utf-8", errors="ignore")
120120

121121
# make eval file
122122
if coverage:

0 commit comments

Comments
 (0)