Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Lookup Fedora package given PyPI package name from requirements.txt #420

Open
abitrolly opened this issue Aug 3, 2019 · 13 comments
Open

Comments

@abitrolly
Copy link
Contributor

I want to know if some PyPI package can be ported to Fedora packages. For that I need to analyze if dependencies are already packed. And for that I need to query all those dependencies as listed in requirements.txt and get Fedora package names for them. Is that possible?

@pypingou
Copy link
Member

most python libraries will be packaged as python-<name>, so you starting with this model should get you pretty far.

@abitrolly
Copy link
Contributor Author

abitrolly commented Aug 22, 2019

Got pretty far already. Not sure if scripts are worthy packaging, but here is it.

repology/repology-updater#893 (comment)

@abitrolly
Copy link
Contributor Author

@pypingou how to expose Requires: field from package .rpm through API in fedora-packages? Or which component of fedora-infra can do this?

@cverna
Copy link
Contributor

cverna commented Aug 26, 2019

@pypingou how to expose Requires: field from package .rpm through API in fedora-packages? Or which component of fedora-infra can do this?

you should probably use mdapi for that https://mdapi.fedoraproject.org/

@abitrolly
Copy link
Contributor Author

I could trace needed Requirements header down to /var/cache/dnf/fedora-8c9e363c32277c01/repodata/912f062d93e096c75901055ffca02a0c3961b33b8e1dd65319d97d493d3e49d5-primary.xml.gz where it is stored as XML entry.

<rpm:entry name="python3dist(straight.plugin)" flags="EQ" epoch="0" ver="1.4.0.post1"/>

I am not sure if Repology uses the same cache to extract information about Fedora packages. https://github.com/repology/repology/blob/613734c89c493bc5612d0e362c0019ad7f10984c/repology/parsers/parsers/repodata.py

Right now I am looking at mdapi to see if it allows lookups by python3dist.

@abitrolly
Copy link
Contributor Author

@abitrolly
Copy link
Contributor Author

@cverna why this data is not exposed in source repo metadata? repology/repology-rules#253 (comment)

@cverna
Copy link
Contributor

cverna commented Aug 27, 2019

@abitrolly I don't know 😄 maybe you should ask that to the releng folks (https://pagure.io/releng) or maybe @pypingou knows

@pypingou
Copy link
Member

Because that info is introduced when the rpm is built and the source metadata contain the metadata about the source-rpm which is basically a tarball containing the spec file, the patches (if there are any) and the sources).

@abitrolly
Copy link
Contributor Author

@pypingou is it possible to move python3dist into source metadata? The source belongs to upstream PyPI anyway.

@pypingou
Copy link
Member

mdapi exposes what is in the repository metadata. Adding it to the soure repository (ie to the metadata of the source-rpm) is out of the scope of mdapi itself and I suspect not something that the RPM folks would be able to support.

@abitrolly
Copy link
Contributor Author

abitrolly commented Aug 28, 2019

Probably not for mdapi. Exposing PyPI source info in source metadata would help projects like https://repology.org maintain links between packages without hacks repology/repology-rules@2c338bb

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants