From ef7a9ec539a415f635d8f7d332db5e54b9fc7d6e Mon Sep 17 00:00:00 2001 From: Fabian Weisshaar Date: Fri, 28 Dec 2018 20:40:34 +0100 Subject: [PATCH] Use setuptools-scm for git based versions --- nsupdate/__init__.py | 4 +++- requirements.d/all.txt | 1 + setup.py | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nsupdate/__init__.py b/nsupdate/__init__.py index 1f39d48..de68a22 100644 --- a/nsupdate/__init__.py +++ b/nsupdate/__init__.py @@ -4,6 +4,8 @@ nsupdate - dynamic DNS service import re +from setuptools_scm import get_version + class Version(tuple): # pragma: no cover """ @@ -62,4 +64,4 @@ class Version(tuple): # pragma: no cover return version_str -version = Version(0, 12, 0) +version = get_version() diff --git a/requirements.d/all.txt b/requirements.d/all.txt index e194507..21ba795 100644 --- a/requirements.d/all.txt +++ b/requirements.d/all.txt @@ -7,3 +7,4 @@ django-registration-redux django-extensions social-auth-app-django requests +setuptools-scm diff --git a/setup.py b/setup.py index 6e61d26..543b32f 100644 --- a/setup.py +++ b/setup.py @@ -4,14 +4,13 @@ setup for nsupdate package from setuptools import setup, find_packages -from nsupdate import version with open('README.rst') as f: readme_content = f.read() setup( name='nsupdate', - version=str(version), + use_scm_version=True, url='http://github.com/nsupdate-info/nsupdate.info/', license='BSD', author='The nsupdate.info Team (see AUTHORS)', @@ -45,6 +44,7 @@ setup( include_package_data=True, zip_safe=False, platforms='any', + setup_requires=['setuptools_scm'], install_requires=[ 'dnspython', 'netaddr', @@ -54,6 +54,7 @@ setup( 'django-extensions', 'social-auth-app-django', 'requests', # for our ddns_client + 'setuptools_scm' ], classifiers=[ 'Development Status :: 5 - Production/Stable',