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

Conflicts between python2-* and python3-* submodule on executables #63

Closed xsuchy closed 8 years ago

xsuchy commented 8 years ago
pyp2rpm --srpm pyflakes

This will create python2 and python3 subpackage. And both contains /usr/bin/pyflakes. Which will result in conflicts if you want to install both (e.g. as buildrequires).

DEBUG util.py:421:  Error: Transaction check error:
DEBUG util.py:421:    file /usr/bin/pyflakes conflicts between attempted installs of pyflakes-1.2.3-1.fc25.noarch and python3-pyflakes-1.2.3-1.fc25.noarch

I think pyp2rpm should somehow try to address it.

mcyprian commented 8 years ago

pyp2rpm pyflakes generates following %files section

%files -n python2-%{pypi_name} 
%doc README.rst LICENSE
%{_bindir}/pyflakes
%{_bindir}/pyflakes-2
%{_bindir}/pyflakes-%{python2_version}
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files -n python3-%{pypi_name} 
%doc README.rst LICENSE
%{_bindir}/pyflakes-3
%{_bindir}/pyflakes-%{python3_version}
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

result of --srpm option can be successfully built and the content of rpms is alright. I can install both to my system without any errors.

It seems that pyflakes-1.2.3-1.fc25.noarch is package from fedora repositories http://koji.fedoraproject.org/koji/buildinfo?buildID=762537, name of the package generated by pyp2rpm would be python2-pyflakes-1.2.3-1.fc25.noarch.

python3 subpackage contains binary called foo (/usr/bin/pyflakes in this case) only if it is generated using -b3 option. I am not sure if this is the best behavior but it doesn't violate the guidelines if I understand them correctly.

mcyprian commented 8 years ago

@xsuchy @hroncok Is current behavior that I explained above correct? Do you suggest some changes here?

xsuchy commented 8 years ago

Hmm, while it does not satisfy my needs completely and it will cause me some problems, I agree that it is on pair with guideliness and I will need to live with that. So closing.