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.cfg b/setup.cfg index ef33a9b..af46bf5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ upload-dir = docs/_build/html [tool:pytest] DJANGO_SETTINGS_MODULE = nsupdate.settings.dev pep8maxlinelength = 120 -norecursedirs = .git +norecursedirs = .git .eggs pep8ignore = *.py E124 # closing bracket does not match visual indentation (behaves strange!?) *.py E125 # continuation line does not distinguish itself from next logical line (difficult to avoid!) 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',