3333
3434
3535def main (args : Namespace | None = None ) -> ArgumentParser :
36- start = time .time ()
3736 parser = ArgumentParser (allow_abbrev = False )
3837 parser .add_argument ("-o" , "--outfile" , dest = "outfile" , help = "Save trace to <outfile>" , default = "codeflash.trace" )
3938 parser .add_argument ("--only-functions" , help = "Trace only these functions" , nargs = "+" , default = None )
@@ -106,25 +105,22 @@ def main(args: Namespace | None = None) -> ArgumentParser:
106105 replay_test_paths = []
107106 if parsed_args .module and unknown_args [0 ] == "pytest" :
108107 pytest_splits , test_paths = pytest_split (unknown_args [1 :])
109- print (pytest_splits )
110108
111109 if len (pytest_splits ) > 1 :
112110 processes = []
113111 test_paths_set = set (test_paths )
114112 result_pickle_file_paths = []
115113 for i , test_split in enumerate (pytest_splits , start = 1 ):
116- result_pickle_file_path = get_run_tmp_file (f"tracer_results_file_{ i } .pkl" )
114+ result_pickle_file_path = get_run_tmp_file (Path ( f"tracer_results_file_{ i } .pkl" ) )
117115 result_pickle_file_paths .append (result_pickle_file_path )
118116 args_dict ["result_pickle_file_path" ] = str (result_pickle_file_path )
119117 outpath = parsed_args .outfile
120118 outpath = outpath .parent / f"{ outpath .stem } _{ i } { outpath .suffix } "
121119 args_dict ["output" ] = str (outpath )
122- added_paths = False
123120 updated_sys_argv = []
124121 for elem in sys .argv :
125122 if elem in test_paths_set :
126- if not added_paths :
127- updated_sys_argv .extend (test_split )
123+ updated_sys_argv .extend (test_split )
128124 else :
129125 updated_sys_argv .append (elem )
130126 args_dict ["command" ] = " " .join (updated_sys_argv )
@@ -152,7 +148,7 @@ def main(args: Namespace | None = None) -> ArgumentParser:
152148 finally :
153149 result_pickle_file_path .unlink (missing_ok = True )
154150 else :
155- result_pickle_file_path = get_run_tmp_file ("tracer_results_file.pkl" )
151+ result_pickle_file_path = get_run_tmp_file (Path ( "tracer_results_file.pkl" ) )
156152 args_dict ["result_pickle_file_path" ] = str (result_pickle_file_path )
157153 args_dict ["output" ] = str (parsed_args .outfile )
158154 args_dict ["command" ] = " " .join (sys .argv )
@@ -176,7 +172,6 @@ def main(args: Namespace | None = None) -> ArgumentParser:
176172 sys .exit (1 )
177173 finally :
178174 result_pickle_file_path .unlink (missing_ok = True )
179- print (f"Took { time .time () - start } " )
180175 if not parsed_args .trace_only and replay_test_paths :
181176 from codeflash .cli_cmds .cli import parse_args , process_pyproject_config
182177 from codeflash .cli_cmds .cmd_init import CODEFLASH_LOGO
@@ -185,7 +180,6 @@ def main(args: Namespace | None = None) -> ArgumentParser:
185180 from codeflash .telemetry .sentry import init_sentry
186181
187182 sys .argv = ["codeflash" , "--replay-test" , * replay_test_paths ]
188- print (sys .argv )
189183 args = parse_args ()
190184 paneled_text (
191185 CODEFLASH_LOGO ,
0 commit comments