diff options
author | Yu Feng <rainwoodman@gmail.com> | 2016-09-06 16:10:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 16:10:11 -0700 |
commit | b031be79929e53553eaebc0aaa0c7446de5d66fc (patch) | |
tree | 8be8d044f9e83c82951e7d8c90958505777239d5 | |
parent | 96025b94ba3e7e38188de2bc224cde8df2ef5476 (diff) | |
download | numpy-b031be79929e53553eaebc0aaa0c7446de5d66fc.tar.gz |
add platform indepedent lib dir to PYTHONPATH
This allows using runtests.py with pure python packages.
I doodled the change based on my local version, so we shall wait and see if travis chokes up.
-rwxr-xr-x | runtests.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/runtests.py b/runtests.py index 7be76e46d..b1931f2be 100755 --- a/runtests.py +++ b/runtests.py @@ -138,9 +138,10 @@ def main(argv): "version; remove -g flag ***") if not args.no_build: - site_dir = build_project(args) + site_dir, site_dir_noarch = build_project(args) sys.path.insert(0, site_dir) - os.environ['PYTHONPATH'] = site_dir + sys.path.insert(0, site_dir_noarch) + os.environ['PYTHONPATH'] = site_dir + ':' + site_dir_noarch extra_argv = args.args[:] if extra_argv and extra_argv[0] == '--': @@ -359,11 +360,14 @@ def build_project(args): from distutils.sysconfig import get_python_lib site_dir = get_python_lib(prefix=dst_dir, plat_specific=True) + site_dir_noarch = get_python_lib(prefix=dst_dir, plat_specific=False) # easy_install won't install to a path that Python by default cannot see # and isn't on the PYTHONPATH. Plus, it has to exist. if not os.path.exists(site_dir): os.makedirs(site_dir) - env['PYTHONPATH'] = site_dir + if not os.path.exists(site_dir_noarch): + os.makedirs(site_dir_noarch) + env['PYTHONPATH'] = site_dir + ':' + site_dir_noarch log_filename = os.path.join(ROOT_DIR, 'build.log') @@ -402,7 +406,7 @@ def build_project(args): print("Build failed!") sys.exit(1) - return site_dir + return site_dir, site_dir_noarch # |