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

File system templates no longer loaded #169

Closed GermanoGuerrini closed 4 years ago

GermanoGuerrini commented 6 years ago

Hello,

From version 3.3.0 (at least), the filesytem/default templates order specified in the documentation doesn't apply any more.

Apparently, the convertor module tries to resolve the template using the application settings in the merge_versions method call here: https://github.com/fedora-python/pyp2rpm/blob/master/pyp2rpm/convertor.py#L146 and that doesn't give the opportunity to load a template coming from the file system just 10 rows below: https://github.com/fedora-python/pyp2rpm/blob/master/pyp2rpm/convertor.py#L156.

This is the traceback:

Traceback (most recent call last):
  File "/home/pyrpm/.virtualenvs/ecicmf/bin/pyp2rpm", line 11, in <module>
    sys.exit(main())
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/pyp2rpm/bin.py", line 210, in main
    converted = convertor.convert()
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/pyp2rpm/convertor.py", line 146, in convert
    self.merge_versions(data)
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/pyp2rpm/convertor.py", line 104, in merge_versions
    self.template_base_py_ver, self.template_py_vers)
  File "/home/pyrpm/.virtualenvs/ecicmf/lib/python2.7/site-packages/pyp2rpm/convertor.py", line 72, in template_base_py_ver
    self.template)[0]][0]
KeyError: u'centos7-acs.tpl'
gordonmessmer commented 4 years ago

This should be fixed by commit 7f2d9a00e50b59b0087edc2c79763e57b0129a4e

gordonmessmer commented 4 years ago

This should be resolved in v.3.3.4. Please re-open if you can reproduce the issue.