Maintain version info in a single place.

http://stackoverflow.com/a/2073599/647002
This commit is contained in:
medmunds
2013-03-03 11:39:12 -08:00
parent 618729b444
commit 230011f818
4 changed files with 11 additions and 6 deletions

View File

@@ -4,8 +4,7 @@ from django.utils.text import capfirst
from djrill.exceptions import MandrillAPIError, NotSupportedByMandrillError
VERSION = (0, 3, 1)
__version__ = '.'.join([str(x) for x in VERSION])
from ._version import *
# This backend was developed against this API endpoint.
# You can override in settings.py, if desired.

3
djrill/_version.py Normal file
View File

@@ -0,0 +1,3 @@
VERSION = (0, 3, 1)
__version__ = '.'.join([str(x) for x in VERSION])
__minor_version__ = '.'.join([str(x) for x in VERSION[:2]]) # Sphinx's X.Y "version"

View File

@@ -16,7 +16,9 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
execfile('../djrill/_version.py')
# -- General configuration -----------------------------------------------------
@@ -48,9 +50,9 @@ copyright = u'2013, Djrill contributors (see AUTHORS.txt)'
# built documents.
#
# The short X.Y version.
version = '0.3'
version = __minor_version__
# The full version, including alpha/beta/rc tags.
release = '0.3.1'
release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -1,4 +1,5 @@
from setuptools import setup
execfile('djrill/_version.py')
with open('LICENSE') as file:
license_text = file.read()
@@ -7,7 +8,7 @@ with open('README.rst') as file:
setup(
name="djrill",
version="0.3.1",
version=__version__,
description='Django email backend for Mandrill.',
keywords="django, mailchimp, mandrill, email, email backend",
author="Kenneth Love <kenneth@brack3t.com>, Chris Jones <chris@brack3t.com>",