def parse_version(s):
    """
    Split a version string into a tuple for comparison

    Given a version string of the form e.g. "X.Y.Z",
    return a tuple of the components e.g. (X,Y,Z)

    Where possible components will be coverted to
    integers.

    If the version string is empty then the version
    number will be set to an arbitrary negative
    integer.

    Typically the result from this function would not
    be used directly, instead it is used to compare
    two versions, for example:

    >>> parse_version("2.17") < parse_version("1.8")
    False

    Arguments:
      s (str): version string

    Returns:
      Tuple: tuple of the version string
    """
    if s == "":
        # Essentially versionless; set to an
        # arbitrarily small integer
        s = "-99999"
    items = []
    for i in s.split('.'):
        try:
            i = int(i)
        except ValueError:
            pass
        items.append(i)
    return tuple(items)