Minor fixups from pull request

This commit is contained in:
Michael Droettboom 2018-08-06 10:01:28 -04:00
parent 9f72505eff
commit fa23049e0c
5 changed files with 10 additions and 12 deletions

View File

@ -5,9 +5,7 @@ import subprocess
import sys import sys
sys.path.insert( sys.path.insert(
0, str((Path(__file__).resolve().parent.parent / 'test'))) 0, str((Path(__file__).resolve().parents[1] / 'test')))
print(sys.path)
import conftest import conftest
@ -21,7 +19,7 @@ def run_native(hostpython, code):
cwd=Path(__file__).resolve().parent, cwd=Path(__file__).resolve().parent,
env={ env={
'PYTHONPATH': 'PYTHONPATH':
str(Path(__file__).resolve().parent.parent / 'src') str(Path(__file__).resolve().parents[1] / 'src')
} }
) )
return float(output.strip().split()[-1]) return float(output.strip().split()[-1])

View File

@ -20,7 +20,7 @@ for root, dirs, files in os.walk(
for filename in files: for filename in files:
filename = Path(filename) filename = Path(filename)
if str(filename).startswith("test_") and filename.suffix == ".py": if str(filename).startswith("test_") and filename.suffix == ".py":
tests.append(root / filename.stem) tests.append(str(root / filename.stem))
tests.sort() tests.sort()
with open("python_tests.txt", "w") as fp: with open("python_tests.txt", "w") as fp:

View File

@ -295,7 +295,7 @@ def pytest_generate_tests(metafunc):
test_modules = [] test_modules = []
if 'CIRCLECI' not in os.environ or True: if 'CIRCLECI' not in os.environ or True:
with open( with open(
Path(__file__).parents[0] / "python_tests.txt") as fp: Path(__file__).parent / "python_tests.txt") as fp:
for line in fp: for line in fp:
line = line.strip() line = line.strip()
if line.startswith('#'): if line.startswith('#'):

View File

@ -14,11 +14,11 @@ import common
import buildpkg import buildpkg
def build_package(pkgname, dependencies, packagesdir, outputdir): def build_package(pkgname, dependencies, packagesdir, outputdir, args):
reqs = dependencies[pkgname] reqs = dependencies[pkgname]
# Make sure all of the package's requirements are built first # Make sure all of the package's requirements are built first
for req in reqs: 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(): if not (packagesdir / pkgname / 'build' / '.packaged').is_file():
print("BUILDING PACKAGE: " + pkgname) print("BUILDING PACKAGE: " + pkgname)
buildpkg.build_package(packagesdir / pkgname / 'meta.yaml', args) buildpkg.build_package(packagesdir / pkgname / 'meta.yaml', args)
@ -30,7 +30,7 @@ def build_package(pkgname, dependencies, packagesdir, outputdir):
outputdir / (pkgname + '.js')) 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), # 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. # so first load in all of the package metadata and build a dependency map.
dependencies = {} dependencies = {}
@ -43,7 +43,7 @@ def build_packages(packagesdir, outputdir):
dependencies[name] = reqs dependencies[name] = reqs
for pkgname in dependencies.keys(): 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 # This is done last so the main Makefile can use it as a completion token
with open(outputdir / 'packages.json', 'w') as fd: with open(outputdir / 'packages.json', 'w') as fd:
@ -77,7 +77,7 @@ def parse_args():
def main(args): def main(args):
packagesdir = Path(args.dir[0]).resolve() packagesdir = Path(args.dir[0]).resolve()
outputdir = Path(args.output[0]).resolve() outputdir = Path(args.output[0]).resolve()
build_packages(packagesdir, outputdir) build_packages(packagesdir, outputdir, args)
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -3,7 +3,7 @@ from pathlib import Path
ROOTDIR = Path(__file__).parent.resolve() ROOTDIR = Path(__file__).parent.resolve()
HOSTPYTHON = ROOTDIR / '..' / 'cpython' / 'build' / '3.6.4' / 'host' 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 = '' DEFAULTCFLAGS = ''
DEFAULTLDFLAGS = ' '.join([ DEFAULTLDFLAGS = ' '.join([
'-O3', '-O3',