Project

General

Profile

« Previous | Next » 

Revision fe3a77c4

Added by Benjamin Dauvergne about 11 years ago

setup.py: only use tag matching v* for building the version string

View differences:

setup.py
64 64
    assert version is not None
65 65
    if os.path.exists('.git'):
66 66
        import subprocess
67
        p = subprocess.Popen(['git','describe','--dirty'],
67
        p = subprocess.Popen(['git','describe','--dirty','--match=v*'],
68 68
                stdout=subprocess.PIPE)
69 69
        result = p.communicate()[0]
70 70
        assert p.returncode == 0, 'git returned non-zero'
71
        new_version = result.split()[0]
71
        new_version = result.split()[0][1:]
72 72
        assert not new_version.endswith('-dirty'), 'git workdir is not clean'
73 73
        assert new_version.split('-')[0] == version, '__version__ must match the last git annotated tag'
74 74
        version = new_version.replace('-', '.')

Also available in: Unified diff