Skip to content

Commit 2238404

Browse files
Dev: unify version string used in setup.py and autotools
1 parent 54751d3 commit 2238404

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

setup.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22
# Note that this script only installs the python modules,
33
# the other parts of crmsh are installed by autotools
44
from setuptools import setup
5+
import contextlib
6+
import re
7+
8+
VERSION = '0.0.1'
9+
10+
with contextlib.suppress(Exception):
11+
with open('version', 'r', encoding='ascii') as f:
12+
match = re.match('^\\d+\\.\\d+\\.\\d+', f.read().strip())
13+
if match:
14+
VERSION = match.group(0)
515

616
setup(name='crmsh',
7-
version='4.5.0',
17+
version=VERSION,
818
description='Command-line interface for High-Availability cluster management',
919
author='Kristoffer Gronlund, Xin Liang',
1020
author_email='[email protected]',

0 commit comments

Comments
 (0)