Browse Source

Simplify virtualenv install and execution

virtualenv==20.0.0 introduced new symlinking of "seed" packages that
broke within a bwrap context. We fixed this by forcing those seed
packages to be installed by pip avoiding any symlinking. Since then
upstream virtualenv has realize this was bad default behavior and
virtualenv==20.0.2 does not symlink by default.

Take advantage of this and exclude 20.0.0 and 20.0.1 as they need
special handling. This allows other versions (new and old) to function.

Change-Id: I3b993e72b52e2234e046a657280b008887c535a3
tags/3.16.1^0
Clark Boylan 7 months ago
parent
commit
7c6503aba0
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      requirements.txt
  2. +1
    -1
      zuul/lib/ansible.py

+ 2
- 2
requirements.txt View File

@@ -1,6 +1,6 @@
pbr>=1.1.0
# Newer virtualenv has different behavior and arguments
virtualenv>=20.0.0
# Early virtualenv 20 had bad file location assumptions
virtualenv!=20.0.0,!=20.0.1

github3.py>=1.1.0
PyYAML>=3.1.0


+ 1
- 1
zuul/lib/ansible.py 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, '--seeder=pip', venv_path]
'-p', python_executable, venv_path]
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

if p.returncode != 0:


Loading…
Cancel
Save