Use virtual environment for testing on MacOS X

This commit is contained in:
Thomas Robitaille
2019-09-10 09:40:18 +01:00
parent 2ab2d079ab
commit e3416abeb9
+7
View File
@@ -1,4 +1,5 @@
from __future__ import print_function
import tempfile
import os, subprocess, shlex, sys, shutil
from collections import namedtuple
from glob import glob
@@ -120,6 +121,12 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef
call(['delocate-wheel', '-w', '/tmp/delocated_wheel', built_wheel], env=env)
delocated_wheel = glob('/tmp/delocated_wheel/*.whl')[0]
# set up a virtual environment to install and test from
call(['pip', 'install', 'virtualenv', env=env)
venv_dir = tempfile.mkdtemp()
call(['virtualenv', venv_dir, env=env)
call(['source', os.path.join(venv_dir, 'bin', 'activate')])
# install the wheel
call(['pip', 'install', delocated_wheel + test_extras], env=env)