fedrq.backends.base¶
PackageQueryAlias
module-attribute
¶
BackendMod ¶
Bases: Protocol
Protocol for a fedrq backend module.
Each backend module (e.g.
fedrq.backends.dnf.backend
)
implements this interface.
BaseMakerBase ¶
Create a Base object, set configuration, and load repos
Source code in src/fedrq/backends/base/__init__.py
create_repo
abstractmethod
¶
Add a Repo object to the repo sack and configure it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repoid
|
str
|
Repository ID |
required |
kwargs
|
Any
|
key-values options that should be set on the Repo object values (like $basearch) will be substituted automatically. |
{}
|
Source code in src/fedrq/backends/base/__init__.py
disable_repo
abstractmethod
¶
Disable a repo by its id.
Raise a ValueError if the repoid is not in self.base
’s configuration
when ignore_missing is False.
Source code in src/fedrq/backends/base/__init__.py
enable_repo
abstractmethod
¶
Enable a repo by its id.
Raise a ValueError if the repoid is not in self.base
’s configuration.
enable_repos
abstractmethod
¶
Enable a list of repositories by their repoid.
Raise a ValueError if the repoid is not in self.base
’s configuration.
enable_source_repos
abstractmethod
¶
Enable the corresponding -source repos of the currently enabled repositories
fill_sack
abstractmethod
¶
Fill the sack and returns the Base object. The repository configuration shouldn’t be manipulated after this. ‘from_cache’ isn’t currently supported by the libdnf5 backend.
Source code in src/fedrq/backends/base/__init__.py
load_changelogs
abstractmethod
¶
Load changelog metadata
Parameters:
Name | Type | Description | Default |
---|---|---|---|
enable
|
bool
|
Whether to enable or disable filelists |
True
|
load_filelists ¶
Load the filelists if they’re not already enabled by default
Parameters:
Name | Type | Description | Default |
---|---|---|---|
enable
|
bool
|
Whether to enable or disable filelists |
True
|
Source code in src/fedrq/backends/base/__init__.py
load_release_repos ¶
Load the repositories from a fedrq.config.Release object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
release
|
Release
|
|
required |
set_releasever
|
bool
|
Whether to set the |
True
|
Source code in src/fedrq/backends/base/__init__.py
read_repofile
abstractmethod
¶
read_system_repos
abstractmethod
¶
Load system repositories into the base object. By default, they are all disabled even if ‘enabled=1’ is in the repository configuration.
Source code in src/fedrq/backends/base/__init__.py
repolist
abstractmethod
¶
set
abstractmethod
¶
set_var
abstractmethod
¶
Set substitutions (e.g. arch, basearch, releasever). Needs to be called before reading repos.
sets ¶
Set options on the base object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
conf
|
dict[str, Any]
|
A dict of configuration options. Call self.set() for each k-v pair. |
required |
substitutions
|
dict[str, Any]
|
A dict of substitutions/vars options. Call self.set_var() for each k-v pair. |
required |
Source code in src/fedrq/backends/base/__init__.py
ChangelogEntry
dataclass
¶
NEVRAFormsCompat ¶
PackageCompat ¶
PackageQueryCompat ¶
Bases: Generic[_PackageT]
Common PackageQuery interface provided by hawkey.Query and other backends.
When annotating function parameters and return values,
use PackageQueryAlias
instead of
directly annotating with this type.
difference
abstractmethod
¶
Return the difference between self
and other
(packages that are in self
but not other
).
Depending on the backend, this either modifies ‘self’ in place and
returns ‘self’ or returns a new PackageQuery object.
Source code in src/fedrq/backends/base/__init__.py
filter
abstractmethod
¶
Filter the PackageQuery. Depending on the backend, this either modifies ‘self’ in place and return ‘self’ or return a new PackageQuery object. See https://dnf.readthedocs.io/en/latest/api_queries.html#dnf.query.Query.filter for the allowed kwargs.
Source code in src/fedrq/backends/base/__init__.py
filterm
abstractmethod
¶
Filter the PackageQuery in place and return ‘self’. See https://dnf.readthedocs.io/en/latest/api_queries.html#dnf.query.Query.filter for the allowed kwargs.
Source code in src/fedrq/backends/base/__init__.py
intersection
abstractmethod
¶
Return the difference between self
and other
(packages that are in both self
and other
).
Depending on the backend, this either modifies ‘self’ in place and
returns ‘self’ or returns a new PackageQuery object.
Source code in src/fedrq/backends/base/__init__.py
union
abstractmethod
¶
Combine two PackageQuery objects. Depending on the backend, this either modifies ‘self’ in place and returns ‘self’ or returns a new PackageQuery object.
Source code in src/fedrq/backends/base/__init__.py
RepoqueryBase ¶
Bases: Generic[_PackageT]
Helpers to query a repository.
Provides a unified repoquery interface for different backends.
When annotating function parameters and return values,
use RepoqueryAlias
instead of
directly annotating with this type.
Source code in src/fedrq/backends/base/__init__.py
base_arches
abstractmethod
property
¶
Return a set of the system’s arch and basearch.
arch_filter ¶
arch_filter(
query: PackageQueryCompat,
arch: str | Iterable[str] | None = None,
) -> PackageQueryCompat[_PackageT]
Filter a query’s architectures and return it. It includes a little more functionality than query.filter(arch=…).
- When arch is None, the query is left untouched.
- If arch equals ‘notsrc’, all src and multilib packages are excluded.
- If arch equals ‘arched’, all noarch, multilib, and source packages are excluded.
- Otherwise, arch is passed to query.filterm(arch=…) and no other validation is preformed.
Source code in src/fedrq/backends/base/__init__.py
arch_filterm ¶
arch_filterm(
query: PackageQueryCompat,
arch: str | Iterable[str] | None = None,
) -> PackageQueryCompat[_PackageT]
Filter a query’s architectures in place and return it. It includes a little more functionality than query.filterm(arch=…).
- When arch is None, the query is left untouched.
- If arch equals ‘notsrc’, all src and multilib packages are excluded.
- If arch equals ‘arched’, all noarch, multilib, and source packages are excluded.
- Otherwise, arch is passed to query.filterm(arch=…) and no other validation is preformed.
Source code in src/fedrq/backends/base/__init__.py
get_package ¶
Return the latest Package that matches the ‘name’ and ‘arch’. A ValueError is raised when no matches are found.
Source code in src/fedrq/backends/base/__init__.py
get_subpackages ¶
Return a PackageQuery containing the binary RPMS/subpackages produced by {packages}.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
packages
|
Iterable[PackageCompat]
|
An interable of |
required |
Source code in src/fedrq/backends/base/__init__.py
query ¶
Return an inital PackageQuery that’s filtered with **kwargs. Further filtering can be applied with the PackageQuery’s filter and filterm methods.
Source code in src/fedrq/backends/base/__init__.py
resolve_pkg_specs
abstractmethod
¶
resolve_pkg_specs(
specs: Collection[str],
resolve: bool = False,
latest: int | None = None,
with_src: bool = True,
*,
with_filenames: bool | None = None,
with_provides: bool | None = None,
resolve_provides: bool | None = None,
nevra_forms: list[int] | None = None
) -> PackageQueryCompat[_PackageT]
Resolve pkg specs. See https://dnf.readthedocs.io/en/latest/command_ref.html?highlight=spec#specifying-packages or https://dnf5.readthedocs.io/en/latest/misc/specs.7.html for valid forms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
specs
|
Collection[str]
|
Package specs to resolve. |
required |
resolve
|
bool
|
Whether to resolve file paths or virtual Provides in addition to package specs |
False
|
latest
|
int | None
|
Limit packages with the same name and arch. |
None
|
with_src
|
bool
|
Whether to consider |
True
|