Revert "Bump up the virtualenv MIN version to 20.0"
This reverts commit f4d7e0ef4fab786dd4e47388f86a417266b94d43.
Reason for revert: Causing CQ failures like https://ci.chromium.org/p/chromeos/builders/cq/chromite-cq/b8871051375801833968?
Original change's description:
> Bump up the virtualenv MIN version to 20.0
>
> Change-Id: I28c29f9b6d5700918da713a61b26224aa8dbf641
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra_virtualenv/+/2278038
> Reviewed-by: Prathmesh Prabhu <pprabhu@google.com>
> Commit-Queue: Prathmesh Prabhu <pprabhu@google.com>
> Commit-Queue: Ned Nguyen <nednguyen@google.com>
> Tested-by: Prathmesh Prabhu <pprabhu@google.com>
> Tested-by: Ned Nguyen <nednguyen@google.com>
Change-Id: I053c7a91421dfc946e71683b1185d6519e69be4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra_virtualenv/+/2373362
Reviewed-by: Prathmesh Prabhu <pprabhu@google.com>
Tested-by: Prathmesh Prabhu <pprabhu@google.com>
Tested-by: Ned Nguyen <nednguyen@google.com>
Commit-Queue: Prathmesh Prabhu <pprabhu@google.com>
diff --git a/venv/cros_venv/venvlib.py b/venv/cros_venv/venvlib.py
index a3f8c78..cda555f 100644
--- a/venv/cros_venv/venvlib.py
+++ b/venv/cros_venv/venvlib.py
@@ -255,11 +255,16 @@
def _create_venv(venvdir, logfile):
"""Create a virtualenv at the given path."""
ver = _virtualenv_version()
- MIN_VER = (20, 0)
+ MIN_VER = (1, 10)
assert ver >= MIN_VER, ('virtualenv %s is required, but %s was found' %
- (MIN_VER, ver))
+ (ver, MIN_VER))
env = os.environ.copy()
+ if ver < (20, 0):
+ # TODO(crbug.com/808434): upstream virtualenv has a bug when this is
+ # set. See also https://github.com/pypa/virtualenv/issues/565
+ env.pop('VIRTUALENV_ALWAYS_COPY', None)
+
command = [_VIRTUALENV_COMMAND, venvdir, '-p', sys.executable,
'--extra-search-dir', _PACKAGE_DIR, '--clear',
'--never-download', '-vvvvv']