Created
December 5, 2015 23:21
-
-
Save pv/62a57c7dfb1db8eb04e4 to your computer and use it in GitHub Desktop.
runtest asv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/runtests.py b/runtests.py | |
| index 9376ae5..dfe2534 100755 | |
| --- a/runtests.py | |
| +++ b/runtests.py | |
| @@ -197,10 +197,19 @@ def main(argv): | |
| bench_args.extend(['--bench', a]) | |
| if not args.bench_compare: | |
| + # Above, we built numpy using the current sys.executable, so we | |
| + # need also to run asv using it. | |
| + import pkg_resources | |
| cmd = ['asv', 'run', '-n', '-e', '--python=same'] + bench_args | |
| os.chdir(os.path.join(ROOT_DIR, 'benchmarks')) | |
| - os.execvp(cmd[0], cmd) | |
| - sys.exit(1) | |
| + try: | |
| + sys.argv = cmd | |
| + sys.exit(pkg_resources.load_entry_point('asv', 'console_scripts', 'asv')()) | |
| + except pkg_resources.ResolutionError: | |
| + # Fallback: asv wasn't installed for this Python version, try to | |
| + # run as a command... | |
| + os.execvp(cmd[0], cmd) | |
| + sys.exit(1) | |
| else: | |
| commits = [x.strip() for x in args.bench_compare.split(',')] | |
| if len(commits) == 1: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment