From 2e3d8a219ea1e459d5c1764a2cd5e9a8beb4d218 Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Thu, 12 Oct 2023 13:18:31 +0200
Subject: [PATCH] FIX: Remove quote characters from revision.

---
 setup.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/setup.py b/setup.py
index 5d5c92f3..de90ebaf 100755
--- a/setup.py
+++ b/setup.py
@@ -97,6 +97,7 @@ def get_version_info():
     FULLVERSION = VERSION
 
     # Magic which is only really needed in the pipelines. Therefore: a lot of dark pipeline magic.
+    GIT_REVISION = "Unknown"
     if os.path.exists('.git'):
         GIT_REVISION = git_version()
     elif os.path.exists('linkahead_pylib_commit'):
@@ -105,14 +106,12 @@ def get_version_info():
     elif os.path.exists('src/linkahead/version.py'):
         # must be a source distribution, use existing version file
         with open('src/linkahead/version.py') as fi:
+            rev_pattern = re.compile(r"^git_revision = '(?P<rev>.*)'$")
             for line in fi.readlines():
-                match = re.match(r"^git_revision = (?P<rev>.*)$", line)
-
+                match = rev_pattern.match(line)
                 if match is not None:
                     GIT_REVISION = match.group('rev')
-
-    else:
-        GIT_REVISION = "Unknown"
+                    break
 
     if not ISRELEASED:
         FULLVERSION += '.dev0+' + GIT_REVISION[:7]
-- 
GitLab