diff --git a/doc/API/Summary.md b/doc/API/Summary.md index 64f784e..0044687 100644 --- a/doc/API/Summary.md +++ b/doc/API/Summary.md @@ -114,17 +114,23 @@ This example shows how to load the configuration and preform a basic query. # fedrq whatrequires --arch=noarch -b rawhide -r buildroot bash | grep '^a' from fedrq.config import get_config, RQConfig -from fedrq.backends.base import RepoqueryBase +# The get_config() function returns an RqConfig object. +# # Load config from filesystem and override some options -config: RQConfig = get_config(backend="libdnf5") +config = get_config(backend="libdnf5") -# Query the Fedora Rawhide koji buildroot repositories -# This supports any release configuration builtin to fedrq +# The RQConfig.get_rq() method returns a Repoquery object. +# Repoquery is fedrq's helper class to perform various types of package queries. +# +# This creates a Repoquery containing the Fedora Rawhide koji buildroot repositories. +# get_rq() supports any release configuration builtin to fedrq # or configured on your local system. -rq: RepoqueryBase = config.get_rq("rawhide", "buildroot") +rq = config.get_rq("rawhide", "buildroot") -# Get all noarch packages that start with 'a' and depend on bash +# The Repoquery.query() method returns a PackageQuery implementation. +# +# This gets all noarch packages that start with 'a' and depend on bash query = rq.query( name__glob="a*", arch="noarch", requires=rq.query(name="bash", arch="notsrc") ) diff --git a/src/fedrq/backends/base/__init__.py b/src/fedrq/backends/base/__init__.py index a4521a0..eccd9a6 100644 --- a/src/fedrq/backends/base/__init__.py +++ b/src/fedrq/backends/base/__init__.py @@ -178,8 +178,9 @@ class PackageCompat(Protocol): # pragma: no cover class PackageQueryCompat(Generic[_PackageT], metaclass=abc.ABCMeta): # pragma: no cover """ Common PackageQuery interface provided by hawkey.Query and other backends. - When using to annotate function parameters and return value, use - `PackageQueryAlias` instead of directly annotating with this type. + When annotating function parameters and return values, + use [`PackageQueryAlias`][fedrq.backends.base.PackageQueryAlias] instead of + directly annotating with this type. """ @abc.abstractmethod @@ -430,6 +431,9 @@ class RepoqueryBase(Generic[_PackageT], metaclass=abc.ABCMeta): """ Helpers to query a repository. Provides a unified repoquery interface for different backends. + When annotating function parameters and return values, + use [`RepoqueryAlias`][fedrq.backends.base.RepoqueryAlias] instead of + directly annotating with this type. """ def __init__(self, base) -> None: