[IMP] release: add structured version_info tuple, properly comparable

The semantics were inspired by Python's own sys.version_info

bzr revid: odo@openerp.com-20111104144112-jab9uyt9wnqlziri
This commit is contained in:
Olivier Dony 2011-11-04 15:41:12 +01:00
parent de8306897b
commit 44475831b9
1 changed files with 15 additions and 2 deletions

View File

@ -19,8 +19,21 @@
#
##############################################################################
version = '6.1dev'
major_version = '6.1'
RELEASE_LEVELS = [ALPHA, BETA, RELEASE_CANDIDATE, FINAL] = ['alpha', 'beta', 'candidate', 'final']
RELEASE_LEVELS_DISPLAY = {ALPHA: ALPHA,
BETA: BETA,
RELEASE_CANDIDATE: 'rc',
FINAL: ''}
# version_info format: (MAJOR, MINOR, MICRO, RELEASE_LEVEL, SERIAL)
# inspired by Python's own sys.version_info, in order to be
# properly comparable using normal operarors, for example:
# (6,1,0,'beta',0) < (6,1,0,'candidate',1) < (6,1,0,'candidate',2)
# (6,1,0,'candidate',2) < (6,1,0,'final',0) < (6,1,2,'final',0)
version_info = (6,1,0,BETA,0)
version = '.'.join(map(str,version_info[:2])) + RELEASE_LEVELS_DISPLAY[version_info[3]] + str(version_info[4] or '')
major_version = '.'.join(map(str,version_info[:2]))
description = 'OpenERP Server'
long_desc = '''OpenERP is a complete ERP and CRM. The main features are accounting (analytic
and financial), stock management, sales and purchases management, tasks