prospector/git/version_to_tag.py
def recursively_split_version_string(input_version: str, output_version: list = []):
    """
    Splits a version/tag string into a list with integers and strings
        i.e. "8.0.0.RC10" --> [8, '.', 0, '.', 0, '.RC', 10]
    Input:
        input_version (str): a version or tag i.e. "8.0.0.RC10"
        output_version (list): an empty list, which will be filled iteratively
    Returns:
        list: the version/tag string in a list with integers and strings i.e. [8, '.', 0, '.', 0, '.RC', 10]
    """
    if type(input_version) != str:
        raise TypeError(
            "The provided version should be a str data type but is of type {}.".format(
                type(input_version)
            )
        )

    # when the part to split is only digits or no digits at all, the process is finished
    if (
        input_version.isdigit()
        or any(char.isdigit() for char in input_version) == False
    ):
        version = output_version + [input_version]
        return [int(segment) if segment.isdigit() else segment for segment in version]

    # otherwise check until what position it is a digit (since we want to keep i.e. a multiple digits number as one integer)
    pos = 0
    while (
        input_version[pos].isdigit() == input_version[pos + 1].isdigit()
        and pos != len(input_version) - 2
    ):  #
        pos += 1

    return recursively_split_version_string(
        input_version[pos + 1 :], output_version + [input_version[: pos + 1]]
    )

    Splits a version/tag string into a list with integers and strings
        i.e. "8.0.0.RC10" --> [8, '.', 0, '.', 0, '.RC', 10]
    Input:
        input_version (str): a version or tag i.e. "8.0.0.RC10"
        output_version (list): an empty list, which will be filled iteratively
    Returns:
        list: the version/tag string in a list with integers and strings i.e. [8, '.', 0, '.', 0, '.RC', 10]
    
Splits a version/tag string into a list with integers and strings
i.e.
Splits a version / tag string into a list with integers and strings i . e .
def recursively_split_version_string(input_version: str, output_version: list = []):
    if type(input_version) != str:
        raise TypeError(
            "The provided version should be a str data type but is of type {}.".format(
                type(input_version)
            )
        )
    if (
        input_version.isdigit()
        or any(char.isdigit() for char in input_version) == False
    ):
        version = output_version + [input_version]
        return [int(segment) if segment.isdigit() else segment for segment in version]
    pos = 0
    while (
        input_version[pos].isdigit() == input_version[pos + 1].isdigit()
        and pos != len(input_version) - 2
    ):  
        pos += 1
    return recursively_split_version_string(
        input_version[pos + 1 :], output_version + [input_version[: pos + 1]]
    )
def recursively_split_version_string ( input_version : str , output_version : list = [ ] ) : if type ( input_version ) != str : raise TypeError ( "The provided version should be a str data type but is of type {}." . format ( type ( input_version ) ) ) if ( input_version . isdigit ( ) or any ( char . isdigit ( ) for char in input_version ) == False ) : version = output_version + [ input_version ] return [ int ( segment ) if segment . isdigit ( ) else segment for segment in version ] pos = 0 while ( input_version [ pos ] . isdigit ( ) == input_version [ pos + 1 ] . isdigit ( ) and pos != len ( input_version ) - 2 ) : pos += 1 return recursively_split_version_string ( input_version [ pos + 1 : ] , output_version + [ input_version [ : pos + 1 ] ] )
Splits a version/tag string into a list with integers and strings
i.e.
Splits a version / tag string into a list with integers and strings i . e .
"""
    Splits a version/tag string into a list with integers and strings
        i.e. "8.0.0.RC10" --> [8, '.', 0, '.', 0, '.RC', 10]
    Input:
        input_version (str): a version or tag i.e. "8.0.0.RC10"
        output_version (list): an empty list, which will be filled iteratively
    Returns:
        list: the version/tag string in a list with integers and strings i.e. [8, '.', 0, '.', 0, '.RC', 10]
    """ # when the part to split is only digits or no digits at all, the process is finished # otherwise check until what position it is a digit (since we want to keep i.e. a multiple digits number as one integer) #
the version/tag string in a list with integers and strings i.e.
the version / tag string in a list with integers and strings i . e .
list
input_version
str
output_version
list