def version2float(s):
    """Converts a version string to a float suitable for sorting"""
    # Remove 2nd version: '4.1.1-4.5.5' --> '4.1.1'
    s = s.split('-')[0]
    # Max one point: '4.1.1' --> '4.1'
    s = '.'.join(s.split('.')[:2])
    # Remove non numeric characters
    s = ''.join(c for c in s if c.isdigit() or c == '.')
    return float(s)