(pattern=None, tag_prefix='v')
Return the highest numbered tag (most recent)
    Filters on pattern first, otherwise based off all tags
    Removes prefixed `v` if applicable
Return the highest numbered tag (most recent)
    Filters on pattern first, otherwise based off all tags
    Removes prefixed `v` if applicable
Return the highest numbered tag ( most recent ) Filters on pattern first otherwise based off all tags Removes prefixed v if applicable
def get_latest_tag(pattern=None, tag_prefix='v'):
    """
    Return the highest numbered tag (most recent)
    Filters on pattern first, otherwise based off all tags
    Removes prefixed `v` if applicable
    """
    if not pattern:
        pattern = rf'^({tag_prefix})?\d+\.\d+\.\d+.*'
    all_tags = sorted((parse_version_info(t.replace(tag_prefix, '', 1)), t) for t in git_tag_list(pattern))
    if not all_tags:
        return
    else:
        # reverse so we have descending order
        return list(reversed(all_tags))[0][1]
def get_latest_tag ( pattern = None , tag_prefix = 'v' ) : if not pattern : pattern = rf'^({tag_prefix})?\d+\.\d+\.\d+.*' all_tags = sorted ( ( parse_version_info ( t . replace ( tag_prefix , '' , 1 ) ) , t ) for t in git_tag_list ( pattern ) ) if not all_tags : return else : # reverse so we have descending order return list ( reversed ( all_tags ) ) [ 0 ] [ 1 ]