Project

General

Profile

« Previous | Next » 

Revision d009115d

Added by Jérôme Schneider over 9 years ago

setup.py: manage only tag starting v

View differences:

setup.py
7 7
    version = __version__
8 8
    if os.path.exists('.git'):
9 9
        import subprocess
10
        p = subprocess.Popen(['git','describe','--dirty'],
10
        p = subprocess.Popen(['git','describe','--dirty','--match=v*'],
11 11
                stdout=subprocess.PIPE)
12 12
        result = p.communicate()[0]
13 13
        assert p.returncode == 0, 'git returned non-zero'
14
        new_version = result.split()[0]
14
        new_version = result.split()[0][1:]
15 15
        assert new_version.split('-')[0] == version, '__version__ must match the last git annotated tag'
16 16
        version = new_version.replace('-', '.')
17 17
    return version

Also available in: Unified diff