setup.py: Allow for more liberal version numbers
authorGuido Günther <agx@sigxcpu.org>
Wed, 28 Apr 2021 08:26:22 +0000 (10:26 +0200)
committerGuido Günther <agx@sigxcpu.org>
Wed, 28 Apr 2021 08:56:41 +0000 (10:56 +0200)
Otherwise this causes trouble for backports, downstreams, etc.

setup.py

index 962bf14c6f5ab9cbde74457fe9f2adbac16d4f21..0cc31b9ef74513404ca2a94439e7c0b1f3d293dc 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,9 @@ def _parse_changelog():
     with open("debian/changelog") as f:
         line = f.readline()
 
-    m = re.match(".* \\(([0-9.]+)\\) ", line)
+    # Parse version from changelog without external tooling so it can work
+    # on non Debian systems.
+    m = re.match(".* \\(([0-9a-zA-Z.~\\-:+]+)\\) ", line)
     if m:
         return m.group(1)