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

IndexError in versions extraction #96

Closed mcyprian closed 7 years ago

mcyprian commented 7 years ago

Running pyp2rpm imread fails with following traceback:

File "/home/mcyprian/Codes/devel/pyp2rpm/pyp2rpm/metadata_extractors.py", line 427, in data_from_archive
    archive_data = super(SetupPyMetadataExtractor, self).data_from_archive
  File "/home/mcyprian/Codes/devel/pyp2rpm/pyp2rpm/metadata_extractors.py", line 221, in data_from_archive
    archive_data['python_versions']) = self.versions_from_archive
  File "/home/mcyprian/Codes/devel/pyp2rpm/pyp2rpm/metadata_extractors.py", line 371, in versions_from_archive
    base_python_version = python_versions[0]
IndexError: list index out of range
irushchyshyn commented 7 years ago

Opened a PR to fix the IndexError issue, however pyp2rpm will fail to generate spec file for imread unless numpy is installed, as it imports it in setup.py. The option for packages like that would be to read metadata from PKG-INFO file.