From 3e777cd8f4e7237151f71637a0ef8230692b96ae Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Tue, 6 Dec 2016 13:51:13 -0800 Subject: [PATCH] Fix pip-and-virtualenv to work with python3 We are explicitly calling python in this element which does not work on systems which only have python3. Change-Id: Ia730850a48e2478fd5461710a9d2619408725cd8 --- elements/pip-and-virtualenv/element-deps | 1 + .../10-install-pip | 4 ++-- elements/pip-and-virtualenv/package-installs.yaml | 15 +++++++++++++++ elements/pip-and-virtualenv/pkg-map | 13 ++++++++++--- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/elements/pip-and-virtualenv/element-deps b/elements/pip-and-virtualenv/element-deps index ff8ad3ed..cb38be3c 100644 --- a/elements/pip-and-virtualenv/element-deps +++ b/elements/pip-and-virtualenv/element-deps @@ -1,3 +1,4 @@ +dib-python install-types package-installs source-repositories diff --git a/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/10-install-pip b/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/10-install-pip index 4efd1a21..704fa338 100755 --- a/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/10-install-pip +++ b/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/10-install-pip @@ -19,7 +19,7 @@ if [[ $DISTRO_NAME =~ (centos|fedora) ]]; then ${YUM:-yum} install -y python-virtualenv python-pip python-setuptools # install pip; this overwrites packaged pip - python /tmp/get-pip.py + /usr/local/bin/dib-python /tmp/get-pip.py # pip and setuptools are closely related; we want to ensure the # latest for sanity. Because distro packages don't include enough @@ -50,6 +50,6 @@ if [[ $DISTRO_NAME =~ (centos|fedora) ]]; then fi echo "exclude=python-virtualenv,python-pip,python-setuptools" >> ${conf} else - python /tmp/get-pip.py + /usr/local/bin/dib-python /tmp/get-pip.py pip install virtualenv fi diff --git a/elements/pip-and-virtualenv/package-installs.yaml b/elements/pip-and-virtualenv/package-installs.yaml index 6d38d160..6b62929c 100644 --- a/elements/pip-and-virtualenv/package-installs.yaml +++ b/elements/pip-and-virtualenv/package-installs.yaml @@ -2,7 +2,22 @@ # early enough because pip depends on it. python-xml: phase: pre-install.d + dib_python_version: 2 python-pip: installtype: package + dib_python_version: 2 +python3-pip: + installtype: package + dib_python_version: 3 python-virtualenv: installtype: package + dib_python_version: 2 +python3-virtualenv: + installtype: package + dib_python_version: 3 +python-dev: + installtype: source + dib_python_version: 2 +python3-dev: + installtype: source + dib_python_version: 3 diff --git a/elements/pip-and-virtualenv/pkg-map b/elements/pip-and-virtualenv/pkg-map index 508fd004..09e1529f 100644 --- a/elements/pip-and-virtualenv/pkg-map +++ b/elements/pip-and-virtualenv/pkg-map @@ -2,10 +2,17 @@ "family": { "gentoo": { "python-pip": "dev-python/pip", - "python-virtualenv": "dev-python/virtualenv" + "python-virtualenv": "dev-python/virtualenv", + "python3-dev": "dev-lang/python" }, - "suse" : { - "python-xml": "python-xml" + "suse": { + "python-xml": "python-xml", + "python2-dev": "python2-devel", + "python3-dev": "python3-devel" + }, + "redhat": { + "python2-dev": "python2-devel", + "python3-dev": "python3-devel" } }, "default": {