diff --git a/imagekit/__init__.py b/imagekit/__init__.py index f4fd227..74808d3 100644 --- a/imagekit/__init__.py +++ b/imagekit/__init__.py @@ -1,38 +1,3 @@ from . import conf from .specs import ImageSpec - - -__title__ = 'django-imagekit' -__author__ = 'Justin Driscoll, Bryan Veloso, Greg Newman, Chris Drackett, Matthew Tretter, Eric Eldredge' -__version__ = (2, 0, 1, 'final', 0) -__license__ = 'BSD' - - -def get_version(version=None): - """Derives a PEP386-compliant version number from VERSION.""" - if version is None: - version = __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] == 'alpha' and version[4] == 0: - # At the toplevel, this would cause an import loop. - from django.utils.version import get_svn_revision - svn_revision = get_svn_revision()[4:] - if svn_revision != 'unknown': - sub = '.dev%s' % svn_revision - - elif version[3] != 'final': - mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'} - sub = mapping[version[3]] + str(version[4]) - - return main + sub +from .pkgmeta import * diff --git a/imagekit/pkgmeta.py b/imagekit/pkgmeta.py new file mode 100644 index 0000000..20e62db --- /dev/null +++ b/imagekit/pkgmeta.py @@ -0,0 +1,5 @@ +__title__ = 'django-imagekit' +__author__ = 'Justin Driscoll, Bryan Veloso, Greg Newman, Chris Drackett, Matthew Tretter, Eric Eldredge' +__version__ = '3.0a1' +__license__ = 'BSD' +__all__ = ['__title__', '__author__', '__version__', '__license__'] diff --git a/setup.py b/setup.py index 9764b06..985e103 100644 --- a/setup.py +++ b/setup.py @@ -11,12 +11,14 @@ if 'publish' in sys.argv: read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() -# Dynamically calculate the version based on imagekit.VERSION. -version = __import__('imagekit').get_version() +# Load package meta from the pkgmeta module without loading imagekit. +pkgmeta = {} +execfile(os.path.join(os.path.dirname(__file__), + 'imagekit', 'pkgmeta.py'), pkgmeta) setup( name='django-imagekit', - version=version, + version=pkgmeta['__version__'], description='Automated image processing for Django models.', long_description=read(os.path.join(os.path.dirname(__file__), 'README.rst')), author='Justin Driscoll',