fedrq.config¶
This module houses code to load configuration from the filesystem and validate it.
Classes:
-
LoadFilelists– -
RQConfig– -
Release–Encapsulates a ReleaseConfig with a specific version and repo name.
-
ReleaseConfig–
Functions:
-
get_config–Retrieve config files from CONFIG_DIRS and fedrq.data
-
get_smartcache_basedir–
Attributes:
LoadFilelists
¶
Bases: StrEnum
Methods:
Attributes:
RQConfig
¶
Bases: BaseModel
Classes:
-
Config–
Methods:
-
get_dnf_rq–Shortcut to create a Repoquery object using the dnf backend
-
get_libdnf5_rq–Shortcut to create a Repoquery object using the libdnf5 backend
-
get_release– -
get_rq–Higher level interface that finds the Release object that mathces
Attributes:
-
backend(Optional[str]) – -
backend_mod(BackendMod) – -
copr_baseurl(str) – -
default_branch(str) – -
load_filelists(LoadFilelists) – -
load_other_metadata(Optional[bool]) – -
release_names(list[str]) – -
releases(dict[str, ReleaseConfig]) – -
smartcache(Union[bool, Literal['always']]) –
Config
¶
Attributes:
-
json_encoders(dict[Any, Callable[[Any], str]]) – -
validate_assignment–
get_dnf_rq
¶
get_dnf_rq(
branch: str | None = None,
repo: str | None = None,
base_conf: dict[str, Any] | None = None,
base_vars: dict[str, Any] | None = None,
) -> _dnfRepoquery
Shortcut to create a Repoquery object using the dnf backend
Source code in src/fedrq/config.py
get_libdnf5_rq
¶
get_libdnf5_rq(
branch: str | None = None,
repo: str | None = None,
base_conf: dict[str, Any] | None = None,
base_vars: dict[str, Any] | None = None,
) -> _libdnf5RepoQuery
Shortcut to create a Repoquery object using the libdnf5 backend
Source code in src/fedrq/config.py
get_release
¶
Source code in src/fedrq/config.py
get_rq
¶
get_rq(
branch: str | None = None,
repo: str | None = None,
base_conf: dict[str, Any] | None = None,
base_vars: dict[str, Any] | None = None,
) -> RepoqueryBase[PackageCompat]
Higher level interface that finds the Release object that mathces {branch} and {repo}, creates a (lib)dnf(5).base.Base session, and returns a Repoquery object.
Parameters:
-
branch(str | None, default:None) –Branch name. Defaults to self.default_branch.
-
repo(str | None, default:None) –repo class. defaults to ‘base’.
-
base_conf(dict[str, Any] | None, default:None) –Base session configuration
-
base_vars(dict[str, Any] | None, default:None) –Base session vars/substitutions (arch, basearch, releasever, etc.)
Source code in src/fedrq/config.py
Release
¶
Encapsulates a ReleaseConfig with a specific version and repo name.
This SHOULD NOT be instantiated directly.
The init() has no stability promises.
Use the RQConfig.get_release()
factory instead.
Methods:
Attributes:
-
branch– -
config– -
copr_chroot_fmt(str | None) – -
koschei_collection(str | None) – -
release_config– -
repo_name– -
repog(RepoG) – -
version(str) –
Source code in src/fedrq/config.py
get_repog
¶
make_base
¶
make_base(
config: RQConfig | None = None,
base_conf: dict[str, Any] | None = None,
base_vars: dict[str, Any] | None = None,
base_maker: BaseMakerBase | None = None,
fill_sack: bool = True,
) -> dnf.Base | libdnf5.base.Base
Parameters:
-
config(RQConfig | None, default:None) –An RQConfig object. If this is not passed,
self.configis used. -
base_conf(dict[str, Any] | None, default:None) –Base session configuration
-
base_vars(dict[str, Any] | None, default:None) –Base session vars/substitutions (arch, basearch, releasever, etc.)
-
base_maker(BaseMakerBase | None, default:None) –Existing BaseMaker object to configure. If base_maker is None, a new one will be created.
-
fill_sack(bool, default:True) –Whether to fill the Base object’s package sack or just return the Base object after applying configuration.
Source code in src/fedrq/config.py
ReleaseConfig
¶
Bases: BaseModel
Classes:
-
Config–
Methods:
-
get_release– -
is_match– -
is_valid_repo–
Attributes:
-
append_system_repos(bool) – -
copr_chroot_fmt(Optional[str]) – -
defpaths(set[str]) – -
defs(dict[str, list[str]]) – -
full_def_paths(list[Union[Traversable, Path]]) – -
koschei_collection(Optional[str]) – -
matcher(Pattern) – -
name(str) – -
repo_aliases(dict[str, str]) – -
repo_dirs(list[Path]) – -
repogs(Repos) – -
system_repos(bool) – -
version(Optional[str]) –
get_config
¶
Retrieve config files from CONFIG_DIRS and fedrq.data and merge configuration sources. Read supported environment variables ($FEDRQ_BRANCH and $FEDRQ_BACKEND) and allow them to override config file values if set. Config options passed as keyword-arguments to this function override both config file values and environment variables.