From 22384046bb13ee93fdeca94fc0d5bf200ec01e17 Mon Sep 17 00:00:00 2001 From: Nicholas Yang Date: Thu, 14 Dec 2023 12:35:52 +0800 Subject: [PATCH 1/2] Dev: unify version string used in setup.py and autotools --- setup.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 89758a40b..d13d99819 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,19 @@ # Note that this script only installs the python modules, # the other parts of crmsh are installed by autotools from setuptools import setup +import contextlib +import re + +VERSION = '0.0.1' + +with contextlib.suppress(Exception): + with open('version', 'r', encoding='ascii') as f: + match = re.match('^\\d+\\.\\d+\\.\\d+', f.read().strip()) + if match: + VERSION = match.group(0) setup(name='crmsh', - version='4.5.0', + version=VERSION, description='Command-line interface for High-Availability cluster management', author='Kristoffer Gronlund, Xin Liang', author_email='XLiang@suse.com', From f165e5bdcd8ecdfa56c4a027e18db66afb90e4ab Mon Sep 17 00:00:00 2001 From: Nicholas Yang Date: Thu, 14 Dec 2023 12:36:20 +0800 Subject: [PATCH 2/2] Fix: autoconf: --with-version does not override the variable used in `version.in` --- version.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.in b/version.in index d78bda934..a24f9877a 100644 --- a/version.in +++ b/version.in @@ -1 +1 @@ -@VERSION@ +@PACKAGE_VERSION@