Skip to content

repos ¤

Manage repositories.

Classes:

RepositoryCache ¤

RepositoryCache(cache_dir: str | Path = DEFAULT_REPO_DIR)

A cache for local clones of configured repositories.

Parameters:

  • cache_dir (str | Path, default: DEFAULT_REPO_DIR ) –

    The directory in which to clone the repositories.

Methods:

build ¤

build(repo: str) -> Iterator[Path]

Build distributions.

Parameters:

  • repo (str) –

    The repository to work on.

Returns:

checkout ¤

checkout(repo: str, ref: str) -> None

Checkout a ref.

Parameters:

  • repo (str) –

    The repository to work on.

checkout_origin_head ¤

checkout_origin_head(repo: str) -> None

Checkout origin's HEAD again.

Parameters:

  • repo (str) –

    The repository to work on.

clone ¤

clone(repo: str) -> Path

Clone a repository.

Parameters:

  • repo (str) –

    The repository to clone.

Returns:

  • Path

    The path to the cloned repository.

exists ¤

exists(repo: str) -> bool

Check if a repository already exists.

Parameters:

  • repo (str) –

    The repository to check.

Returns:

  • bool

    True or false.

latest_tag ¤

latest_tag(repo: str) -> str

Get the latest Git tag.

Parameters:

  • repo (str) –

    The repository to work on.

Returns:

  • str

    A tag.

pull ¤

pull(repo: str) -> None

Pull latest changes.

Parameters:

  • repo (str) –

    The repository to work on.

remove ¤

remove(repo: str) -> None

Remove a repository from the cache.

Parameters:

  • repo (str) –

    The repository to remove.

remove_dist ¤

remove_dist(repo: str) -> None

Remove the dist folder of a repository.

Parameters:

  • repo (str) –

    The repository to work on.

RepositoryConfig ¤

RepositoryConfig(conf_path: str | Path = DEFAULT_CONF_PATH)

Repositories configuration.

Parameters:

  • conf_path (str | Path, default: DEFAULT_CONF_PATH ) –

    The path to the configuration file.

Methods:

add_repositories ¤

add_repositories(repos: dict[str, str]) -> dict[str, str]

Add the given repositories to the configuration file.

Parameters:

  • repos (dict[str, str]) –

    The repositories to add.

Returns:

get_repositories ¤

get_repositories() -> dict[str, str]

Get configured repositories.

Returns:

  • dict[str, str]

    The dict of repositories ("NAMESPACE/PROJECT": "PACKAGE").

remove_repositories ¤

remove_repositories(repos: Iterable[str]) -> dict[str, str]

Remove the given repositories from the configuration file.

Parameters:

  • repos (Iterable[str]) –

    The repositories to remove.

Returns:

save_repositories ¤

save_repositories(repos: dict[str, str]) -> dict[str, str]

Save the given repositories into the configuration file.

Parameters:

  • repos (dict[str, str]) –

    The repositories to save.

Returns: