# HG changeset patch # User Peter Sanchez # Date 1414016223 25200 # Wed Oct 22 15:17:03 2014 -0700 # Node ID d2f6692fde71d7f557767862b39cc29f19e5b61a # Parent 2f3cff190d44bfa93564c69834758eff4ccd04d0 Updating version info diff --git a/djpubsubhubbub/__init__.py b/djpubsubhubbub/__init__.py --- a/djpubsubhubbub/__init__.py +++ b/djpubsubhubbub/__init__.py @@ -1,1 +1,24 @@ -__version__ = '0.8' +VERSION = (0, 9, 0, 'beta', 0) + + +# taken from django-registration + +def get_version(): + "Returns a PEP 386-compliant version number from VERSION." + assert len(VERSION) == 5 + assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') + + # Now build the two parts of the version number: + # main = X.Y[.Z] + # sub = .devN - for pre-alpha releases + # | {a|b|c}N - for alpha, beta and rc releases + + parts = 2 if VERSION[2] == 0 else 3 + main = '.'.join(str(x) for x in VERSION[:parts]) + + sub = '' + if VERSION[3] != 'final': + mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'} + sub = mapping[VERSION[3]] + str(VERSION[4]) + + return str(main + sub) diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name='djpubsubhubbub', - version=__import__(project_name).__version__, + version=__import__(project_name).get_version(), packages=find_packages(), include_package_data=True, description='Django PubSubHubbub App',