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

extract python version from setup / egg #21

Closed MichaelMraka closed 8 years ago

MichaelMraka commented 8 years ago

Some packages specifies python 3 in their setup.py / egg and can't be built on python 2. This patch extracts proper python version from package classifiers.

hroncok commented 8 years ago

Seems useful :+1:

rkuska commented 8 years ago

Hi thank you for your contribution! This indeed seems useful, would you also provide unittests with your PR? Thank you!

mcyprian commented 8 years ago

When using base python option: pyp2rpm nose -b 3 the result is:

%files -n python3-%{pypi_name} 
%doc README.txt
%dir %{python3_sitelib}/__pycache__/
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/htmlplug.py
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files -n python3-%{pypi_name} 
%doc README.txt
%dir %{python3_sitelib}/__pycache__/
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/htmlplug.py
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

Extraction of versions should be active only if base and additional versions (options -b -p) are not specified explicitly.