Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
define get_version method
Browse files Browse the repository at this point in the history
  • Loading branch information
gkmngrgn committed May 5, 2013
1 parent 4948e9e commit 3f8efb4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions colorific/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
__version_info__ = {
'major': 0,
'minor': 2,
'micro': 1,
'releaselevel': 'final',
}


def get_version():
"""
Return the formatted version information
"""
vers = ["%(major)i.%(minor)i" % __version_info__, ]

if __version_info__['micro']:
vers.append(".%(micro)i" % __version_info__)
if __version_info__['releaselevel'] != 'final':
vers.append('%(releaselevel)s' % __version_info__)
return ''.join(vers)

__version__ = get_version()
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
PROJECT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__)))
README_FILE_PATH = os.path.join(PROJECT_DIR, 'README.rst')
REQUIREMENTS_FILE_PATH = os.path.join(PROJECT_DIR, 'requirements.pip')
VERSION = __import__('colorific').get_version()

setup(
name='colorific',
version='0.2.1',
version=VERSION,
description='Automatic color palette detection',
long_description=file(README_FILE_PATH).read(),
author='Lars Yencken',
Expand Down

0 comments on commit 3f8efb4

Please sign in to comment.