From e3416abeb9538ec0a8f351cbe8d41013cc7b9e35 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Sat, 7 Sep 2019 20:20:31 +0100 Subject: [PATCH] Use virtual environment for testing on MacOS X --- cibuildwheel/macos.py | 7 +++++++ 1 file changed, 7 insertions(+) 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)