From 281caf3d2e00ce24799dca99d437751e60b8ebaa Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 2 Mar 2020 14:54:48 +0100 Subject: [PATCH] bugfix for pypy --- cibuildwheel/windows.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 63565018..0877a603 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -188,25 +188,20 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef if test_command: # set up a virtual environment to install and test from, to make sure # there are no dependencies that were pulled in at build time. - shell(['pip', 'install', '"virtualenv<20"'], env=env) + shell(['pip', 'install', 'virtualenv'], env=env) venv_dir = tempfile.mkdtemp() shell(['python', '-m', 'virtualenv', venv_dir], env=env) virtualenv_env = env.copy() - if os.path.exists(os.path.join(venv_dir, 'Scripts')): - virtualenv_env['PATH'] = os.pathsep.join([ - os.path.join(venv_dir, 'Scripts'), - virtualenv_env['PATH'], - ]) - elif os.path.exists(os.path.join(venv_dir, 'bin')): + + venv_script_path = os.path.join(venv_dir, 'Scripts') + if os.path.exists(os.path.join(venv_dir, 'bin')): # pypy2.7 bugfix - virtualenv_env['PATH'] = os.pathsep.join([ - os.path.join(venv_dir, 'bin'), - virtualenv_env['PATH'], - ]) - else: - print("Fail to create virtualenv", file=sys.stderr) - sys.exit(2) + venv_script_path = os.pathsep.join([venv_script_path, os.path.join(venv_dir, 'bin')]) + virtualenv_env['PATH'] = os.pathsep.join([ + venv_script_path, + virtualenv_env['PATH'], + ]) virtualenv_env["__CIBW_VIRTUALENV_PATH__"] = venv_dir # check that we are using the Python from the virtual environment