anod.package
¶
Module Contents¶
Classes¶
Describe and generate a binary package. |
|
Source package. |
|
Shared sources are installed directly in the sandbox. |
|
Source builder for sources not managed by anod. |
|
SourceBuilder for thirdparty packages. |
|
SourceBuilder to reference sources produced outside the setup. |
Attributes¶
- anod.package.PrepareSrcCB¶
- class anod.package.Package(prefix: str, publish: bool = False, version: Callable[[], str] | None = None)¶
Describe and generate a binary package.
- property is_simple_archive: 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
- pkg_name(anod_instance: e3.anod.spec.Anod) str ¶
Return the final package filename.
- Parameters:
anod_instance – the Anod instance that creates the package
- Returns:
the name without extension of the package filename
- pkg_path(anod_instance: e3.anod.spec.Anod) str ¶
Return the full path in which a package will be generated.
- Parameters:
anod_instance – the Anod instance that creates the package
- Returns:
the full path to the generated archive
- create_package(anod_instance: e3.anod.spec.Anod) str ¶
Generate a package as a ZIP archive.
- Parameters:
anod_instance – the Anod instance that creates the package
- Returns:
the full path to the generated archive
- class anod.package.Source(name: str, publish: bool, dest: str | None = None, unpack_cmd: Callable | None = None, remove_root_dir: bool = True, ignore: None = None)¶
Source package.
- property ignore: 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.
- set_builder(builder_function: SourceBuilder) None ¶
Set the SourceBuilder associated to this Source object.
Bases:
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
- class anod.package.SourceBuilder(name: str, fullname: Callable[[], str], checkout: list[str] | None, prepare_src: PrepareSrcCB | None = None, apply_patch: Literal[1] | ApplyPatchCB | None = None, kind: str = 'source')¶
- property prepare_src: PrepareSrcCB | None¶
Return the callback used to prepare the source package.
- Returns:
the callback or None if no prepare_src is defined
- Raise:
SpecError
- property apply_patch: ApplyPatchCB¶
Return the callback used to apply a patch.
- Returns:
the callback
- DEFAULT_PATCH_CMD: Final = 1¶
- fullname(*args: Any, **kwargs: Any) str ¶
- class anod.package.UnmanagedSourceBuilder(name: str, fullname: Callable[[], str], checkout: list[str] | None, prepare_src: PrepareSrcCB | None = None, apply_patch: Literal[1] | ApplyPatchCB | None = None, kind: str = 'source')¶
Bases:
SourceBuilder
Source builder for sources not managed by anod.
- property prepare_src: None¶
Do not create source package.
- class anod.package.ThirdPartySourceBuilder(name: str)¶
Bases:
UnmanagedSourceBuilder
SourceBuilder for thirdparty packages.
- class anod.package.ExternalSourceBuilder(name: str, bid: str | None = None, setup: str | None = None, date: str | None = None, query_name: str | None = None)¶
Bases:
UnmanagedSourceBuilder
SourceBuilder to reference sources produced outside the setup.