I have been playing with the libdnf5 python bindings, and I’ve come across something I don’t understand. On an x86_64 Fedora 42 machine:
$ python3
Python 3.13.3 (main, Apr 22 2025, 00:00:00) [GCC 15.0.1 20250418 (Red Hat 15.0.1-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import libdnf5
>>> base = libdnf5.base.Base()
>>> base.load_config()
>>> base.setup()
>>> reposack = base.get_repo_sack()
>>> reposack.create_repos_from_system_configuration()
>>> reposack.load_repos(libdnf5.repo.Repo.Type_AVAILABLE)
>>> settings = libdnf5.base.ResolveSpecSettings()
>>> rpmq = libdnf5.rpm.PackageQuery(base)
>>> rpmq.resolve_pkg_spec('(python3dist(tomli) if python3-devel < 3.11)', settings, False)
(True, <libdnf5.rpm.Nevra; proxy of <Swig Object of type 'libdnf5::rpm::Nevra *' at 0x7f10dc695440> >)
>>> for pkg in rpmq:
... print(pkg.get_nevra())
...
python3-tomli-2.2.1-2.fc42.noarch
It looks like the rich dependency is not being evaluated as I expected, as no package in Fedora 42 provides python3-devel with a version less than 3.11. Is there an interface similar to resolve_pkg_spec
, or some tweak to settings, that will evaluate rich dependencies?