:py:mod:`anod.store.buildinfo` ============================== .. py:module:: anod.store.buildinfo .. autoapi-nested-parse:: Build information management for Anod store. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anod.store.buildinfo.BuildInfo Attributes ~~~~~~~~~~ .. autoapisummary:: anod.store.buildinfo.BuildInfoType anod.store.buildinfo.logger .. py:data:: BuildInfoType .. py:data:: logger .. py:class:: BuildInfo(build_date: str, setup: str, creation_date: str, id: str, build_version: str, isready: bool, store: e3.anod.store.interface.StoreReadInterface | e3.anod.store.interface.StoreRWInterface | None = None) BuildInfo structure. :ivar build_date: The build date. :vartype build_date: str :ivar setup: The build setup. :vartype setup: str :ivar creation_date: The build's creation date. :vartype creation_date: str :ivar id: The build's ID. :vartype id: str :ivar build_version: The build version. ??? Deserve a better description. :vartype build_version: str :ivar isready: True if the build is complete and ready to be downloaded. False otherwise. :vartype isready: bool .. py:attribute:: __hash__ .. py:method:: load(data: BuildInfoDict, store: e3.anod.store.interface.StoreReadInterface | e3.anod.store.interface.StoreRWInterface | None = None) -> typing_extensions.Self :classmethod: Create a BuildInfo from the result of a Store build info request. :param data: dictionary returned by Store after a build info request :param store: a Store instance :return: a BuildInfo instance .. py:method:: __str__() -> str Convert a buildinfo to a str. .. py:method:: __eq__(other: object) -> bool Compare two buildinfo object. :param other: the other object to compare with the current one. :return: False if other is not a buildinfo or if other is different to the current buildinfo. .. py:method:: __ne__(other: object) -> bool Inverse of self.__eq__. :return: True if not self.__eq__(other). .. py:method:: get_build_data() -> e3.anod.store.interface.BuildDataDict Call self.store.get_build_data. :raises AttributeError: If self.store is None. :return: Same as StoreReadInterface.get_build_data. .. py:method:: mark_ready() -> bool Call self.store.mark_build_ready. :raises AttributeError: If self.store is None or not a StoreWriteInterface. :return: True in case of success, False otherwise. .. py:method:: get_source_list() -> list[e3.anod.store.file.File] Get the list of source files associated to our BuildInfo object. :raises AttributeError: If self.store is None. :return: A list of File objects. .. py:method:: get_source_info(name: str, kind: str = 'source') -> e3.anod.store.file.File Return the File with the given name and kind. :param name: the file object name. :param kind: the file object kind. :raises AttributeError: If self.store is None. :return: A File. .. py:method:: get_component(name: str, platform: str) -> e3.anod.store.component.Component Get a component for a given build id. :param name: component name :param platform: platform :raises AttributeError: If self.store is None. :return: a component .. py:method:: get_component_list(name: str = 'all', platform: str = 'all') -> list[e3.anod.store.component.Component] Get a component list for the given build id. :param name: component name :param platform: platform name :raises AttributeError: If self.store is None. :return: A list of Component. .. py:method:: previous_build_date(build_date: str) -> str :classmethod: Given a build date return the previous one. :param build_date: a build date :return: the build date before the one passed as parameter .. py:method:: latest(store: e3.anod.store.interface.StoreReadInterface | e3.anod.store.interface.StoreRWInterface, setup: str, build_version: str = 'all', build_date: str | None = 'all', *, ready_only: bool = True, build_id: str | None = None, days_limit: int = 1) -> typing_extensions.Self :classmethod: Find a build. :param store: A Store instance. :param setup: A setup name. :param build_version: The build version. :param build_date: The build date, in 'YYYYMMDD' format. If None or 'all', the latest BuildInfo with any date is selected. :param ready_only: If True (default), return only build ids that are in a ready state. :param build_id: if not None look only for the given build_id. The returned build object should match setup and optionally build_version and or build_date. :param days_limit: if build_id is None and build_date is set then look for prior days in case there is no build at the given build_date. The parameter specify the number of days the call is allowed to look back before raising a StoreError. :return: A build object. .. py:method:: list(store: e3.anod.store.interface.StoreReadInterface | e3.anod.store.interface.StoreRWInterface, build_date: str = 'all', setup: str = 'all', build_version: str = 'all', nb_days: int = 1) -> list[typing_extensions.Self] :classmethod: Find a build in a date range. :param store: Store instance to get build list from. :param build_date: build date, in 'YYYYMMDD' format the returned build info should match (along with *nb_days*). :param setup: setup the returned build info should match. :param build_version: version the returned build info should match. :param nb_days: maximum number of days to retrieve. :return: A build object .. py:method:: create(store: e3.anod.store.interface.StoreRWInterface, setup: str, version: str, date: str | None = None, *, mark_ready: bool = False) -> typing_extensions.Self :classmethod: Create a new build id. :param store: The store instance to use. Must be able to write. :param setup: setup name. :param version: version. :param date: build date. :param mark_ready: Mark the buildinfo as ready after creating it. .. py:method:: from_id(store: e3.anod.store.interface.StoreReadInterface | e3.anod.store.interface.StoreRWInterface, build_id: str) -> typing_extensions.Self :classmethod: Return a build object based on its id. :param store: Store instance. :param build_id: the build id. :return: a BuildInfo object. .. py:method:: today_build_date() -> str :classmethod: Return the today build date using the YYYYMMDD format. The today build date is the current date minus 1 day. .. py:method:: wait(store: e3.anod.store.interface.StoreReadInterface | e3.anod.store.interface.StoreRWInterface, setup: str, build_date: str | None = None, timeout: float = 36000.0, retry_delay: float = 60.0) -> typing_extensions.Self :classmethod: Wait until the today buildinfo is available. :param store: the store instance used. :param setup: the setup of the buildinfo waited. :param build_date: the date of the build info to wait for. :param timeout: the global amount of time to wait. :param retry_delay: the amount of time to wait before trying again in the loop. :return: a buildinfo object. :raises E3Error: If the timeout is exceeded. .. py:method:: copy(dest_setup: str, mark_as_ready: bool = True) -> typing_extensions.Self Copy the current build id into another setup. Note that only sources elements are copied. :param dest_setup: setup of new build id :param mark_as_ready: if True mark the resulting build id as ready :raises AttributeError: If self.store is None or not a StoreWriteInterface. :return: a BuildInfo object .. py:method:: as_dict() -> BuildInfoDict Return a dictionary representation of self. Feeding to this class' "load" method the value returned by this method creates a new BuildInfo value that is equal to self. :return: The dictionary representation of self. .. py:method:: to_dict() -> BuildInfoDict Return a dictionary representation of self. This function is only here for compatibility purpose and will be removed later. .. seealso:: py:meth:`as_dict`.