Commit 682b3302 authored by Kyle Edwards's avatar Kyle Edwards

Get setup.py verison from d/changelog

parent affcc503
dh-cmake (0.6~) UNRELEASED; urgency=medium
[ Kyle Edwards ]
* Get setup.py version from d/changelog
-- Kyle Edwards <kyle.edwards@kitware.com> Mon, 27 Jul 2020 10:43:23 -0400
dh-cmake (0.5) unstable; urgency=medium
[ Alastair McKinstry ]
......
......@@ -5,11 +5,25 @@
# https://gitlab.kitware.com/debian/dh-cmake/blob/master/LICENSE for details.
from setuptools import setup
import debian.changelog
import os.path
def get_current_version():
root_dir = os.path.dirname(os.path.abspath(__file__))
changelog_file = os.path.join(root_dir, "debian/changelog")
with open(changelog_file) as f:
changelog = debian.changelog.Changelog(f)
return str(changelog.get_version())
def debian_version_to_python_version(version_str):
if version_str[-1] == "~":
return version_str[:-1] + ".dev1"
return version_str
setup(
name="dh-cmake",
version="0.3",
version=debian_version_to_python_version(get_current_version()),
description="Debhelper program for CMake projects",
url="https://gitlab.kitware.com/debian/dh-cmake",
author="Kyle Edwards",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment