-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DEV: Pass additional runtests.py args to ASV #15990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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_args plus 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 1
runtests.py
--bench-compare master -- --cpu-affinity 1
runtests.py
--bench sin --cpu-affinity 1
runtests.py
--bench -- --cpu-affinity 1