llvm_snapshot_builder¶
llvm_snapshot_builder provides classes to interact with Copr.
Subpackages¶
llvm_snapshot_builder.actionsllvm_snapshot_builder.actions.actionllvm_snapshot_builder.actions.build_all_packagesllvm_snapshot_builder.actions.build_packagesllvm_snapshot_builder.actions.cancel_buildsllvm_snapshot_builder.actions.create_packagesllvm_snapshot_builder.actions.create_projectllvm_snapshot_builder.actions.delete_buildsllvm_snapshot_builder.actions.delete_projectllvm_snapshot_builder.actions.fork_projectllvm_snapshot_builder.actions.project_existsllvm_snapshot_builder.actions.regenerate_repos
llvm_snapshot_builder.mixins
Submodules¶
Package Contents¶
Classes¶
Builds everyting for the given chroots and creates optimal Copr batches. |
|
Builds a list of packages for the given chroots in the order they are given. |
|
Cancels builds with particular states. |
|
Deletes builds with particular states. |
|
Attempts to delete the project if it exists and cancels builds before. |
|
Forks the project from the given source into the target project. |
|
Make or edits packages in a copr project. |
|
Make or edits a project |
|
Checks if a project exists. |
|
The base class for all actions. |
|
Regenerates the repositories for the given project. |
|
Allows you to walk over each build filtered by state and chroot. |
|
Any class that needs a copr client property can derive from this class |
|
The base class for package building Actions in Copr |
|
CoprProjectRef is a reference to a Copr project by ownername and projectname. |
Attributes¶
- llvm_snapshot_builder.__version__¶
- class llvm_snapshot_builder.CoprActionBuildAllPackages(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], chroots: list[str] = None, timeout: int = None, **kwargs)[source]¶
Bases:
llvm_snapshot_builder.mixins.client_mixin.CoprClientMixin,llvm_snapshot_builder.mixins.package_builder_mixin.CoprPackageBuilderMixin,llvm_snapshot_builder.actions.action.CoprActionBuilds everyting for the given chroots and creates optimal Copr batches. See https://docs.pagure.org/copr.copr/user_documentation.html#build-batches.
NOTE: We kick-off builds for each chroot individually so that an x86_64 build doesn’t have to wait for a potentially slower s390x build.
- class llvm_snapshot_builder.CoprActionBuildPackages(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], package_names: list[str] = None, chroots: list[str] = None, wait_on_build_id: int = None, timeout: int = None, **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixin,llvm_snapshot_builder.mixins.package_builder_mixin.CoprPackageBuilderMixinBuilds a list of packages for the given chroots in the order they are given.
NOTE: We kick-off builds for each chroot individually so that an x86_64 build doesn’t have to wait for a potentially slower s390x build.
- class llvm_snapshot_builder.CoprActionCancelBuilds(states: list[str] = None, **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixin,llvm_snapshot_builder.mixins.build_walker_mixin.CoprBuildWalkerMixinCancels builds with particular states.
- cancel_states¶
states to cancel
- Type:
list
- cancel_states = ['pending', 'waiting', 'running', 'importing']¶
- class llvm_snapshot_builder.CoprActionDeleteBuilds(states: list[str] = None, **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixin,llvm_snapshot_builder.mixins.build_walker_mixin.CoprBuildWalkerMixinDeletes builds with particular states.
- delete_states¶
states to cancel
- Type:
list
- delete_states = ['pending', 'waiting', 'running', 'importing']¶
- class llvm_snapshot_builder.CoprActionDeleteProject(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixinAttempts to delete the project if it exists and cancels builds before.
- class llvm_snapshot_builder.CoprActionForkProject(source: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], target: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixinForks the project from the given source into the target project.
- class llvm_snapshot_builder.CoprActionCreatePackages(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], packagenames: list[str] = None, update: bool = False, **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixinMake or edits packages in a copr project. NOTE: This doesn’t build the packages!
- default_package_names¶
the default packages to create/edit if not specified
- Type:
list[str]
- default_package_names = ['python-lit', 'llvm', 'compiler-rt', 'lld', 'clang', 'mlir', 'libomp']¶
- class llvm_snapshot_builder.CoprActionCreateProject(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], description: str = '', instructions: str = '', chroots: list[str] = None, delete_after_days: int = 0, update: bool = False, **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixinMake or edits a project
- default_chroots¶
The default chroots to use for the project when creating
- Type:
list
- runtime_dependencies¶
List of external repositories (== dependencies, specified as baseurls) that will be automatically enabled together with this project repository.
- Type:
list
- default_chroots = ['fedora-rawhide-x86_64']¶
- runtime_dependencies = 'https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/fedor...'¶
- class llvm_snapshot_builder.CoprActionProjectExists(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], **kwargs)[source]¶
Bases:
llvm_snapshot_builder.actions.action.CoprAction,llvm_snapshot_builder.mixins.client_mixin.CoprClientMixinChecks if a project exists.
- class llvm_snapshot_builder.CoprAction(**kwargs)[source]¶
Bases:
abc.ABCThe base class for all actions.
- class llvm_snapshot_builder.CoprActionRegenerateRepos(proj: Union[llvm_snapshot_builder.copr_project_ref.CoprProjectRef, str], **kwargs)[source]¶
Bases:
llvm_snapshot_builder.mixins.client_mixin.CoprClientMixin,llvm_snapshot_builder.actions.action.CoprActionRegenerates the repositories for the given project. NOTE: The regeneration of repository data is not finished when this function returns.
- class llvm_snapshot_builder.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.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.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
- class llvm_snapshot_builder.CoprProjectRef(owner_project: Union[str, CoprProjectRef], **kwargs)[source]¶
CoprProjectRef is a reference to a Copr project by ownername and projectname.
- property owner: str¶
Returns the ownername that references this project
- property name: str¶
Returns the projectname that references this project
- property ref: str¶
Returns the ownername/projectname string