Create virtualenv with '--never-download'

For upgrades, and some new build configurations, trying to
create a new venv results in the error:

Could not get output from /usr/bin/virtualenv --help: Traceback (most recent call last):
File "/usr/bin/virtualenv", line 6, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

To work around this issue, we do the initial build of the
venv using the CLI with the argument '--never-download'
so that virtualenv just uses the versions of pip, setuptools
and wheel that it already has.

Change-Id: I639bc78d34b640a52c32fa175b12fa958518e999
This commit is contained in:
Jesse Pretorius 2018-08-09 08:54:24 +01:00
parent 968ea1f223
commit 46ae829b33
1 changed files with 5 additions and 0 deletions

View File

@ -77,6 +77,11 @@
- "/usr/local/lib/python2.7/site-packages"
register: _virtualenv_support
- name: Create the virtualenv (if it does not exist)
command: "virtualenv --never-download --no-site-packages {{ repo_pypiserver_bin | dirname }}"
args:
creates: "{{ repo_pypiserver_bin }}/activate"
# Note(odyssey4me):
# To cater for a situation where the pip packages are changing, but the repo
# does not yet have the package built, we need to ensure that this task can