From 5187633e266d994a59389fc5ae05e2646ac1650e Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Tue, 18 Feb 2020 22:03:14 +0000 Subject: [PATCH] Add the --no-download flag to virtualenv, to prevent it getting the latest version of pip, setuptools, wheel from PyPI on creation. Virtualenv will use bundled version of those tools instead --- cibuildwheel/linux.py | 2 +- cibuildwheel/macos.py | 2 +- cibuildwheel/windows.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 09642734..e31e00ca 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -121,7 +121,7 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef # there are no dependencies that were pulled in at build time. pip install {dependency_install_flags} virtualenv venv_dir=`mktemp -d`/venv - python -m virtualenv "$venv_dir" + python -m virtualenv --no-download "$venv_dir" # run the tests in a subshell to keep that `activate` # script from polluting the env diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index f181921d..383f6453 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -140,7 +140,7 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef # there are no dependencies that were pulled in at build time. call(['pip', 'install', 'virtualenv'] + dependency_constraint_flags, env=env) venv_dir = tempfile.mkdtemp() - call(['python', '-m', 'virtualenv', venv_dir], env=env) + call(['python', '-m', 'virtualenv', '--no-download', venv_dir], env=env) virtualenv_env = env.copy() virtualenv_env['PATH'] = os.pathsep.join([ diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index b90c7e91..b62e7801 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -152,7 +152,7 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef # there are no dependencies that were pulled in at build time. shell(['pip', 'install', 'virtualenv'] + dependency_constraint_flags, env=env) venv_dir = tempfile.mkdtemp() - shell(['python', '-m', 'virtualenv', venv_dir], env=env) + shell(['python', '-m', 'virtualenv', '--no-download', venv_dir], env=env) virtualenv_env = env.copy() virtualenv_env['PATH'] = os.pathsep.join([