Skip to content

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.