From fd3a64b0928d21b64461ffb16d37c053fd46e846 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 5 Jun 2024 16:25:47 -0500
Subject: [PATCH] Make pyproject.toml the authoritative source for version
 number

---
 pyopencl/version.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pyopencl/version.py b/pyopencl/version.py
index 9d090a0b..b430d9a5 100644
--- a/pyopencl/version.py
+++ b/pyopencl/version.py
@@ -1,3 +1,7 @@
-VERSION = (2024, 2, 3)
-VERSION_STATUS = ""
-VERSION_TEXT = ".".join(str(x) for x in VERSION) + VERSION_STATUS
+from importlib import metadata
+VERSION_TEXT = metadata.version("pyopencl")
+
+import re
+_match = re.match("^([0-9.]+)([a-z0-9]*?)$", VERSION_TEXT)
+VERSION_STATUS = _match.group(2)
+VERSION = tuple(int(nr) for nr in _match.group(1).split("."))
-- 
GitLab