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 f5ab79ee..09b49d8b 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 @@ -122,7 +122,10 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then fi # install the latest python2 pip; this overwrites packaged pip + # NOTE(dpawlik) The get-pip.py script is not base on master release. + # Ensure that is uses latest available version. python /tmp/get-pip.py ${pip_args} + python -m pip install ${pip_args} pip # Install latest setuptools; there is a slight chicken-egg issue in # that pip requires setuptools for some operations like building a @@ -141,7 +144,10 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then # python2 would work -- alas get-pip.py doesn't seem to leave # python3 alone: # https://github.com/pypa/pip/issues/4435 + # NOTE(dpawlik) The get-pip.py script is not base on master release. + # Ensure that is uses latest available version. python3 /tmp/get-pip.py ${pip_args} + python3 -m pip install ${pip_args} pip pip3 install ${pip_args} setuptools # on < 27, this installed pip3 to /usr/bin/pip. On >=27 it's @@ -250,6 +256,11 @@ else python3 /tmp/get-pip.py $pip_args python2 /tmp/get-pip.py $pip_args + # NOTE(dpawlik) The get-pip.py script is not base on master release. + # Ensure that is uses latest available version. + python3 -m pip install $pip_args pip + python2 -m pip install $pip_args pip + pip3 install $pip_args virtualenv pip install $pip_args virtualenv fi diff --git a/diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv b/diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv index 6d25b4c2..e74aec4b 100644 --- a/diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv +++ b/diskimage_builder/elements/pip-and-virtualenv/source-repository-pip-and-virtualenv @@ -1 +1,4 @@ -pip-and-virtualenv file /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py +# NOTE(dpawlik) We set get-pip.py script to use 3.5 version, that is compatible +# with python2.7 and newer. It should be removed in the future, when Python 2 +# is dropped. +pip-and-virtualenv file /tmp/get-pip.py https://bootstrap.pypa.io/3.5/get-pip.py