简体   繁体   English

如何将RPM规范文件依赖项转换为Python setup.py?

[英]How to convert RPM spec file dependencies to Python setup.py?

Basically I'm working on porting a program from being packaged with RPM into using setup.py to package it as a wheel. 基本上,我正在将程序从与RPM打包移植到使用setup.py打包为转轮的过程中。 My core question is whether there exists some guide or tool on how to make this conversion. 我的核心问题是,是否存在有关如何进行转换的指南或工具。

The key issue is that I'm looking to convert dependencies as specified by RPM's spec file to setup.py and can't find any information online as to how to do this. 关键问题在于,我正在寻求将RPM规范文件指定的依赖项转换为setup.py,并且无法在线找到有关如何执行此操作的任何信息。

Any answer likely depends on the distro for which the rpm was built. 任何答案都可能取决于生成rpm的发行版。 A generic, albeit manual approach, would to start with rpm -q --requires $PACKAGE but as you already have the spec file, you can simply rpmspec -q --requires *spec to get that same info. 一个通用的尽管是手动的方法,将以rpm -q --requires $PACKAGE开始,但是由于您已经有了spec文件,您可以简单地rpmspec -q --requires *spec获得相同的信息。 Look for the packages providing Python resources, eg, python3-requests . 寻找提供Python资源的软件包,例如python3-requests You'll need to translate each of these into the Python package name, eg, 'requests' for your setup.py. 您需要将它们中的每一个都转换为Python包名称,例如setup.py的'requests' You may find that rpm -q --provides python3-requests to be useful at this step; 您可能会发现rpm -q --provides python3-requests在此步骤中rpm -q --provides python3-requests有用; maybe not. 也许不吧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM