Skip to content

Commit 665f080

Browse files
committed
MAINT: update runtests.py for annoying easy_install behavior.
1 parent 5bb1d44 commit 665f080

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

runtests.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,18 @@ def build_project(args):
348348
cmd += ['build']
349349
if args.parallel > 1:
350350
cmd += ['-j', str(args.parallel)]
351-
cmd += ['install', '--prefix=' + dst_dir]
351+
# Install; avoid producing eggs so scipy can be imported from dst_dir.
352+
cmd += ['install', '--prefix=' + dst_dir,
353+
'--single-version-externally-managed',
354+
'--record=' + dst_dir + 'tmp_install_log.txt']
355+
356+
from distutils.sysconfig import get_python_lib
357+
site_dir = get_python_lib(prefix=dst_dir, plat_specific=True)
358+
# easy_install won't install to a path that Python by default cannot see
359+
# and isn't on the PYTHONPATH. Plus, it has to exist.
360+
if not os.path.exists(site_dir):
361+
os.makedirs(site_dir)
362+
env['PYTHONPATH'] = site_dir
352363

353364
log_filename = os.path.join(ROOT_DIR, 'build.log')
354365

@@ -391,9 +402,6 @@ def build_project(args):
391402
print("Build failed!")
392403
sys.exit(1)
393404

394-
from distutils.sysconfig import get_python_lib
395-
site_dir = get_python_lib(prefix=dst_dir, plat_specific=True)
396-
397405
return site_dir
398406

399407

@@ -429,8 +437,8 @@ def lcov_generate():
429437
'--output-file', LCOV_OUTPUT_FILE])
430438

431439
print("Generating lcov HTML output...")
432-
ret = subprocess.call(['genhtml', '-q', LCOV_OUTPUT_FILE,
433-
'--output-directory', LCOV_HTML_DIR,
440+
ret = subprocess.call(['genhtml', '-q', LCOV_OUTPUT_FILE,
441+
'--output-directory', LCOV_HTML_DIR,
434442
'--legend', '--highlight'])
435443
if ret != 0:
436444
print("genhtml failed!")

0 commit comments

Comments
 (0)