[virt-tools-list] [virt-manager PATCH] setup: introduce --jobs for pylint

Pavel Hrdina phrdina at redhat.com
Sat Sep 9 09:19:47 UTC 2017


Pylint supports configuring jobs to use multiple processes to
speed up Pylint.  Default value is 1.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---

pushed

 setup.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 762a056e..2a39921b 100755
--- a/setup.py
+++ b/setup.py
@@ -563,13 +563,17 @@ class TestInitrdInject(TestBaseCommand):
 
 
 class CheckPylint(distutils.core.Command):
-    user_options = []
+    user_options = [
+        ("jobs=", "j", "use multiple processes to speed up Pylint"),
+    ]
     description = "Check code using pylint and pycodestyle"
 
     def initialize_options(self):
-        pass
+        self.jobs = None
+
     def finalize_options(self):
-        pass
+        if self.jobs:
+            self.jobs = int(self.jobs)
 
     def run(self):
         files = ["setup.py", "virt-install", "virt-clone",
@@ -592,6 +596,8 @@ class CheckPylint(distutils.core.Command):
             cmd = "pylint-2 "
         else:
             cmd = "pylint "
+        if self.jobs:
+            cmd += "--jobs=%d " % self.jobs
         cmd += "--rcfile tests/pylint.cfg "
         cmd += "--output-format=%s " % output_format
         cmd += "--ignore %s " % ",".join(
-- 
2.13.5




More information about the virt-tools-list mailing list