git version

This commit is contained in:
j 2016-02-18 19:53:49 +05:30
parent 4c30c356c7
commit a3be13e0d5
2 changed files with 7 additions and 11 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
# GPL 2008-2014
__version__ = 'bzr'
__version__ = 'git'
from glob import glob

View File

@ -6,19 +6,15 @@ try:
except:
from distutils.core import setup
def get_bzr_version():
import os
info = os.path.join(os.path.dirname(__file__), '.bzr/branch/last-revision')
if os.path.exists(info):
f = open(info)
rev = int(f.read().split()[0])
f.close()
if rev:
return u'%s' % rev
def get_version():
import subprocess
rev = subprocess.check_output(['git', 'rev-list', 'HEAD', '--count']).strip()
if rev:
return u'0.%s' % rev
return u'unknown'
setup(name='oxtimelines',
version='0.%s' % get_bzr_version() ,
version='0.%s' % get_version() ,
scripts=[
'bin/oxtimelines',
],