From fa23049e0c7e1beec4edc2f5866949238d26153b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 6 Aug 2018 10:01:28 -0400 Subject: [PATCH] Minor fixups from pull request --- benchmark/benchmark.py | 6 ++---- test/make_test_list.py | 2 +- test/test_python.py | 2 +- tools/buildall | 10 +++++----- tools/common.py | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 64d535da8..a92ac31da 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -5,9 +5,7 @@ import subprocess import sys sys.path.insert( - 0, str((Path(__file__).resolve().parent.parent / 'test'))) - -print(sys.path) + 0, str((Path(__file__).resolve().parents[1] / 'test'))) import conftest @@ -21,7 +19,7 @@ def run_native(hostpython, code): cwd=Path(__file__).resolve().parent, env={ 'PYTHONPATH': - str(Path(__file__).resolve().parent.parent / 'src') + str(Path(__file__).resolve().parents[1] / 'src') } ) return float(output.strip().split()[-1]) diff --git a/test/make_test_list.py b/test/make_test_list.py index 5cd6b7d15..d77d59032 100644 --- a/test/make_test_list.py +++ b/test/make_test_list.py @@ -20,7 +20,7 @@ for root, dirs, files in os.walk( for filename in files: filename = Path(filename) if str(filename).startswith("test_") and filename.suffix == ".py": - tests.append(root / filename.stem) + tests.append(str(root / filename.stem)) tests.sort() with open("python_tests.txt", "w") as fp: diff --git a/test/test_python.py b/test/test_python.py index 11dcfe14b..9b5423b40 100644 --- a/test/test_python.py +++ b/test/test_python.py @@ -295,7 +295,7 @@ def pytest_generate_tests(metafunc): test_modules = [] if 'CIRCLECI' not in os.environ or True: with open( - Path(__file__).parents[0] / "python_tests.txt") as fp: + Path(__file__).parent / "python_tests.txt") as fp: for line in fp: line = line.strip() if line.startswith('#'): diff --git a/tools/buildall b/tools/buildall index 726c6c4b4..5866788b3 100755 --- a/tools/buildall +++ b/tools/buildall @@ -14,11 +14,11 @@ import common import buildpkg -def build_package(pkgname, dependencies, packagesdir, outputdir): +def build_package(pkgname, dependencies, packagesdir, outputdir, args): reqs = dependencies[pkgname] # Make sure all of the package's requirements are built first for req in reqs: - build_package(req, dependencies, packagesdir, outputdir) + build_package(req, dependencies, packagesdir, outputdir, args) if not (packagesdir / pkgname / 'build' / '.packaged').is_file(): print("BUILDING PACKAGE: " + pkgname) buildpkg.build_package(packagesdir / pkgname / 'meta.yaml', args) @@ -30,7 +30,7 @@ def build_package(pkgname, dependencies, packagesdir, outputdir): outputdir / (pkgname + '.js')) -def build_packages(packagesdir, outputdir): +def build_packages(packagesdir, outputdir, args): # We have to build the packages in the correct order (dependencies first), # so first load in all of the package metadata and build a dependency map. dependencies = {} @@ -43,7 +43,7 @@ def build_packages(packagesdir, outputdir): dependencies[name] = reqs for pkgname in dependencies.keys(): - build_package(pkgname, dependencies, packagesdir, outputdir) + build_package(pkgname, dependencies, packagesdir, outputdir, args) # This is done last so the main Makefile can use it as a completion token with open(outputdir / 'packages.json', 'w') as fd: @@ -77,7 +77,7 @@ def parse_args(): def main(args): packagesdir = Path(args.dir[0]).resolve() outputdir = Path(args.output[0]).resolve() - build_packages(packagesdir, outputdir) + build_packages(packagesdir, outputdir, args) if __name__ == '__main__': diff --git a/tools/common.py b/tools/common.py index 2552b42f4..477a91c73 100644 --- a/tools/common.py +++ b/tools/common.py @@ -3,7 +3,7 @@ from pathlib import Path ROOTDIR = Path(__file__).parent.resolve() HOSTPYTHON = ROOTDIR / '..' / 'cpython' / 'build' / '3.6.4' / 'host' -TARGETPYTHON = ROOTDIR / '..' / 'cpython' / 'installs', 'python-3.6.4' +TARGETPYTHON = ROOTDIR / '..' / 'cpython' / 'installs' / 'python-3.6.4' DEFAULTCFLAGS = '' DEFAULTLDFLAGS = ' '.join([ '-O3',