def render_pep440_pre(pieces):
    """TAG[.post.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post.devDISTANCE
    """
    if pieces['closest-tag']:
        rendered = pieces['closest-tag']
        if pieces['distance']:
            rendered += f".post.dev{pieces['distance']:d}"
    else:
        rendered = f"0.post.dev{pieces['distance']:d}"
    return rendered
