comparison kallithea/__init__.py @ 6201:d55ff973d01f

lib: simplify version; drop get_current_revision - it was run every time on import time - we don't want that This functionality was already not in use with the version numbers we use. I also doubt it is possible to have version numbers where it worked - it seems like there might have been some regression that nobody noticed. Dropping it will thus not really lose any actual functionality. If we want to include the revision number in the version (for browser cache invalidation) then we should do it in a different way. Perhaps writing it to some file from setup.py .
author Mads Kiilerich <madski@unity3d.com>
date Mon, 12 Sep 2016 17:41:19 +0200
parents c7ef77ab2f95
children 940a48e28a03
comparison
equal deleted inserted replaced
6200:c6232b791d87 6201:d55ff973d01f
52 assert False, 'Database rebranding is no longer supported; see README.' 52 assert False, 'Database rebranding is no longer supported; see README.'
53 53
54 # Users.extern_type and .extern_name value for local users 54 # Users.extern_type and .extern_name value for local users
55 EXTERN_TYPE_INTERNAL = 'internal' 55 EXTERN_TYPE_INTERNAL = 'internal'
56 56
57 try: 57 __version__ = '.'.join(str(each) for each in VERSION)
58 from kallithea.lib import get_current_revision
59 _rev = get_current_revision(quiet=True)
60 if _rev and len(VERSION) > 3:
61 VERSION += (_rev[0],)
62 except ImportError:
63 pass
64
65 __version__ = ('.'.join((str(each) for each in VERSION[:3])))
66 __dbversion__ = 31 # defines current db version for migrations 58 __dbversion__ = 31 # defines current db version for migrations
67 __platform__ = platform.system() 59 __platform__ = platform.system()
68 __license__ = 'GPLv3' 60 __license__ = 'GPLv3'
69 __py_version__ = sys.version_info 61 __py_version__ = sys.version_info
70 __author__ = "Various Authors" 62 __author__ = "Various Authors"
71 __url__ = 'https://kallithea-scm.org/' 63 __url__ = 'https://kallithea-scm.org/'
72 64
73 is_windows = __platform__ in ['Windows'] 65 is_windows = __platform__ in ['Windows']
74 is_unix = not is_windows 66 is_unix = not is_windows
75 67
76 if len(VERSION) > 3:
77 __version__ += '.'+VERSION[3]
78
79 if len(VERSION) > 4:
80 __version__ += VERSION[4]
81 else:
82 __version__ += '0'
83 68
84 # Hack for making the celery dependency kombu==1.5.1 compatible with Python 69 # Hack for making the celery dependency kombu==1.5.1 compatible with Python
85 # 2.7.11 which has https://hg.python.org/releases/2.7.11/rev/24bdc4940e81 70 # 2.7.11 which has https://hg.python.org/releases/2.7.11/rev/24bdc4940e81
86 import uuid 71 import uuid
87 if not hasattr(uuid, '_uuid_generate_random'): 72 if not hasattr(uuid, '_uuid_generate_random'):