def sort_version_aware(versions):
    """Takes a list of versions objects and sort them using version schemes."""
    return sorted(
        versions,
        key=lambda version: comparable_version(version.verbose_name),
        reverse=True,
    )
示例#2
0
def sort_version_aware(versions):
    """Takes a list of versions objects and sort them using version schemes."""
    return sorted(
        versions,
        key=lambda version: comparable_version(version.verbose_name),
        reverse=True,
    )
示例#3
0
def sort_version_aware(versions):
    """Takes a list of versions objects and sort them using version schemes."""
    repo_type = None
    if versions:
        repo_type = versions[0].project.repo_type
    return sorted(
        versions,
        key=lambda version: comparable_version(version.verbose_name,
                                               repo_type=repo_type),
        reverse=True,
    )