Skip to main content

Alternative dynamic RPM bindings for Python

Project description

rpmdyn

Alternative dynamic RPM bindings for Python.

PyPI

Overview

rpmdyn provides an alternative means of using the rpm library from Python via dynamic binding (FFI).

This project is intended to support testing Python code based on the rpm library in CI or development environments where installing official bindings is too much of a hassle. You may find it useful if you have tried rpm-py-installer and ran into problems with it.

⚠️Major caveat⚠️: the provided RPM bindings are far from complete! Bindings have been implemented "on demand" to fit the author's needs.

Here's a comparison between a few different ways of accessing RPM Python bindings to help you understand if this project may be of use to you:

OS package rpmdyn rpm-py-installer
pip-installable from PyPI?
Usable in virtualenv? ❌¹
Supports multiple Python versions? ❌²
No compilers/headers needed? ❌³
Secure supply chain? ❌⁴
Complete bindings? ❌⁵
  1. Only usable if you enable system site-packages, which is generally unacceptable.
  2. While there are no hard and fast rules around what kinds of packages a Linux distribution provides, it is common for a distribution to choose one primary supported Python version and only provide libraries for that version.
  3. rpm-py-installer works by compiling RPM bindings and thus needs a compiler.
  4. rpm-py-installer downloads RPM sources insecurely with no validation of checksums or signatures. This is an issue if you only want to use known versions of all dependencies, and will not work at all in a firewalled setup (e.g. which only allows access to an internal PyPI registry).
  5. rpmdyn implements only a small subset of RPM bindings, as bindings need to be implemented manually. The set of available bindings reflects the needs of rpmdyn contributors.

Usage

Install rpmdyn and it will automatically be used by default:

  • if real (native) RPM bindings are available, then import rpm will use those.
  • otherwise, import rpm will use rpmdyn.

This is achieved via a PTH hook. If you wish to disable this behavior, set the RPMDYN_HOOK environment variable to 0.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpmdyn-2024.11.18.tar.gz (55.4 kB view details)

Uploaded Source

Built Distribution

rpmdyn-2024.11.18-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file rpmdyn-2024.11.18.tar.gz.

File metadata

  • Download URL: rpmdyn-2024.11.18.tar.gz
  • Upload date:
  • Size: 55.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rpmdyn-2024.11.18.tar.gz
Algorithm Hash digest
SHA256 749bec975901a8e4b41a19c59bd257c85f1221a77692a8a4bcc82bdba79619f9
MD5 3bf7cd9b38d159fb8806799ad4d52946
BLAKE2b-256 bdf9d1f9c4c7ee703fe661a7dd7ac7128be0d43dd6ef5f8fdfd02f0ebda0d209

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpmdyn-2024.11.18.tar.gz:

Publisher: release.yml on rohanpm/rpmdyn

Attestations:

File details

Details for the file rpmdyn-2024.11.18-py3-none-any.whl.

File metadata

  • Download URL: rpmdyn-2024.11.18-py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rpmdyn-2024.11.18-py3-none-any.whl
Algorithm Hash digest
SHA256 24a9419e190c38abb04a6855c8a775f7b618016f162dadb84817e31fcc92dfbc
MD5 ec3f639038f919fa9a1138353bc46c2b
BLAKE2b-256 520ee06e7db4f0f653cc18bc125b8e5d696f1aeb6e162f96628dd25ff3d5d372

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpmdyn-2024.11.18-py3-none-any.whl:

Publisher: release.yml on rohanpm/rpmdyn

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page