[virt-bootstrap] [PATCH 7/7] setup: Use pylint-3 and pycodestyle-3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Radostin Stoyanov <rstoyanov1@xxxxxxxxx>
---
 setup.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 54a2cd9..20f3de7 100755
--- a/setup.py
+++ b/setup.py
@@ -38,6 +38,8 @@ from setuptools.command.sdist import sdist
 sys.path.insert(0, 'src')  # noqa: E402
 import virtBootstrap
 
+IS_PI3 = (sys.version_info.major == 3)
+
 
 def read(fname):
     """
@@ -100,7 +102,12 @@ class CheckPylint(setuptools.Command):
         output_format = "colorized" if sys.stdout.isatty() else "text"
 
         print(">>> Running pycodestyle ...")
-        cmd = "pycodestyle "
+
+        if IS_PI3 and virtBootstrap.utils.is_installed('pycodestyle-3'):
+            cmd = "pycodestyle-3 "
+        else:
+            cmd = "pycodestyle "
+
         if (subprocess.call(cmd + files, shell=True) != 0):
             res = 1
 
@@ -108,7 +115,13 @@ class CheckPylint(setuptools.Command):
         args = ""
         if self.errors_only:
             args = "-E"
-        cmd = "pylint %s --output-format=%s " % (args, format(output_format))
+
+        if IS_PI3 and virtBootstrap.utils.is_installed('pylint-3'):
+            cmd = "pylint-3 "
+        else:
+            cmd = "pylint "
+
+        cmd += "%s --output-format=%s " % (args, format(output_format))
         if (subprocess.call(cmd + files, shell=True) != 0):
             res = 1
 
-- 
2.14.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux