List classesο
- class PackagesListο
A collection of recipes, revisions and packages.
- split()ο
Returns a list of PackageList, split one per reference. This can be useful to parallelize things like upload, parallelizing per-reference
- only_recipes() Noneο
Filter out all the packages and package revisions, keep only the recipes and recipe revisions in self._data.
- add_ref(ref: RecipeReference) Noneο
Adds a new RecipeReference to a package list
- add_pref(pref: PkgReference, pkg_info: dict = None) Noneο
Add a PkgReference to an already existing RecipeReference inside a package list
- items() Iterable[Tuple[RecipeReference, Dict[PkgReference, Dict]]]ο
Iterate over the contents of the package list.
Yields tuples containing a recipe reference and a dictionary of its associated package references content.
- Returns:
An iterable of tuples where:
The first element is a
RecipeReference(representing the recipe revision).The second element is a dictionary mapping a
PkgReferenceto a nested dictionary of its specific attributes (e.g., settings, options).
- Warning:
Missing Revisions Behavior: This method filters out results that lack revision information.
It will ONLY yield items if they contain at least a recipe revision.
The nested package dictionary will be empty unless it contains a package revision.
When to use serialize instead: If you perform a general search that does not fetch revisions (e.g., running
conan list *), this method will yield nothing because no artifact references are created. In these cases, use theserialize()method to access the results.To successfully use
items(), your query must explicitly request revisions (e.g., runningconan list pkg/version#*:*#*).
- recipe_dict(ref: RecipeReference)ο
Gives read/write access to the dictionary containing a specific RecipeReference information.
- package_dict(pref: PkgReference)ο
Gives read/write access to the dictionary containing a specific PkgReference information
- serialize()ο
Serialize the instance to a dictionary.
- static deserialize(data)ο
Loads the data from a serialized dictionary.
- class MultiPackagesListο
A collection of PackagesList by remote name.
- serialize()ο
Serialize object to a dictionary.
- static load(file)ο
Create an instance of the class from a serialized JSON file path pointed by
file.
- static load_graph(graphfile, graph_recipes=None, graph_binaries=None, context=None)ο
Create an instance of the class from a graph file path, which is the json format returned by a few commands like
conan graph infoorconan create/install.- Parameters:
graphfile (str) β Path to the graph file
graph_recipes (list[str]) β List for kinds of recipes to return. For example
"cache"will return only recipes in the local cache,"download"will return only recipes that have been downloaded, and passing"*"will return all recipes.graph_binaries (list[str]) β List for kinds of binaries to return. For example
"cache"will return only binaries in the local cache,"download"will return only binaries that have been downloaded,"build"will return only binaries that are built,"missing"will return only binaries that are missing,"invalid"will return only binaries that are invalid, and passing"*"will return all binaries.context (str) β Context to filter the graph, can be
"host","build","host-only"or"build-only"
- class ListPattern(expression, rrev='latest', package_id=None, prev='latest', only_recipe=False)ο
Object holding a pattern that matches recipes, revisions and packages.
- Parameters:
expression β The pattern to match, e.g.
"name/*:*"rrev β The recipe revision to match, defaults to
"latest", can also be"!latest"or"~latest"to match all but the latest revision, a pattern like"1234*"to match a specific revision, or a specific revision like"1234".package_id β The package ID to match, defaults to
None, which matches all package IDs.prev β The package revision to match, defaults to
"latest", can also be"!latest"or"~latest"to match all but the latest revision, a pattern like"1234*"to match a specific revision, or a specific revision like"1234".only_recipe β If
True, only the recipe part of the expression is parsed, ignoringpackage_idandprev. This is useful for commands that only operate on recipes, likeconan search.