llvm_snapshot_builder.mixins

llvm_snapshot_builder.mixins allow to reuse code in different actions

Submodules

Package Contents

Classes

CoprBuildWalkerMixin

Allows you to walk over each build filtered by state and chroot.

CoprClientMixin

Any class that needs a copr client property can derive from this class

CoprPackageBuilderMixin

The base class for package building Actions in Copr

class llvm_snapshot_builder.mixins.CoprBuildWalkerMixin(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], chroots: list[str] = None, states: list[str] = None, **kwargs)[source]

Allows you to walk over each build filtered by state and chroot. Make sure you use CoprClientMixin as well.

property filtered_build_ids: list[str]

Returns the filtered build IDs

walk_builds(func: Callable[Ellipsis, bool] = None) bool[source]

Walks over every filtered build and optionally (if given) calls func with the current build object. When func returns False, the walk_builds function stops returns False as well.

Along the way, this function populates the filtered_build_ids property with the builds that were filtered. This can be used for copr operations that can handle multiple build ids.

class llvm_snapshot_builder.mixins.CoprClientMixin(client: CoprClientMixin = None, **kwargs)[source]

Any class that needs a copr client property can derive from this class

property client

Property for getting the copr client. Upon first call of this function, the client is instantiated.

__make_client() copr.v3.Client

Instatiates the copr client. Make sure to use the “client” property for accessing the client and creating it.

If the environment contains COPR_URL, COPR_LOGIN, COPR_TOKEN, and COPR_USERNAME, we’ll try to create a Copr client from those environment variables; otherwise, A Copr API client is created from the config file in ~/.config/copr. See https://copr.fedorainfracloud.org/api/ for how to create such a file.

class llvm_snapshot_builder.mixins.CoprPackageBuilderMixin(**kwargs)[source]

The base class for package building Actions in Copr

default_build_timeout

the default build timeout in seconds

Type:

int

adjust_chroot(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], chroot: str)[source]

Adjusts the chroot to have –with=snapshot_build and llvm-snapshot-builder package installed.

Keyword Arguments:
  • for (proj -- the project to adjust the chroot) –

  • adjust (chroot -- the chroot to) –

build(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], package_name: str, chroots: list[str], build_after_id: int = None, timeout: int = None)[source]

Builds a package in Copr

Parameters:
  • proj (CoprProjectRef) – the project to build in

  • package_name (str) – the package to build

  • chroots (list[str]) – the chroots to build in

  • build_after_id (int) – the build to build after

  • timeout (int) – the build timeout in seconds

Raises:

CoprRequestException – if the build could not be created