def sort_key(module_name):
    """
    v1alpha1 -> 1.-2.1
    v1alpha2 -> 1.-2.2
    v1beta1 -> 1.-1.1
    v1beta2 -> 1.-1.2
    v1 -> 1.2.0
    """
    try:
        version = module_name.split("_v", 1)[1]
    except:
        version = "1"
    version = version.replace("alpha", ".-2.").replace("beta", ".-1.")
    version = [int(x) for x in version.split(".")]
    version += [0] * (3 - len(version))
    return tuple(version)