Skip to content

Repo

repo

Defines helpers to clone / checkout a git repository

The mirumoji frontend (apps/frontend) directory is not shipped with the python library, so this module clones or updates the mirumoji repo into the app's user-data directory so that the frontend image can be built locally

ensure_repo(*, repo_url=REPO_URL, repo_path=HOST_REPO_PATH, branch=DEFAULT_BRANCH)

Clones or updates the mirumoji GitHub repo, yielding progress lines

Clones repo_url into repo_path when absent, otherwise fetches and fast-forwards the tracked branch. Output is yielded line by line

Parameters:

Name Type Description Default
repo_url str

The repository URL to clone

REPO_URL
repo_path Path

Where the checkout lives (the user-data dir)

HOST_REPO_PATH
branch str

The branch to check out / pull

DEFAULT_BRANCH

Yields:

Type Description
str

Each git output line as it is produced

Returns:

Type Description
Path

The path to the ready checkout

Raises:

Type Description
BuildSourceError

If git is missing or the clone/update fails