micropy.packages

Packages Module.

Allows user to address different dependency types (package, module, path, pypi, etc.) through a single uniform api.

Functions

create_dependency_source(requirement[, name])

Factory for creating a dependency source object.

Classes

LocalDependencySource(package, path)

Dependency Source that is available locally.

Package(name, specs[, path])

PackageDependencySource(package[, format_desc])

Dependency Source for pypi packages.

class micropy.packages.PackageDependencySource(package, format_desc=None)

Bases: micropy.packages.source.DependencySource

Dependency Source for pypi packages.

Parameters
  • package (Package) – Package source points too.

  • format_desc (Optional[Callable[…, Any]]) – Callback to format progress bar description. Defaults to None.

fetch()

Fetch package contents into memory.

Returns

Package archive contents.

Return type

bytes

class micropy.packages.LocalDependencySource(package, path)

Bases: micropy.packages.source.DependencySource

Dependency Source that is available locally.

Parameters
  • package (Package) – Package source points too.

  • path (Path) – Path to package.

micropy.packages.create_dependency_source(requirement, name=None, **kwargs)

Factory for creating a dependency source object.

Parameters
  • requirement (str) – Package name/path/constraints in string form.

  • name (str, optional) – Override package name. Defaults to None.

Return type

Union[LocalDependencySource, PackageDependencySource]

Returns

Appropriate Dependency Source