

def render_pep440(pieces):
    if pieces['closest-tag']:
        rendered = pieces['closest-tag']
        if (pieces['distance'] or pieces['dirty']):
            rendered += plus_or_dot(pieces)
            rendered += ('%d.g%s' % (pieces['distance'], pieces['short']))
            if pieces['dirty']:
                rendered += '.dirty'
    else:
        rendered = ('0+untagged.%d.g%s' % (pieces['distance'], pieces['short']))
        if pieces['dirty']:
            rendered += '.dirty'
    return rendered

dataset/ETHPy150Open Anaconda-Platform/chalmers/versioneer.py render_pep440/original