Permalink
Browse files

PEP 386 (http://www.python.org/dev/peps/pep-0386/) compliance

  • Loading branch information...
1 parent dae28f3 commit b047f50b28fde48bd4ccff68b22ce94a8f5acf7a @paltman paltman committed Oct 28, 2010
Showing with 25 additions and 1 deletion.
  1. +20 −0 rubberstamp/__init__.py
  2. +5 −1 setup.py
View
@@ -1,3 +1,23 @@
+VERSION = (0, 1, 0, "f", 2) # following PEP 386
+DEV_N = 1
+POST_N = 1
+
+def get_version():
+ version = "%s.%s" % (VERSION[0], VERSION[1])
+ if VERSION[2]:
+ version = "%s.%s" % (version, VERSION[2])
+ if VERSION[3] != "f":
+ version = "%s%s%s" % (version, VERSION[3], VERSION[4])
+ if DEV_N:
+ version = "%s.dev%s" % (version, DEV_N)
+ elif POST_N > 0:
+ version = "%s.post%s" % (version, POST_N)
+ return version
+
+
+__version__ = get_version()
+
+
def autodiscover():
"""
Auto-discover INSTALLED_APPS permission.py modules, failing silently when
View
@@ -2,9 +2,13 @@
from distutils.core import setup
+
+VERSION = __import__("rubberstamp").__version__
+
+
setup(
name='django-rubberstamp',
- version='0.1',
+ version=VERSION,
description='Permissions manager and backend for Django 1.2.',
author='James Lecker Jr',
author_email='james@jameslecker.com',

0 comments on commit b047f50

Please sign in to comment.