tmt.package_managers package
Submodules
tmt.package_managers.apk module
- class tmt.package_managers.apk.Apk(*, guest: Guest, logger: Logger)
Bases:
PackageManagerInitialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str = 'apk'
- check_presence(*installables: Package | FileSystemPath | PackagePath | PackageUrl) dict[Package | FileSystemPath | PackagePath | PackageUrl, bool]
Return a presence status for each given installable
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- install(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- install_command = <tmt.utils.Command object>
- install_debuginfo(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- path_to_package(path: FileSystemPath) Package
Find a package providing given filesystem path.
This is not easily possible in Alpine. There is apk-file utility available but it seems unrealiable. Support only a fixed set of mappings until a better solution is available.
- probe_command: Command = <tmt.utils.Command object>
A command to run to check whether the package manager is available on a guest.
- reinstall(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
tmt.package_managers.apt module
- class tmt.package_managers.apt.Apt(*, guest: Guest, logger: Logger)
Bases:
PackageManagerInitialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str = 'apt'
- check_presence(*installables: Package | FileSystemPath | PackagePath | PackageUrl) dict[Package | FileSystemPath | PackagePath | PackageUrl, bool]
Return a presence status for each given installable
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- install(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- install_command = <tmt.utils.Command object>
- install_debuginfo(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- path_to_package(path: FileSystemPath) Package
Find a package providing given filesystem path.
This is not trivial as some are used to from
yumordnf, it requires installation ofapt-fileutility and building an index of packages and filesystem paths.
- probe_command: Command = <tmt.utils.Command object>
A command to run to check whether the package manager is available on a guest.
- reinstall(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
tmt.package_managers.dnf module
- class tmt.package_managers.dnf.Dnf(*, guest: Guest, logger: Logger)
Bases:
PackageManagerInitialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str = 'dnf'
- check_presence(*installables: Package | FileSystemPath | PackagePath | PackageUrl) dict[Package | FileSystemPath | PackagePath | PackageUrl, bool]
Return a presence status for each given installable
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- install(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- install_debuginfo(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- probe_command: Command = <tmt.utils.Command object>
A command to run to check whether the package manager is available on a guest.
- probe_priority: int = 50
Package managers with higher value would be preferred when more one package manager is detected on guest. For most of the time, the default is sufficient, but some families of package managers (looking at you,
yum,dnf,dnf5,rpm-ostree!) may be installed togethers, and therefore a priority is needed.
- reinstall(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- skip_missing_debuginfo_option = '--skip-broken'
- skip_missing_packages_option = '--skip-broken'
- class tmt.package_managers.dnf.Dnf5(*, guest: Guest, logger: Logger)
Bases:
DnfInitialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str = 'dnf5'
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- probe_command: Command = <tmt.utils.Command object>
A command to run to check whether the package manager is available on a guest.
- probe_priority: int = 60
Package managers with higher value would be preferred when more one package manager is detected on guest. For most of the time, the default is sufficient, but some families of package managers (looking at you,
yum,dnf,dnf5,rpm-ostree!) may be installed togethers, and therefore a priority is needed.
- skip_missing_packages_option = '--skip-unavailable'
- class tmt.package_managers.dnf.Yum(*, guest: Guest, logger: Logger)
Bases:
DnfInitialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str = 'yum'
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- install(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- probe_command: Command = <tmt.utils.Command object>
A command to run to check whether the package manager is available on a guest.
- probe_priority: int = 40
Package managers with higher value would be preferred when more one package manager is detected on guest. For most of the time, the default is sufficient, but some families of package managers (looking at you,
yum,dnf,dnf5,rpm-ostree!) may be installed togethers, and therefore a priority is needed.
- reinstall(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
tmt.package_managers.rpm_ostree module
- class tmt.package_managers.rpm_ostree.RpmOstree(*, guest: Guest, logger: Logger)
Bases:
PackageManagerInitialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str = 'rpm-ostree'
- check_presence(*installables: Package | FileSystemPath | PackagePath | PackageUrl) dict[Package | FileSystemPath | PackagePath | PackageUrl, bool]
Return a presence status for each given installable
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- install(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- install_debuginfo(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- probe_command: Command = <tmt.utils.Command object>
A command to run to check whether the package manager is available on a guest.
- probe_priority: int = 100
Package managers with higher value would be preferred when more one package manager is detected on guest. For most of the time, the default is sufficient, but some families of package managers (looking at you,
yum,dnf,dnf5,rpm-ostree!) may be installed togethers, and therefore a priority is needed.
- reinstall(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
Module contents
- class tmt.package_managers.FileSystemPath(*args, **kwargs)
Bases:
PathA filesystem path provided by a package
- tmt.package_managers.Installable
All installable objects.
alias of
Package|FileSystemPath|PackagePath|PackageUrl
- class tmt.package_managers.Options(excluded_packages: list[tmt.package_managers.Package] = <factory>, skip_missing: bool = False, check_first: bool = True, install_root: Optional[tmt._compat.pathlib.Path] = None, release_version: Optional[str] = None, allow_untrusted: bool = False)
Bases:
object- allow_untrusted: bool = False
If set, instruct package manager to install from untrusted sources.
- check_first: bool = True
If set, check whether the package is already installed, and do not attempt to install it if it is already present.
- install_root: Path | None = None
If set, install packages under this path instead of the usual system root.
- release_version: str | None = None
If set, instruct package manager to behave as if the distribution release was
release_version.
- skip_missing: bool = False
If set, a failure to install a given package would not cause an error.
- class tmt.package_managers.Package
Bases:
strA package name
- class tmt.package_managers.PackageManager(*, guest: Guest, logger: Logger)
Bases:
CommonA base class for package manager plugins
Initialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- NAME: str
- check_presence(*installables: Package | FileSystemPath | PackagePath | PackageUrl) dict[Package | FileSystemPath | PackagePath | PackageUrl, bool]
Return a presence status for each given installable
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- install(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- install_debuginfo(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- probe_command: Command
A command to run to check whether the package manager is available on a guest.
- probe_priority: int = 0
Package managers with higher value would be preferred when more one package manager is detected on guest. For most of the time, the default is sufficient, but some families of package managers (looking at you,
yum,dnf,dnf5,rpm-ostree!) may be installed togethers, and therefore a priority is needed.
- reinstall(*installables: Package | FileSystemPath | PackagePath | PackageUrl, options: Options | None = None) CommandOutput
- class tmt.package_managers.PackagePath(*args, **kwargs)
Bases:
PathA path to a package file
- class tmt.package_managers.PackageUrl
Bases:
strA URL of a package file
- tmt.package_managers.escape_installables(*installables: Package | FileSystemPath | PackagePath | PackageUrl) Iterator[str]
- tmt.package_managers.find_package_manager(name: GuestPackageManager) PackageManagerClass
Find a package manager by its name.
- Raises:
GeneralError – when the plugin does not exist.
- tmt.package_managers.provides_package_manager(package_manager: str) Callable[[type[PackageManager]], type[PackageManager]]
A decorator for registering package managers.
Decorate a package manager plugin class to register a package manager.