aea.helpers.dependency_
tree
This module contains the code to generate dependency trees from registries.
load_
yaml
def load_yaml(file_path: Path) -> Tuple[Dict, List[Dict]]
Load yaml file.
dump_
yaml
def dump_yaml(file_path: Path,
data: Dict,
extra_data: Optional[List[Dict]] = None) -> None
Dump yaml file.
to_
plural
def to_plural(string: str) -> str
Convert component to plural
reduce_
sets
def reduce_sets(list_of_sets: List[Set]) -> Set[PackageId]
Reduce a list of sets to one dimentional set.
to_
package_
id
def to_package_id(public_id: str, package_type: str) -> PackageId
Convert to public id.
DependencyTree Objects
class DependencyTree()
This class represents the dependency tree for a registry.
get_
all_
dependencies
@staticmethod
def get_all_dependencies(item_config: Dict) -> List[PackageId]
Returns a list of all available dependencies.
resolve_
tree
@classmethod
def resolve_tree(cls, dependency_list: Dict[PackageId,
List[PackageId]]) -> Dict
Resolve dependency tree.
Arguments:
dependency_list
: the adjacency list of the dependency graph
Returns:
the dependency tree
flatten_
tree
@classmethod
def flatten_tree(cls, dependency_tree: Dict, flat_tree: List[List[PackageId]],
level: int) -> None
Flatten tree.
find_
packages_
in_
a_
project
@staticmethod
def find_packages_in_a_project(project_dir: Path) -> List[Tuple[str, Path]]
Find packages in an AEA project.
find_
packages_
in_
a_
local_
repository
@staticmethod
def find_packages_in_a_local_repository(
packages_dir: Path) -> List[Tuple[str, Path]]
Find packages in a local repository.
generate
@classmethod
def generate(cls,
packages_dir: Path,
from_project: bool = False) -> List[List[PackageId]]
Returns PublicId to hash mapping.