From bfb158f9bc8903c3cc3421ecbbc9bfe508dfbdec Mon Sep 17 00:00:00 2001
From: Robert Rosca <robert.rosca@xfel.eu>
Date: Thu, 4 Mar 2021 22:16:32 +0100
Subject: [PATCH] Adjust post install command, add noqa comments to long lines

---
 setup.py | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/setup.py b/setup.py
index e6f030abe..1fa3261d5 100644
--- a/setup.py
+++ b/setup.py
@@ -27,17 +27,22 @@ class PostInstallCommand(install):
         install.run(self)
         # check if this is a karabo installation
         python_path = sys.executable
-        if "karabo" in python_path:
-            print("Karabo installation detected, checking for PyDetLib installation")
-            if importlib.util.find_spec("XFELDetAna") is None:
-                print("No PyDetLib installation found, attempting to install")
-                check_call(
-                    "karabo -g https://in.xfel.eu/gitlab install pyDetLib master".split()
-                )
-        else:
+
+        if "karabo" not in python_path:
             print(
-                "Python environment seems to not be a Karabo environment. Please"
-                "install PyDetLib manually."
+                "Python environment seems to not be a Karabo environment."
+                "Please install PyDetLib manually."
+            )
+            return
+
+        print(
+            "Karabo installation detected, checking for PyDetLib installation"
+        )
+
+        if importlib.util.find_spec("XFELDetAna") is None:
+            print("No PyDetLib installation found, attempting to install")
+            check_call(
+                "karabo -g https://in.xfel.eu/gitlab install pyDetLib master".split() # noqa
             )
 
 
@@ -73,7 +78,8 @@ setup(
     description="",
     long_description="",
     long_description_content_type="text/markdown",
-    license="(c) European XFEL GmbH 2018",  # TODO: find licence, assuming this will be open sourced eventually
+    # TODO: find licence, assuming this will be open sourced eventually
+    license="(c) European XFEL GmbH 2018",
     packages=[
         "cal_tools",
         "xfel_calibrate",
@@ -103,9 +109,9 @@ setup(
     },
     ext_modules=extensions,
     install_requires=[
-        "iCalibrationDB @ git+ssh://git@git.xfel.eu:10022/detectors/cal_db_interactive.git@2.0.1",
-        "nbparameterise @ git+ssh://git@git.xfel.eu:10022/detectors/nbparameterise.git@0.3",
-        "XFELDetectorAnalysis @ git+ssh://git@git.xfel.eu:10022/karaboDevices/pyDetLib.git@2.5.6-2.10.0#subdirectory=lib",
+        "iCalibrationDB @ git+ssh://git@git.xfel.eu:10022/detectors/cal_db_interactive.git@2.0.1", # noqa
+        "nbparameterise @ git+ssh://git@git.xfel.eu:10022/detectors/nbparameterise.git@0.3", # noqa
+        "XFELDetectorAnalysis @ git+ssh://git@git.xfel.eu:10022/karaboDevices/pyDetLib.git@2.5.6-2.10.0#subdirectory=lib", # noqa
         "Cython==0.29.21",
         "Jinja2==2.11.2",
         "astcheck==0.2.5",
-- 
GitLab