fedora-python / pyp2rpm

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

Fix locating `setup.py` (Issue #95) #98

Closed irushchyshyn closed 7 years ago

irushchyshyn commented 7 years ago

The problem with the listed packages is that the archive name differs from the PyPI name.

Take ndg-httpsclient. The downloaded tar is ndg_httpsclient-0.4.2.tar.gz. As we solely depend on the PyPI name, we assume that the package will be extracted into ndg-httpsclient-0.4.2, which causes errors when locating setup.py and generating a spec file. Also the build later fails in %prep section in %autosetup where we also depend on PyPi name.

Tested the fixes in copr on the set of packages reported in the issue (and a couple of other packageswith the same issue, found during testing): https://copr.fedorainfracloud.org/coprs/ishcherb/pypi_builds1/packages/

Fixes #95.

irushchyshyn commented 7 years ago

Thanks for the review @mcyprian !

I think using data.dirname instead of data.underscored_name in %files section (.pth, .egg-info files) might also fix cases like BioPandas File not found error.

I do not think we should use dirname in %files. It might fix the error for BioPandas, but the .egg-info files are not always named the same way the tar file is. They are more often underscored I would say.

mcyprian commented 7 years ago

Yes you're right, in that case virtualenv module could hopefully help here but that is different issue...