fedora-python / pyp2rpm

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

pyp2rpm should not prefer non-linux wheels over zips/tars #32

Closed TC01 closed 8 years ago

TC01 commented 8 years ago

I looked into packaging pypandoc for Fedora (because I started using it to parse my markdown READMEs into RST when uploading to PyPI), so I ran pyp2rpm.

I was somewhat surprised when it gave me the following for Source0:

%global pypi_name pypandoc

Name:           python-%{pypi_name}
Version:        1.1.3

[...snip...]

Source0:        https://pypi.python.org/packages/cp27/p/%{pypi_name}/%{pypi_name}-%{version}-cp27-none-macosx_10_5_x86_64.whl

In this particular case, the wheels for pypandoc include a prebuilt pandoc for Mac OSX or Windows. That's probably not what we want to be packaging from so I think we'd probably want to grab the zip archive instead.

So I could be wrong, but I think pyp2rpm should prefer the tarball/zip formats over a wheel if the wheel is not Linux native. If I have time over the next week I might look into submitting a PR, assuming this is indeed considered incorrect behavior. :)

mcyprian commented 8 years ago

At this moment prefered archive is .tar.gz, if tar is not available first file from the list is grabbed. You are right, we should prefer zip in case tar is missing. I have made more changes in package_getters module in bdist_devel branch so I will fix this there and merge it to master with other changes.