Browse Source

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
Jesse Pretorius 8 months ago
parent
commit
46ae829b33
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      tasks/repo_install.yml

+ 5
- 0
tasks/repo_install.yml View File

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

Loading…
Cancel
Save