small bugs in cache rerun (#597)

This commit is contained in:
Xu Yang
2025-02-14 16:24:26 +08:00
committed by GitHub
parent 3c2f799618
commit 79a004bc23
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -133,8 +133,8 @@ class FBWorkspace(Workspace):
Helper function to format the code dictionary into a string.
"""
code_string = ""
for file_name, code in code_dict.items():
code_string += f"\nFile Path: {file_name}\n```\n{code}\n```"
for file_name in sorted(code_dict.keys()):
code_string += f"\nFile Path: {file_name}\n```\n{code_dict[file_name]}\n```"
return code_string
@property
+2
View File
@@ -11,6 +11,7 @@ import json
import os
import pickle
import re
import shutil
import subprocess
import time
import uuid
@@ -416,6 +417,7 @@ class DockerEnv(Env[DockerConf]):
"""
Unzip a file into a folder, use zipfile instead of subprocess
"""
shutil.rmtree(folder_path, ignore_errors=True)
with zipfile.ZipFile(zip_file_path, "r") as z:
z.extractall(folder_path)