diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-10-01 17:16:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-01 17:16:06 -0500 |
commit | c8408bf9c094dfc89177d1831c60cb5fee94050f (patch) | |
tree | 5794191785ef7ba342234da30169d679bd24a347 /runtests.py | |
parent | 5d914da9846159c1863f926bedacb97b08f8bda3 (diff) | |
parent | 0c284e39681ed4b47970196e8dc774e0aae94983 (diff) | |
download | python-numpy-c8408bf9c094dfc89177d1831c60cb5fee94050f.tar.gz python-numpy-c8408bf9c094dfc89177d1831c60cb5fee94050f.tar.bz2 python-numpy-c8408bf9c094dfc89177d1831c60cb5fee94050f.zip |
Merge pull request #8027 from rainwoodman/patch-2
ENH: Add platform indepedent lib dir to PYTHONPATH
Diffstat (limited to 'runtests.py')
-rwxr-xr-x | runtests.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/runtests.py b/runtests.py index 0fc441293..966781302 100755 --- a/runtests.py +++ b/runtests.py @@ -138,9 +138,11 @@ def main(argv): "version; remove -g flag ***") if not args.no_build: - site_dir = build_project(args) + # we need the noarch path in case the package is pure python. + 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 +361,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 +407,7 @@ def build_project(args): print("Build failed!") sys.exit(1) - return site_dir + return site_dir, site_dir_noarch # |