Python dependencies not available on

(This thread is migrated from GitHub)

Currently the only (non-pulpcore) dependency of pulp_deb is python-debian. python-debian has a optional dependency on python-apt, that we are currently not using, defaulting to python-debian’s internal implementation instead. However, python-apt (API bindings for using libapt directly) is considered the more authoritative implementation, so I would like to trial using it.

The only problem is that the version of python-apt available on is unusably old (the upstream maintainers clearly do not release there). Both Fedora and Debian ship an up to date RPM, and .deb packaged version respectively.

Do we have any experience with RPM based dependencies for plugins? Would a combination of pip environment and system RPM package even work? Any other solutions I have not considered?

See also the following PR: Add python-apt as a library dependency by quba42 · Pull Request #312 · pulp/pulp_deb · GitHub

Update: I brought this up during open floor, which yielded the following insights:

  1. pulp_rpm depending on libmodulemd is a precedent for plugins depending on RPMs
  2. The best case scenario/solution would be to ask the upstream maintainers to release to as well.

I emailed the upstream maintainers, and they take the view (if I understood correctly) that there is really no benefit to a python-apt pypi release, since each version of python-apt is linked to a specific version of APT. As a result, I will have a non pypi dependency either way, with the added difficulty of ensuring the versions match.

If that is correct, than the pulp_installer route is the only one left?

python-apt is essentially a optional dependency of pulp_deb. The plugin will work with and without it. Using python-apt and by extension libapt is clearly the more authoritative implementation, and python-debian without python-apt occasionally throws a warning (which we have so far ignored, but occasionally prompts user concern).

Is this a correctness or a serious performance issue? If python-apt will depend on a specific libapt (system library) version, it will probably not be installable on all platforms (or be rather hard). So maybe you can just get rid of the warning.

I assume it is available on all Debian based distributions :wink: and I know it is available on Fedora (=> RPM).
Since the dependency is optional, we could consider adding the ability to the installer to install it for supported platforms only.
Any installations that have it would use it, and any that don’t would default to using the implementation in python-debian.

As to whether python-apt brings any real, measurable benefit, I just can’t tell until I try, so I still think it is worth trialling it. Probably not super high priority though. Something for trying out on a hack day or similar perhaps?