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', diff --git a/version.in b/version.in index d78bda934..a24f9877a 100644 --- a/version.in +++ b/version.in @@ -1 +1 @@ -@VERSION@ +@PACKAGE_VERSION@