Uncap virtualenv

New virtualenv has changed behavior and cli arguments. In particular the
seed packages are by default installed in a common lib location and not
updated. These packages are then symlinked to in the virtualenv. This
causes problems for zuul when we run ansible in bwrap and that common
lib path isn't bind mounted in the container.

We can fix this by telling virtualenv to install the seed packages uses
pip and not its internal bundled app data. This is preferable for Zuul
because then we don't have to manage permissions and locations of a
separate seed package library location.

Note that we force virtualenv to be >=20.0.0 as old virtualenv does not
have this new seeder option.

Change-Id: Ib9b2e0b51e6acd744d1c23b4a27067f0202a679d
This commit is contained in:
Tobias Henkel 2020-02-10 16:01:02 +01:00 committed by Clark Boylan
parent ca9504b2d7
commit b6166bf81e
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
pbr>=1.1.0
# virtualenv 20.0.0 has no pkg_resources
virtualenv<20.0.0
# Newer virtualenv has different behavior and arguments
virtualenv>=20.0.0
github3.py>=1.1.0
PyYAML>=3.1.0

View File

@ -94,7 +94,7 @@ class ManagedAnsible:
# We don't use directly the venv module here because its behavior is
# broken if we're already in a virtual environment.
cmd = [sys.executable, '-m', 'virtualenv',
'-p', python_executable, venv_path]
'-p', python_executable, '--seeder=pip', venv_path]
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if p.returncode != 0: