Merge "Stop using distro setuptools and easy_install"
This commit is contained in:
commit
7bbd56ba70
@ -13,23 +13,12 @@ if [ -x '/usr/bin/apt-get' ]; then
|
|||||||
if ! $(git --version &>/dev/null) ; then
|
if ! $(git --version &>/dev/null) ; then
|
||||||
sudo -H apt-get -y install git
|
sudo -H apt-get -y install git
|
||||||
fi
|
fi
|
||||||
# To install python packages, we need pip.
|
|
||||||
#
|
|
||||||
# We can't use the apt packaged version of pip since
|
|
||||||
# older versions of pip are incompatible with
|
|
||||||
# requests, one of our indirect dependencies (bug 1459947).
|
|
||||||
#
|
|
||||||
# So we use easy_install to install pip.
|
|
||||||
#
|
|
||||||
# But we may not have easy_install; if that's the case,
|
|
||||||
# our bootstrap's bootstrap is to use apt to install
|
|
||||||
# python-setuptools to get easy_install.
|
|
||||||
if ! $(easy_install --version &>/dev/null) ; then
|
|
||||||
sudo -H apt-get -y install python-setuptools
|
|
||||||
fi
|
|
||||||
if ! $(dpkg -l libpython-dev &>/dev/null); then
|
if ! $(dpkg -l libpython-dev &>/dev/null); then
|
||||||
sudo -H apt-get -y install libpython-dev
|
sudo -H apt-get -y install libpython-dev
|
||||||
fi
|
fi
|
||||||
|
if ! $(dpkg -l wget &>/dev/null); then
|
||||||
|
sudo -H apt-get -y install wget
|
||||||
|
fi
|
||||||
elif [ -x '/usr/bin/yum' ]; then
|
elif [ -x '/usr/bin/yum' ]; then
|
||||||
if ! yum -q list installed python-devel; then
|
if ! yum -q list installed python-devel; then
|
||||||
sudo -H yum -y install python-devel
|
sudo -H yum -y install python-devel
|
||||||
@ -40,13 +29,20 @@ elif [ -x '/usr/bin/yum' ]; then
|
|||||||
if ! $(git --version &>/dev/null); then
|
if ! $(git --version &>/dev/null); then
|
||||||
sudo -H yum -y install git
|
sudo -H yum -y install git
|
||||||
fi
|
fi
|
||||||
|
if ! $(wget --version &>/dev/null); then
|
||||||
|
sudo -H yum -y install wget
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: Supported package manager not found. Supported: apt,yum"
|
echo "ERROR: Supported package manager not found. Supported: apt,yum"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! $(pip -v &>/dev/null); then
|
# To install python packages, we need pip.
|
||||||
sudo easy_install pip
|
#
|
||||||
fi
|
# We can't use the apt packaged version of pip since
|
||||||
|
# older versions of pip are incompatible with
|
||||||
|
# requests, one of our indirect dependencies (bug 1459947).
|
||||||
|
wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
|
||||||
|
sudo python /tmp/get-pip.py
|
||||||
|
|
||||||
sudo -E pip install -r "$(dirname $0)/../requirements.txt"
|
sudo -E pip install -r "$(dirname $0)/../requirements.txt"
|
||||||
|
|
||||||
|
@ -15,10 +15,17 @@
|
|||||||
cache_valid_time=86400
|
cache_valid_time=86400
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
- name: Install easy_install
|
- name: Make sure distro setuptools is not there
|
||||||
apt: name=python-setuptools state=present
|
apt: name=python-setuptools state=absent
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
|
- name: Download get-pip
|
||||||
|
get_url: https://bootstrap.pypa.io/get-pip.py
|
||||||
|
dest: /tmp/get-pip.py
|
||||||
|
|
||||||
|
- name: Install pip
|
||||||
|
shell: python /tmp/get-pip.py
|
||||||
|
|
||||||
- name: Install python-dev
|
- name: Install python-dev
|
||||||
apt: name=python-dev state=present
|
apt: name=python-dev state=present
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user