Skip to content

aea.package_manager.v1

Package manager V1

PackageManagerV1 Objects

class PackageManagerV1(BasePackageManager)

Package manager V1

LocalPackageType Objects

class LocalPackageType(Enum)

Local package types.

__init__

def __init__(path: Path,
             dev_packages: Optional[PackageIdToHashMapping] = None,
             third_party_packages: Optional[PackageIdToHashMapping] = None,
             config_loader: ConfigLoaderCallableType = load_configuration,
             logger: Optional[logging.Logger] = None) -> None

Initialize object.

dev_packages

@property
def dev_packages() -> PackageIdToHashMapping

Returns mappings of package ids -> package hash

third_party_packages

@property
def third_party_packages() -> PackageIdToHashMapping

Returns mappings of package ids -> package hash

all_packages

@property
def all_packages() -> PackageIdToHashMapping

Return all packages.

get_package_hash

def get_package_hash(package_id: PackageId) -> Optional[str]

Get package hash.

is_third_party_package

def is_third_party_package(package_id: PackageId) -> bool

Check if a package is third party package.

is_dev_package

def is_dev_package(package_id: PackageId) -> bool

Check if a package is third party package.

add_package

def add_package(package_id: PackageId,
                with_dependencies: bool = False,
                allow_update: bool = False) -> "PackageManagerV1"

Add package.

register

def register(package_path: Path,
             package_type: Optional[PackageType] = None) -> "PackageManagerV1"

Add package to the index.

sync

def sync(dev: bool = False,
         third_party: bool = True,
         update_packages: bool = False,
         update_hashes: bool = False,
         sources: Optional[List[str]] = None) -> "PackageManagerV1"

Sync local packages to the remote registry.

update_package_hashes

def update_package_hashes(selector_prompt: Optional[Callable[[], str]] = None,
                          skip_missing: bool = False) -> "PackageManagerV1"

Update package.json file.

verify

def verify() -> int

Verify fingerprints and outer hash of all available packages.

json

@property
def json() -> OrderedDictType

Json representation

from_json

@classmethod
def from_json(
    cls,
    packages: Dict[str, Dict[str, str]],
    packages_dir: Optional[Path] = None,
    config_loader: ConfigLoaderCallableType = load_configuration
) -> "PackageManagerV1"

Initialize from json object

from_dir

@classmethod
def from_dir(
    cls,
    packages_dir: Path,
    config_loader: ConfigLoaderCallableType = load_configuration
) -> "PackageManagerV1"

Initialize from packages directory.