@@ -94,6 +94,7 @@ def run_codeflash_command(
94
94
95
95
output = []
96
96
for line in process .stdout :
97
+ line = line .strip ().encode ("utf-8" ).decode ("utf-8" )
97
98
logging .info (line .strip ())
98
99
output .append (line )
99
100
@@ -122,7 +123,7 @@ def build_command(
122
123
) -> list [str ]:
123
124
python_path = "../../../codeflash/main.py" if "code_directories" in str (cwd ) else "../codeflash/main.py"
124
125
125
- base_command = ["python" , python_path , "--file" , config .file_path , "--no-pr" ]
126
+ base_command = ["uv" , "run" , "--no-project" , python_path , "--file" , config .file_path , "--no-pr" ]
126
127
127
128
if config .function_name :
128
129
base_command .extend (["--function" , config .function_name ])
@@ -187,13 +188,14 @@ def validate_stdout_in_candidate(stdout: str, expected_in_stdout: list[str]) ->
187
188
def run_trace_test (cwd : pathlib .Path , config : TestConfig , expected_improvement_pct : int ) -> bool :
188
189
test_root = cwd / "tests" / (config .test_framework or "" )
189
190
clear_directory (test_root )
190
- command = ["python " , "-m" , "codeflash.main" , "optimize" , "workload.py" ]
191
+ command = ["uv" , "run" , "--no-project " , "-m" , "codeflash.main" , "optimize" , "workload.py" ]
191
192
process = subprocess .Popen (
192
193
command , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True , cwd = str (cwd ), env = os .environ .copy ()
193
194
)
194
195
195
196
output = []
196
197
for line in process .stdout :
198
+ line = line .strip ().encode ("utf-8" ).decode ("utf-8" )
197
199
logging .info (line .strip ())
198
200
output .append (line )
199
201
0 commit comments