コード例 #1
0
ファイル: _rezapi.py プロジェクト: evil-g/allzpark
def find_latest(name, range_=None, paths=None, package_filter=None):
    """
    Find latest package version

    Args:
        name (str): Name of the rez package
        range_ (VersionRange or str, optional): Limits versions to range
        paths (list of str, optional): Paths to search for packages
        package_filter (PackageFilter, optional): Limits versions to those
                                                  that match package filter

    Returns:
        rez.packages_.Package
    """
    if package_filter:
        it = package_filter.iter_packages(name, range_, paths)
    else:
        it = find(name, range_, paths)

    it = sorted(it, key=lambda pkg: pkg.version)

    try:
        return list(it)[-1]
    except IndexError:
        raise PackageNotFoundError("package family not found: %s" % name)
コード例 #2
0
ファイル: _rezapi.py プロジェクト: singhaidotnish/allzpark
def find_latest(name, range_=None, paths=None):
    it = find(name, range_)
    it = sorted(it, key=lambda pkg: pkg.version)

    try:
        return list(it)[-1]
    except IndexError:
        raise PackageNotFoundError("package family not found: %s" % name)
コード例 #3
0
ファイル: _rezapi.py プロジェクト: evil-g/allzpark
def find_one(name, range_=None, paths=None, package_filter=None):
    """
    Find next package version

    Args:
        name (str): Name of the rez package
        range_ (VersionRange or str, optional): Limits versions to range
        paths (list of str, optional): Paths to search for packages
        package_filter (PackageFilter, optional): Limits versions to those
                                                  that match package filter

    Returns:
        rez.packages_.Package
    """
    if package_filter:
        return next(package_filter.iter_packages(name, range_, paths))
    else:
        return next(find(name, range_, paths))
コード例 #4
0
ファイル: _rezapi.py プロジェクト: singhaidotnish/allzpark
def find_one(name, range_=None, paths=None):
    return next(find(name, range_, paths))
コード例 #5
0
def find_latest(*args, **kwargs):
    return list(sorted(find(*args, **kwargs), key=lambda pkg: pkg.version))[-1]
コード例 #6
0
def find_one(*args, **kwargs):
    return next(find(*args, **kwargs))