diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index adfc27f4..ceef69ad 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -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)