List API

警告

此功能是实验性的,可能会发生重大更改。有关更多信息,请参阅 Conan 稳定性 部分。

警告

子 API 不应自行初始化。它们旨在仅通过主 ConanAPI 属性访问。

class ListAPI(conan_api)

从缓存或远程获取配方和包的引用

latest_recipe_revision(ref: RecipeReference, remote: Remote = None)

对于给定的配方引用,返回远程中配方的最新版本,或者如果未指定远程,则返回本地缓存中的配方,或者如果配方不存在,则返回 None

recipe_revisions(ref: RecipeReference, remote: Remote = None)

对于给定的配方引用,返回远程中配方的所有版本,或者如果未指定远程,则返回本地缓存中的配方

select(pattern: ListPattern, package_query=None, remote: Remote = None, lru=None, profile=None) PackagesList

对于给定的模式,返回匹配所提供过滤器的配方和包列表。

参数:
  • pattern (ListPattern) – 搜索标准

  • package_query (str) – 在返回包时,表达式形式为 "os=Windows AND (arch=x86 OR compiler=gcc)" 以过滤包。如果为 None,则如果请求,将返回所有包。

  • remote (Remote) – 要搜索的远程仓库,如果为 None,则将在本地缓存中搜索。

  • lru (str) – 如果设置,将过滤结果,仅包含在过去 ‘lru’ 时间内使用过的包/二进制文件。它可以是类似 "2d"(2 天)或 "3h"(3 小时)的字符串。

  • profile (Profile) – 用于按设置和选项过滤包的配置文件。

explain_missing_binaries(ref, conaninfo, remotes)

(实验性) 解释为什么缓存中缺少二进制文件

find_remotes(package_list, remotes)

(实验性) 查找可以找到当前包列表的远程仓库