Bug#890876: python-apt: Provide API for versioned provides
Control: tag -1 confirmed
Control: retitle -1 python-apt: Provide high-level API for versioned provides
On Tue, Feb 20, 2018 at 09:43:41AM +0100, Philipp Hahn wrote:
> Package: python-apt
> Version: 1.4.0~beta3
> Severity: whistlist
>
> Dear Maintainer,
>
> I'm using python-apt to analyse inter-package-dependencies and just
> stumbled over "python-cffi-backend", which already uses versioned
> Provdies¹ in Debian-Stretch:
>
> import apt
> cache = apt.Cache()
> pkg = cache['python-cffi-backend']
> cand = pkg.candidate
> print(cand.provides)
> # ['python-cffi-backend-api-min', 'python-cffi-backend-api-max', 'python-cffi-backend-api-9729']
> print(cand.record['Provides'])
> # 'python-cffi-backend-api-9729, python-cffi-backend-api-max (= 10239), python-cffi-backend-api-min (= 9729)'
>
> As a temporary work-around I'm now using
>
> for (providesname, providesver, version) in cand._cand.provides_list:
> print(providesname, providesver)
> # ('python-cffi-backend-api-min', '9729')
> # ('python-cffi-backend-api-max', '10239')
> # ('python-cffi-backend-api-9729', None)
>
> python-apt should have an "official" API to access the version
> information.
Well, it has in apt_pkg. But the apt package did not keep up. What we need to do apparently
is create a subtype of str that exposes a name and a version member (we need to be a str too
for compatibility reasons...).
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Reply to: