setup.py: run coding style checks as part of the build
authorAndrea Righi <andrea.righi@canonical.com>
Thu, 15 Jun 2023 16:00:53 +0000 (18:00 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 16 Jun 2023 10:10:09 +0000 (12:10 +0200)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
setup.py

index c8e377e5b214304e86388349f680e19e22dbefbd..85fc90370e4b45e0635094096ae7d65ca8256c29 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,17 @@
 #!/usr/bin/env python3
 
 import os
+import subprocess
 from setuptools import setup
 from kconfig.version import VERSION
+from setuptools.command.build_py import build_py
+
+
+class BuildPy(build_py):
+    def run(self):
+        subprocess.check_call(["make"])
+        build_py.run(self)
+
 
 setup(
     name="annotations",
@@ -23,6 +32,9 @@ setup(
             "annotations = kconfig.run:main",
         ]
     },
+    cmdclass={
+        "build_py": BuildPy,
+    },
     scripts=[
         "bin/sanitize-annotations",
     ],