DEV: Pass additional runtests.py args to ASV #15990
Conversation
|
Seems like this can be useful on its own, although I wonder if fixing diff --git a/runtests.py b/runtests.py
index e470f8a9d..2d9a0f39d 100755
--- a/runtests.py
+++ b/runtests.py
@@ -220,7 +220,14 @@ def main(argv):
if args.bench:
# Run ASV
- items = extra_argv
+ if "--" in extra_argv:
+ split = extra_argv.index("--")
+ items = extra_argv[:split]
+ extra_argv = extra_argv[split+1:]
+ else:
+ items = extra_argv
+ extra_argv = []
+
if args.tests:
items += args.tests
if args.submodule:
@@ -229,6 +236,7 @@ def main(argv):
bench_args = []
for a in items:
bench_args.extend(['--bench', a])
+ bench_args.extend(extra_argv)
if not args.bench_compare:
cmd = ['asv', 'run', '-n', '-e', '--python=same'] + bench_argsplus maybe as an example in the initial help (it also doesn't list asv for |
|
@seiko2plus if you think changing the script to pass |
f4c3b22 to
b3fccc8
Compare
-- to ASV
-- to ASV|
@seberg, alright I modified the patch with your proposal, it's more practical I guess. thank u!. |
|
@seiko2plus sorry, since this is a dev thing, I think we should just do it. I pushed a commit to make things work with |
|
@seberg, your changes make it more robust since it allows passing all tokens after |
|
For everyone else, since this only affects devlopment, and even then only the EDIT: With that print removed obviously. |
Since arguments list benchmarks, all arguments after the first
unknown `--` starting (removing a single first `--`) are passed
on to asv. Previously this was the right pattern for passing
to pytest, so it now works also for ASV.
Examples:
`runtests.py` `--bench-compare master sin --cpu-affinity 1`
`--bench-compare master -- --cpu-affinity 1`
`--bench sin --cpu-affinity 1`
`--bench -- --cpu-affinity 1`
|
@seberg, thank you |
Pass all extra arguments that start with
--to ASVExamples:
runtests.py--bench-compare master sin --cpu-affinity 1runtests.py--bench-compare master -- --cpu-affinity 1runtests.py--bench sin --cpu-affinity 1runtests.py--bench -- --cpu-affinity 1