fedrq.backends.base¶
Modules:
-
experimental
–This module (and the other experimental modules in fedrq) are not meant for public use.
Classes:
-
BackendMod
–Protocol for a fedrq backend module.
-
BaseMakerBase
–Create a Base object, set configuration, and load repos
-
ChangelogEntry
–Data class for changelog entry data.
-
NEVRAFormsCompat
– -
PackageCompat
–Common interface provided by dnf.package.Package and other backends
-
PackageQueryCompat
–Common PackageQuery interface provided by hawkey.Query and other backends.
-
RepoqueryBase
–Helpers to query a repository.
Attributes:
BackendMod
¶
Bases: Protocol
Protocol for a fedrq backend module.
Each backend module (e.g.
fedrq.backends.dnf.backend
)
implements this interface.
Attributes:
-
BACKEND
(str
) – -
BaseMaker
(type[BaseMakerBase]
) – -
NEVRAForms
(type[NEVRAFormsCompat]
) – -
Package
(type[PackageCompat]
) – -
PackageQuery
(type[PackageQueryCompat]
) – -
PackageQueryAlias
(type[PackageQueryCompat]
) – -
RepoError
(type[BaseException]
) – -
Repoquery
(type[RepoqueryBase]
) – -
get_changelogs
(_get_changelogs
) – -
get_releasever
(Callable[[], str]
) –
BaseMakerBase
¶
Create a Base object, set configuration, and load repos
Methods:
-
create_repo
–Add a Repo object to the repo sack and configure it.
-
disable_repo
–Disable a repo by its id.
-
enable_repo
–Enable a repo by its id.
-
enable_repos
–Enable a list of repositories by their repoid.
-
enable_source_repos
–Enable the corresponding -source repos of the currently enabled
-
fill_sack
–Fill the sack and returns the Base object.
-
load_changelogs
–Load changelog metadata
-
load_filelists
–Load the filelists if they’re not already enabled by default
-
load_release_repos
–Load the repositories from a fedrq.config.Release object
-
read_repofile
–Load repositories from a repo file
-
read_system_repos
–Load system repositories into the base object.
-
repolist
–List available repoids.
-
set
–Set configuration options. Must be called before reading repos.
-
set_var
–Set substitutions (e.g. arch, basearch, releasever).
-
sets
–Set options on the base object
Attributes:
-
backend
(BackendMod
) –Return the backend’s module
-
base
(Any
) – -
conf
(Any
) –Return the backend’s Config object
Source code in src/fedrq/backends/base/__init__.py
create_repo
abstractmethod
¶
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
¶
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:
-
enable
(bool
, default:True
) –Whether to enable or disable filelists
load_filelists
¶
Load the filelists if they’re not already enabled by default
Parameters:
-
enable
(bool
, default:True
) –Whether to enable or disable filelists
Source code in src/fedrq/backends/base/__init__.py
load_release_repos
¶
Load the repositories from a fedrq.config.Release object
Parameters:
-
release
(Release
) –Release
object -
set_releasever
(bool
, default:True
) –Whether to set the
$releasever
based on the release or just leave it alone
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
¶
List available repoids.
Parameters:
-
enabled
(bool | None
, default:None
) –Only show enabled repositories
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:
-
conf
(dict[str, Any]
) –A dict of configuration options. Call self.set() for each k-v pair.
-
substitutions
(dict[str, Any]
) –A dict of substitutions/vars options. Call self.set_var() for each k-v pair.
Source code in src/fedrq/backends/base/__init__.py
ChangelogEntry
dataclass
¶
NEVRAFormsCompat
¶
PackageCompat
¶
Bases: Protocol
Common interface provided by dnf.package.Package and other backends
Methods:
Attributes:
-
a
(str
) – -
arch
(str
) – -
buildtime
(int
) – -
conflicts
(Iterable[Any]
) – -
debug_name
(str
) – -
description
(str
) – -
downloadsize
(int
) – -
e
(int
) – -
enhances
(Iterable[Any]
) – -
epoch
(int
) – -
evr
(str
) – -
files
(Iterable[str]
) – -
from_repo
(str
) – -
installsize
(int
) – -
installtime
(int
) – -
license
(str
) – -
location
(str
) – -
name
(str
) – -
obsoletes
(Iterable[Any]
) – -
packager
(str
) – -
provides
(Iterable[Any]
) – -
r
(str
) – -
reason
(Optional[str]
) – -
recommends
(Iterable[Any]
) – -
release
(str
) – -
repo
(Any
) –Return the package’s Repo object.
-
repoid
(str
) – -
reponame
(str
) – -
requires
(Iterable[Any]
) – -
size
(int
) – -
source_debug_name
(str
) – -
source_name
(Optional[str]
) – -
sourcerpm
(Optional[str]
) – -
suggests
(Iterable[Any]
) – -
summary
(str
) – -
supplements
(Iterable[Any]
) – -
url
(str
) – -
v
(str
) – -
vendor
(str
) – -
version
(str
) –
repo
property
¶
Return the package’s Repo object. The exact object depends on which backend is used.
PackageQueryCompat
¶
Bases: Iterable[_PackageT_co]
, Generic[_PackageT_co]
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.
Methods:
-
difference
–Return the difference between
self
andother
-
filter
–Filter the PackageQuery.
-
filterm
–Filter the PackageQuery in place and return ‘self’.
-
intersection
–Return the difference between
self
andother
-
union
–Combine two PackageQuery objects.
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_co, _PackageQueryT_co]
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.
Methods:
-
arch_filter
–Filter a query’s architectures and return it.
-
arch_filterm
–Filter a query’s architectures in place and return it.
-
get_package
–Return the latest Package that matches the ‘name’ and ‘arch’.
-
get_subpackages
–Return a PackageQuery containing the binary RPMS/subpackages produced
-
query
–Return an inital PackageQuery that’s filtered with **kwargs.
-
resolve_pkg_specs
–Resolve pkg specs.
Attributes:
-
backend
(BackendMod
) –Return backend module
-
base
– -
base_arches
(set[str]
) –Return a set of the system’s arch and basearch.
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
¶
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
¶
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:
-
packages
(Iterable[_PackageT]
) –An interable of
PackageCompat
containing source packages
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
) -> _PackageQueryT_co
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:
-
specs
(Collection[str]
) –Package specs to resolve.
-
resolve
(bool
, default:False
) –Whether to resolve file paths or virtual Provides in addition to package specs
-
latest
(int | None
, default:None
) –Limit packages with the same name and arch.
-
with_src
(bool
, default:True
) –Whether to consider
.src
packages when resolvingspecs