Tolerate absence of rpm at import time #168
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the code in the staged backend depends on kobo.rpmlib, which in
turn depends on python bindings to rpm.
Previously, it was a hard dependency that these bindings must be
available even for "import pushsource" to succeed. Let's make it a bit
friendlier and avoid a hard dependency at import-time: we will only
raise if we reach the relevant piece of code at runtime.
Motivations for doing this now include:
Python bindings to rpm aren't easy to install in all contexts.
Although there's an "rpm-py-installer" package on pypi which can help,
the way it works is unusual and insecure, and I don't think it's
appropriate to declare a dependency on that package within
install_requires.
Recently, pubtools-1.1.0 was released, which now attempts to eagerly
import all installed pubtools-* projects during task startup to ensure
that all installed hooks are registered. This means that pushsource
library is now being imported in some cases where it previously
wasn't, which means that some environments would now require rpm
bindings where they previously didn't. It would be nice to avoid that.