diff --git a/diskimage_builder/elements/pip-and-virtualenv/README.rst b/diskimage_builder/elements/pip-and-virtualenv/README.rst index 5217f62f..bf79ff2f 100644 --- a/diskimage_builder/elements/pip-and-virtualenv/README.rst +++ b/diskimage_builder/elements/pip-and-virtualenv/README.rst @@ -47,6 +47,9 @@ The system will be left in the following state: (note python3 ``virtualenv`` script is *not* installed, see below) +Source install is supported on limited platforms. See the code, but +this includes Ubuntu and RedHat platforms. + Using the tools =============== diff --git a/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip b/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip index 932c8031..1f368b2d 100755 --- a/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip +++ b/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip @@ -101,15 +101,28 @@ EOF echo "exclude=$packages" >> ${conf} fi else - # pre-install packages, we will overwrite with latest below - apt-get -y install python-pip python3-pip \ - python-virtualenv python3-virtualenv + # pre-install packages so depedencies are there. We will + # overwrite with latest below. + packages="python-pip python3-pip python-virtualenv" + # unfortunately older ubuntu (trusty) doesn't have a + # python3-virtualenv package -- it seems it wasn't ready at the + # time and you had to use "python -m venv". Since then virtualenv + # has gained 3.4 support so the pip install below will work + if [[ ${DIB_PYTHON_VERSION} == 3 ]]; then + packages+=" python3-virtualenv" + fi + + apt-get -y install $packages + + # force things to happen so our assumptions hold + pip_args="-U --force-reinstall" # These install into /usr/local/bin so override any packages, even # if installed later. - python3 /tmp/get-pip.py - python2 /tmp/get-pip.py - pip3 install virtualenv - pip install virtualenv + python3 /tmp/get-pip.py $pip_args + python2 /tmp/get-pip.py $pip_args + + pip3 install $pip_args virtualenv + pip install $pip_args virtualenv fi