diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-01-16 18:23:05 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-01-16 18:23:05 -0700 |
commit | ad4b5b03470a4ca2ef3150faa721a0e239b3c203 (patch) | |
tree | ff738e8df10aef9051956c3b0e1c17fe0bc85505 | |
parent | c2a925e8650405fe7a4de89efbc08fb6a32fd088 (diff) | |
parent | c4c4178c7c9e34c9a86992c649469d52447f28b9 (diff) | |
download | numpy-ad4b5b03470a4ca2ef3150faa721a0e239b3c203.tar.gz |
Merge pull request #7040 from rgommers/fix-runtests-setuptools
BLD: fix runtests.py, was broken by the move to setuptools.
-rw-r--r-- | doc/release/1.11.0-notes.rst | 11 | ||||
-rwxr-xr-x | runtests.py | 24 |
2 files changed, 25 insertions, 10 deletions
diff --git a/doc/release/1.11.0-notes.rst b/doc/release/1.11.0-notes.rst index c4ff89230..0305688d8 100644 --- a/doc/release/1.11.0-notes.rst +++ b/doc/release/1.11.0-notes.rst @@ -8,9 +8,14 @@ Highlights ========== -Dropped Support -=============== - +Build System Changes +==================== + +* Numpy now uses ``setuptools`` for its builds instead of plain distutils. + This fixes usage of ``install_requires='numpy'`` in the ``setup.py`` files of + projects that depend on Numpy (see gh-6551). It potentially affects the way + that build/install methods for Numpy itself behave though. Please report any + unexpected behavior on the Numpy issue tracker. * Bento build support and related files have been removed. * Single file build support and related files have been removed. diff --git a/runtests.py b/runtests.py index 957cbef10..52905a8fc 100755 --- a/runtests.py +++ b/runtests.py @@ -135,8 +135,13 @@ def main(argv): if not args.no_build: site_dir = build_project(args) - sys.path.insert(0, site_dir) - os.environ['PYTHONPATH'] = site_dir + for dirname in os.listdir(site_dir): + if dirname.startswith('numpy'): + # The .pth file isn't re-parsed, so need to put the numpy egg + # produced by easy-install on the path manually. + egg_dir = os.path.join(site_dir, dirname) + sys.path.insert(0, egg_dir) + os.environ['PYTHONPATH'] = egg_dir extra_argv = args.args[:] if extra_argv and extra_argv[0] == '--': @@ -346,6 +351,14 @@ def build_project(args): cmd += ["-j", str(args.parallel)] cmd += ['install', '--prefix=' + dst_dir] + from distutils.sysconfig import get_python_lib + site_dir = get_python_lib(prefix=dst_dir, plat_specific=True) + # 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 + log_filename = os.path.join(ROOT_DIR, 'build.log') if args.show_build_log: @@ -383,9 +396,6 @@ def build_project(args): print("Build failed!") sys.exit(1) - from distutils.sysconfig import get_python_lib - site_dir = get_python_lib(prefix=dst_dir, plat_specific=True) - return site_dir @@ -421,8 +431,8 @@ def lcov_generate(): '--output-file', LCOV_OUTPUT_FILE]) print("Generating lcov HTML output...") - ret = subprocess.call(['genhtml', '-q', LCOV_OUTPUT_FILE, - '--output-directory', LCOV_HTML_DIR, + ret = subprocess.call(['genhtml', '-q', LCOV_OUTPUT_FILE, + '--output-directory', LCOV_HTML_DIR, '--legend', '--highlight']) if ret != 0: print("genhtml failed!") |