From 9f72505effdf7f19429ef1ac3015263662095884 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 3 Aug 2018 13:10:18 -0400 Subject: [PATCH] Fix benchmarks --- benchmark/benchmark.py | 14 ++++++++------ tools/buildall | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index e3abc0659..64d535da8 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -1,11 +1,13 @@ import json -import os from pathlib import Path import re import subprocess import sys -sys.path.insert(0, (Path(__file__).parent.parent / 'test').resolve()) +sys.path.insert( + 0, str((Path(__file__).resolve().parent.parent / 'test'))) + +print(sys.path) import conftest @@ -16,10 +18,10 @@ SKIP = set(['fft', 'hyantes']) def run_native(hostpython, code): output = subprocess.check_output( [hostpython.resolve(), '-c', code], - cwd=os.path.dirname(__file__), + cwd=Path(__file__).resolve().parent, env={ 'PYTHONPATH': - str((Path(__file__).parent.parent / 'src').resolve()) + str(Path(__file__).resolve().parent.parent / 'src') } ) return float(output.strip().split()[-1]) @@ -79,7 +81,7 @@ def get_numpy_benchmarks(): name = filename.name if name in SKIP: continue - content = parse_numpy_benchmark(root / filename) + content = parse_numpy_benchmark(filename) content += ( "import numpy as np\n" "_ = np.empty(())\n" @@ -105,6 +107,6 @@ def main(hostpython): if __name__ == '__main__': - results = main(sys.argv[-2]) + results = main(Path(sys.argv[-2]).resolve()) with open(sys.argv[-1], 'w') as fp: json.dump(results, fp) diff --git a/tools/buildall b/tools/buildall index d4be22ce9..726c6c4b4 100755 --- a/tools/buildall +++ b/tools/buildall @@ -35,7 +35,6 @@ def build_packages(packagesdir, outputdir): # so first load in all of the package metadata and build a dependency map. dependencies = {} for pkgdir in packagesdir.iterdir(): - pkgdir = packagesdir / pkgdir pkgpath = pkgdir / 'meta.yaml' if pkgdir.is_dir() and pkgpath.is_file(): pkg = common.parse_package(pkgpath)