[pygobject] setup.py: add a "quality" command



commit 89d66dd0aa48aaef0a70aba8a17234bc188ef609
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sun Jan 21 15:32:26 2018 +0100

    setup.py: add a "quality" command
    
    This just calls flake8 internally

 setup.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
---
diff --git a/setup.py b/setup.py
index ab1f494c..a85e1672 100644
--- a/setup.py
+++ b/setup.py
@@ -440,6 +440,24 @@ class test(Command):
         ])
 
 
+class quality(Command):
+    description = "run code quality tests"
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def run(self):
+        status = subprocess.call([
+            sys.executable, "-m", "flake8",
+        ], cwd=get_script_dir())
+        if status != 0:
+            raise SystemExit(status)
+
+
 def get_script_dir():
     return os.path.dirname(os.path.realpath(__file__))
 
@@ -615,6 +633,7 @@ def main():
             "distcheck": distcheck,
             "build_tests": build_tests,
             "test": test,
+            "quality": quality,
         },
         install_requires=[
             "pycairo>=%s" % get_version_requirement(


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