:py:mod:`anod.package` ====================== .. py:module:: anod.package .. autoapi-nested-parse:: Binary and source package management for Anod. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anod.package.Package anod.package.Source anod.package.SharedSource anod.package.SourceBuilder anod.package.UnmanagedSourceBuilder anod.package.ThirdPartySourceBuilder anod.package.ExternalSourceBuilder Attributes ~~~~~~~~~~ .. autoapisummary:: anod.package.PrepareSrcCB .. py:data:: PrepareSrcCB .. py:class:: Package(prefix: str, publish: bool = False, version: collections.abc.Callable[[], str] | None = None, *, anod_instance: e3.anod.spec.Anod | None = None) Describe and generate a binary package. .. py:property:: is_simple_archive :type: bool Check if package creation can be bypassed. If true it means that package creation can be bypassed in some context such as user mode. By default it is True .. py:method:: pkg_name(anod_instance: e3.anod.spec.Anod | None = None) -> str Return the final package filename. :param anod_instance: the Anod instance that creates the package :return: the name without extension of the package filename .. py:method:: pkg_path(anod_instance: e3.anod.spec.Anod | None = None) -> str Return the full path in which a package will be generated. :param anod_instance: the Anod instance that creates the package :return: the full path to the generated archive .. py:method:: create_package(anod_instance: e3.anod.spec.Anod | None = None) -> str Generate a package as a ZIP archive. :param anod_instance: the Anod instance that creates the package :return: the full path to the generated archive .. py:class:: Source(name: str, publish: bool, dest: str | None = None, unpack_cmd: collections.abc.Callable | None = None, remove_root_dir: bool = True, ignore: None = None) Source package. .. py:property:: ignore :type: list[str] Return list of paths to ignore when installing the source. By default, a source package is first unpacked and then install in the `dest` directory by using e3.fs.sync_tree. The ignore property returns a value that can be passed to e3.fs.sync_tree. .. py:method:: set_builder(builder_function: SourceBuilder) -> None Set the SourceBuilder associated to this Source object. :param builder_function: the source builder to associate .. py:method:: set_other_sources(other_sources: list[Source]) -> None Get the list of other sources to compute ``ignore`` property. :param other_sources: list of other Source objects .. py:class:: SharedSource(name: str, publish: bool, dest: str | None = None, unpack_cmd: collections.abc.Callable | None = None, remove_root_dir: bool = True, ignore: None = None) Bases: :py:obj:`Source` Shared sources are installed directly in the sandbox. This is useful when you need to use the same sources for different modules/platforms and you don't need to write in the sources directory .. py:class:: SourceBuilder(name: str, fullname: collections.abc.Callable[[], str], checkout: list[str] | None, prepare_src: PrepareSrcCB | None = None, apply_patch: Literal[1] | ApplyPatchCB | None = None, kind: str = 'source', *, anod_instance: e3.anod.spec.Anod | None = None) Builder for creating source packages from source repositories. .. py:property:: prepare_src :type: PrepareSrcCB | None Return the callback used to prepare the source package. :return: the callback or None if no prepare_src is defined :raise: SpecError .. py:property:: apply_patch :type: ApplyPatchCB Return the callback used to apply a patch. :return: the callback .. py:attribute:: DEFAULT_PATCH_CMD :type: Final :value: 1 .. py:method:: fullname(*args: Any, **kwargs: Any) -> str Return the full name of the source package. :param args: arguments passed to the fullname callback :param kwargs: keyword arguments passed to the fullname callback :return: the full package name .. py:class:: UnmanagedSourceBuilder(name: str, fullname: collections.abc.Callable[[], str], checkout: list[str] | None, prepare_src: PrepareSrcCB | None = None, apply_patch: Literal[1] | ApplyPatchCB | None = None, kind: str = 'source', *, anod_instance: e3.anod.spec.Anod | None = None) Bases: :py:obj:`SourceBuilder` Source builder for sources not managed by anod. .. py:property:: prepare_src :type: None Do not create source package. .. py:class:: ThirdPartySourceBuilder(name: str) Bases: :py:obj:`UnmanagedSourceBuilder` SourceBuilder for thirdparty packages. .. py:class:: ExternalSourceBuilder(name: str, bid: str | None = None, setup: str | None = None, date: str | None = None, query_name: str | None = None) Bases: :py:obj:`UnmanagedSourceBuilder` SourceBuilder to reference sources produced outside the setup.