You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by ju...@apache.org on 2020/06/23 09:36:35 UTC

[bigtop] branch master updated: BIGTOP-3364: Leverage pip3/python3 to install setuptools

This is an automated email from the ASF dual-hosted git repository.

junhe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 34e0bd7  BIGTOP-3364: Leverage pip3/python3 to install setuptools
34e0bd7 is described below

commit 34e0bd7182c713b16dce9a4bdc803c8ed7fb9eb3
Author: Yuqi Gu <yu...@arm.com>
AuthorDate: Thu Jun 11 09:01:26 2020 +0000

    BIGTOP-3364: Leverage pip3/python3 to install setuptools
    
    setuptools could not be installed by pip/pip2 on Ubuntu-16.04/18.04 and centos-7.
    From https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages,
    it suggests to leverage python3/pip3 to install setuptools package.
    
    Change-Id: I42b6eb483d3f0e66637e6fc6bbd1fa6eb0a4e60c
    Signed-off-by: Yuqi Gu <yu...@arm.com>
---
 bigtop_toolchain/manifests/packages.pp | 39 ++++++++++++++--------------------
 1 file changed, 16 insertions(+), 23 deletions(-)

diff --git a/bigtop_toolchain/manifests/packages.pp b/bigtop_toolchain/manifests/packages.pp
index 1d74daf..fd1dc8c 100644
--- a/bigtop_toolchain/manifests/packages.pp
+++ b/bigtop_toolchain/manifests/packages.pp
@@ -237,30 +237,23 @@ class bigtop_toolchain::packages {
     }
   }
 
-  # Install Python packages using pip
-  case $operatingsystem{
-    /(?i:(centos|fedora|redhat))/: {
-      $pip = 'python2-pip'
-    } /(?i:(SLES|opensuse))/: { 
-      $pip = 'python-pip'
-    } /Amazon/: { 
-      $pip = 'python27-pip'
-    } /(Ubuntu|Debian)/: {
-      $pip = 'python-pip'
-    }
-  }
-  file { '/usr/bin/pip-python':
-    ensure => 'link',
-    target => '/usr/bin/pip2',
+
+  # BIGTOP-3364: Failed to install setuptools by pip/pip2
+  # on Ubuntu-16.04/18.04 and centos-7.
+  # From https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages,
+  # it suggests to leverage python3/pip3 to install setuptools.
+  #
+  # "provider => 'pip3'" is not available for puppet 3.8.5,
+  #  Workaround: Exec {pip3 install setuptools} directly insead of Package{}.
+  package { 'python3-pip':
+    ensure => installed
   }
-  package { 'setuptools':
-    ensure => 'latest',
-    provider => 'pip',
-    require => [ Package[$pip], File['/usr/bin/pip-python'] ]
+
+  exec { "Setuptools Installation":
+    command => "/usr/bin/pip3 install -q --upgrade setuptools",
   }
-  package { ['flake8', 'wheel']:
-    ensure => 'installed',
-    provider => 'pip',
-    require => [ Package[$pip], File['/usr/bin/pip-python'] ]
+
+  exec { "flake8 and whell Installation":
+    command => "/usr/bin/pip3 freeze --all; /usr/bin/pip3 --version; /usr/bin/pip3 install -q flake8 wheel",
   }
 }