@@ -94,6 +94,7 @@ def run_codeflash_command(
9494
9595 output = []
9696 for line in process .stdout :
97+ line = line .strip ().encode ("utf-8" ).decode ("utf-8" )
9798 logging .info (line .strip ())
9899 output .append (line )
99100
@@ -122,7 +123,7 @@ def build_command(
122123) -> list [str ]:
123124 python_path = "../../../codeflash/main.py" if "code_directories" in str (cwd ) else "../codeflash/main.py"
124125
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" ]
126127
127128 if config .function_name :
128129 base_command .extend (["--function" , config .function_name ])
@@ -187,13 +188,14 @@ def validate_stdout_in_candidate(stdout: str, expected_in_stdout: list[str]) ->
187188def run_trace_test (cwd : pathlib .Path , config : TestConfig , expected_improvement_pct : int ) -> bool :
188189 test_root = cwd / "tests" / (config .test_framework or "" )
189190 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" ]
191192 process = subprocess .Popen (
192193 command , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True , cwd = str (cwd ), env = os .environ .copy ()
193194 )
194195
195196 output = []
196197 for line in process .stdout :
198+ line = line .strip ().encode ("utf-8" ).decode ("utf-8" )
197199 logging .info (line .strip ())
198200 output .append (line )
199201
0 commit comments