Skip to content

Conversation

@rohanpm
Copy link
Contributor

@rohanpm rohanpm commented Aug 9, 2021

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.

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'd be nice to avoid that.
@rohanpm rohanpm marked this pull request as ready for review August 9, 2021 04:32
@rohanpm rohanpm requested a review from a team August 9, 2021 04:32
@rohanpm rohanpm merged commit 28102c7 into release-engineering:master Aug 9, 2021
@rohanpm rohanpm deleted the tolerate-no-rpm branch August 9, 2021 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants