yambs.dependency package#

Subpackages#

Submodules#

yambs.dependency.config module#

A module for working with dependency configurations.

class yambs.dependency.config.Dependency(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#

Bases: YambsDictCodec, BasicDictCodec

A class for describing project dependencies.

init(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) None[source]#

Initialize this instance.

class yambs.dependency.config.DependencyKind(*values)[source]#

Bases: StrEnum

All dependency kind options.

YAMBS = 'yambs'#
class yambs.dependency.config.DependencySource(*values)[source]#

Bases: StrEnum

All dependency source options.

DIRECTORY = 'directory'#
GITHUB = 'github'#

yambs.dependency.github module#

A module implementing GitHub dependency interactions.

class yambs.dependency.github.GithubDependency(owner: str, repo: str, *args, version: str = 'latest', data: Dict[str, Any] = None, **kwargs)[source]#

Bases: LoggerMixin

A class for managing GitHub dependencies.

download_release_assets(filt: Callable[[dict[str, Any]], Path | None], extract: bool = True, strict: bool = True) None[source]#

Ensure release assets are downloaded.

yambs.dependency.github.default_filt(output: Path, pattern: str = '.*', mkdir: bool = True) Callable[[dict[str, Any]], Path | None][source]#

Create a default release-asset filter method.

yambs.dependency.github.download_file_if_missing(uri: str, dest: Path, timeout: float = 10.0, chunk_size: int = 4096) None[source]#

Download a file if necessary.

yambs.dependency.github.ensure_extracted(path: Path, strict: bool = True, logger: Logger | LoggerAdapter[Any] = None) None[source]#

Ensure that all archive files in a directory are extracted.

yambs.dependency.manager module#

A module implementing a dependency manager.

class yambs.dependency.manager.DependencyManager(root: Path, project_root: Path)[source]#

Bases: object

A class for managing project dependencies.

audit(dep: Dependency) DependencyState[source]#

Interact with a dependency if needed.

info(logger: Logger | LoggerAdapter[Any]) None[source]#

Log some information.

save(script: Path, logger: Logger | LoggerAdapter[Any] = None) None[source]#

Save state data and create the third-party build script.

yambs.dependency.manager.write_third_party_script(path: Path, commands: List[List[str]] = None) None[source]#

Create a simple shell script normally containing instructions to build third-party commands.

yambs.dependency.state module#

A module implementing interfaces for working with dependency states.

class yambs.dependency.state.DependencyState(*values)[source]#

Bases: StrEnum

States that a dependency can be in.

INIT = 'init'#

Module contents#