@@ -22,7 +22,6 @@ class RunCommand(CLICommand):
2222 def __init__ (self ):
2323 super (RunCommand , self ).__init__ (name = "run" )
2424 self .config = PybmConfig .load ()
25- self .use_legacy_checkout : bool = self .config .get_value ("git.legacycheckout" )
2625
2726 def add_arguments (self ):
2827 self .parser .add_argument (
@@ -56,8 +55,8 @@ def add_arguments(self):
5655 action = "store_true" ,
5756 default = False ,
5857 help = "Run benchmarks in checkout mode in environment 'root'. Here, instead "
59- "of persisted git worktrees, different refs are benchmarked using "
60- "`git checkout` commands." ,
58+ "of persisted git worktrees, different refs are benchmarked using `git "
59+ "checkout` commands." ,
6160 )
6261 self .parser .add_argument (
6362 "--all" ,
@@ -73,14 +72,14 @@ def add_arguments(self):
7372 default = None ,
7473 dest = "source_ref" ,
7574 metavar = "<git-ref>" ,
76- help = "Source benchmark targets from a different git reference." ,
75+ help = "Source benchmark targets from a different git reference <git-ref> ." ,
7776 )
7877 self .parser .add_argument (
7978 "--repetitions" ,
8079 type = int ,
8180 default = 5 ,
8281 metavar = "<N>" ,
83- help = "Number of repetitions for the target benchmarks." ,
82+ help = "Number of times to repeat the target benchmarks." ,
8483 )
8584 self .parser .add_argument (
8685 "--filter" ,
@@ -98,8 +97,8 @@ def add_arguments(self):
9897 dest = "benchmark_context" ,
9998 metavar = "<context>" ,
10099 help = "Additional global context, given as strings in the format "
101- "--context='key'='value'. Keys must be unique. Supplying two or more "
102- "context values for the same key results in an error." ,
100+ "--context='key'='value'. Keys must be unique, supplying more than one "
101+ "value for the same key results in an error." ,
103102 )
104103
105104 runner : BaseRunner = get_component_class ("runner" , config = self .config )
@@ -128,18 +127,21 @@ def run(self, args: List[str]) -> int:
128127 runner : BaseRunner = get_component_class ("runner" , config = self .config )
129128 reporter : BaseReporter = get_component_class ("reporter" , config = self .config )
130129
130+ # whether to use legacy checkouts (git < 2.17)
131+ use_legacy_checkout : bool = self .config .get_value ("git.legacycheckout" )
132+
131133 verbose : bool = runner_options .pop ("verbose" )
132134
133135 env_ids : List [str ] = runner_options .pop ("environments" ) or []
134136 run_all : bool = runner_options .pop ("run_all" )
135137 checkout_mode : bool = runner_options .pop ("checkout" )
136138 source_ref : Optional [str ] = runner_options .pop ("source_ref" )
137139 source_path = Path (runner_options .pop ("benchmarks" ))
138- run_as_module = runner_options .pop ("run_as_module" )
140+ run_as_module : bool = runner_options .pop ("run_as_module" )
139141
140142 # runner dispatch arguments
141- repetitions = runner_options .pop ("repetitions" )
142- benchmark_filter = runner_options .pop ("benchmark_filter" )
143+ repetitions : int = runner_options .pop ("repetitions" )
144+ benchmark_filter : Optional [ str ] = runner_options .pop ("benchmark_filter" )
143145 benchmark_context = runner_options .pop ("benchmark_context" )
144146 # at this point, runner_options only include the additional runner kwargs
145147
@@ -198,7 +200,7 @@ def run(self, args: List[str]) -> int:
198200 worktree = worktree ,
199201 source_path = source_path ,
200202 source_ref = source_ref ,
201- use_legacy_checkout = self . use_legacy_checkout ,
203+ use_legacy_checkout = use_legacy_checkout ,
202204 ) as benchmark_targets :
203205 n = len (benchmark_targets )
204206 if n > 0 :
@@ -208,9 +210,9 @@ def run(self, args: List[str]) -> int:
208210 )
209211 else :
210212 msg = (
211- f"Benchmark selector { str (source_path )!r} did not "
212- f"match any directory or Python files for { ref_type } "
213- f"{ ref !r } in environment { environment .name !r} ."
213+ f"Benchmark selector { str (source_path )!r} did not match any "
214+ f"directory or Python files for { ref_type } { ref !r } in "
215+ f"environment { environment .name !r} ."
214216 )
215217
216218 if runner .fail_fast :
@@ -247,8 +249,8 @@ def run(self, args: List[str]) -> int:
247249 "benchmark subprocess. Please check that the configured "
248250 "benchmark runner actually writes the results to stdout."
249251 )
250- else :
251- reporter .write (ref , benchmark , data )
252+
253+ reporter .write (ref , benchmark , data )
252254
253255 if checkout_mode :
254256 root_ref , root_type = root_checkout
0 commit comments