libcomps icon indicating copy to clipboard operation
libcomps copied to clipboard

Expose `arch` in Python bindings

Open alebastr opened this issue 3 years ago • 1 comments

I'm trying to write a Python code that traverses the Fedora comps and writes a list of packages for the groups, grouping the packages by supported architectures (an update for comps-sync.py in Fedora's workstation-ostree-config).

The data we need, <packagereq arch="..." and <groupid arch="..." attributes are not exposed through the Python bindings. Would it be possible to add support for that?


I've tried to write the necessary bindings myself, but I lack the python C API knowledge required to debug a few remaining crashes. I can send a draft PR, but IMO it would be better if someone familiar with the codebase could work on that.

alebastr avatar Aug 16 '22 17:08 alebastr

You don't really need this. See my comps-sync PR. It also doesn't really match the way this was designed to work. The design is that you query filters by arch if you want results filtered by arch. A query that's not filtered is implicitly a query for all arches. This approach happens to make things slightly awkward for the way comps-sync.py wants to work, but I'm not sure that exposing this attribute in the results of the search is really the 'right thing' to do, given libcomps' actual design here.

AdamWill avatar Nov 02 '22 19:11 AdamWill