~fo0bar/turku/turku-agent-encoding

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Ryan Finnie
  • Date: 2015-03-29 07:59:33 UTC
  • Revision ID: ryan.finnie@canonical.com-20150329075933-cfvkmp8buuz6pm3x
Add turku-agent-rsyncd.service to manifest, build version dynamically

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from distutils.core import setup
19
19
 
 
20
 
 
21
VERSION = '0.1.0'
 
22
 
 
23
 
 
24
def get_bzr_revno():
 
25
    try:
 
26
        import bzrlib.errors
 
27
        from bzrlib.branch import Branch
 
28
    except ImportError:
 
29
        return 0
 
30
    import os
 
31
    try:
 
32
        branch = Branch.open(os.path.dirname(__file__))
 
33
    except bzrlib.errors.NotBranchError:
 
34
        return 0
 
35
    return branch.last_revision_info()[0]
 
36
 
 
37
 
 
38
v = VERSION.split('.')
 
39
if int(v[1]) % 2 == 1:
 
40
    VERSION = '.'.join([v[0], v[1], str(get_bzr_revno())])
 
41
 
20
42
setup(
21
43
    name='turku_agent',
22
44
    description='Turku backups - client agent',
23
 
    version='0.1.0',
 
45
    version=VERSION,
24
46
    author='Ryan Finnie',
25
47
    author_email='ryan.finnie@canonical.com',
26
48
    url='https://launchpad.net/turku',