def version2float(s):
 s = s.split('-')[0]
 s = '.'.join(s.split('.')[:2])
 s = ''.join((c for c in s if (c.isdigit() or (c == '.'))))
 return float(s)

def version2float ( s ) : s = s . split ( '-' ) [ 0 ] s = '.' . join ( s . split ( '.' ) [ : 2 ] ) s = '' . join ( ( c for c in s if ( c . isdigit ( ) or ( c == '.' ) ) ) ) return float ( s )
converts a version string to a float suitable for sorting .