diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-25 13:08:20 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-25 13:08:20 -0700 |
commit | 67c82c0b7edc1e7012a5e2c6959b468abc69b7df (patch) | |
tree | b7be84e4bbb57f81aca4d6a7e05e0068005c7f83 /setup.py | |
parent | 41baae87ce4e24f296acc7f2448e3ad94e5cc1db (diff) | |
download | vyos-cloud-init-67c82c0b7edc1e7012a5e2c6959b468abc69b7df.tar.gz vyos-cloud-init-67c82c0b7edc1e7012a5e2c6959b468abc69b7df.zip |
Use the new tool created to get the version.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -27,26 +27,17 @@ import re import setuptools +import subprocess + def is_f(p): return os.path.isfile(p) -def versions(fn="ChangeLog"): - with open(fn, 'r') as fh: - lines = fh.read().splitlines() - versions = [] - for line in lines: - line = line.strip() - if line.startswith("-") or not line: - continue - if not re.match(r"[\d]", line): - continue - line = line.strip(":") - if (re.match(r"^[\d+]\.[\d+]\.[\d+]$", line) or - re.match(r"^[\d+]\.[\d+]$", line)): - versions.append(line) - return versions +def get_version(): + cmd = ['tools/read-version'] + ver = subprocess.check_output(cmd) + return ver.strip() def requires(fn='Requires'): @@ -63,7 +54,7 @@ def requires(fn='Requires'): setuptools.setup(name='cloud-init', - version=versions()[0], + version=get_version(), description='EC2 initialisation magic', author='Scott Moser', author_email='scott.moser@canonical.com', |