fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
123 stars 39 forks source link

How to generate SPEC for non setup.py file projects? #286

Open pnemade opened 1 year ago

pnemade commented 1 year ago

Hi, Can I get help here please? I found some new releases/projects moved from using setup.py to pyproject.toml file. Does this pyp2rpm tool help to generate SPEC file for those projects?

Thanks

hroncok commented 1 year ago

No, pyp2rpm does not support that.

For setup.py-less projects, the updated Python guideline must be used (at least in Fedora): https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/

There is an experimental https://github.com/befeleme/pyp2spec if you really need a generator.

NimKri commented 11 months ago

I came across a hack(for the lack of better word) to run specfile generation for projects lacking setup file, in the source find metadata_extractors.py file and edit the function get_setup_py to get a custom written file(I use /tmp/setup.py) and write a generic setup.py to it

from setuptools import setup, find_packages
if __name__ == '__main__':
   setup(name="%{pypi_name}",
               version="%{version}",
               packages=find_packages(),)

the above has worked out for a lot of projects