# Workaround for epel versions where don't exists python2 macro %{!?__python2: %global __python2 %{__python}} %if 0%{?fedora} > 12 %global with_python3 1 %else %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif %global pypi_name nose-parameterized Name: python-nose-parameterized Version: 0.3.3 Release: 2%{?dist} Summary: Decorator for parameterized testing with Nose Group: Development/Libraries License: BSD URL: https://github.com/wolever/nose-parameterized Source0: https://pypi.python.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # wget -O python-nose-parameterized-license.txt https://raw.github.com/wolever/nose-parameterized/master/LICENSE.txt Source1: python-nose-parameterized-license.txt # Sent to upstream https://github.com/wolever/nose-parameterized/pull/16 Patch0: nose-parameterized-0.3.3-unbundle-six.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-nose BuildRequires: python-six Requires: python-nose Requires: python-six %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-nose BuildRequires: python3-six %endif # with_python3 %description Library that improving nose test generators with a decorator that fixes the frequent requirement of a second function, the difficulty to separate the data from the tests and the impossibility of working with subclases of unittest.TestCase %if 0%{?with_python3} %package -n python3-nose-parameterized Summary: Decorator for parameterized testing with Nose Group: Development/Libraries Requires: python3-nose Requires: python3-six %description -n python3-nose-parameterized Library that improving nose test generators with a decorator that fixes the frequent requirement of a second function, the difficulty to separate the data from the tests and the impossibility of working with subclases of unittest.TestCase %endif # with_python3 %prep %setup -qn %{pypi_name}-%{version} # Unbundle six %patch0 -p1 -b .unbundlesix # Remove bundled egg rm -rf nose_parameterized.egg-info cp -a %{SOURCE1} . %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif #with_python3 %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %check nosetests nose_parameterized/test.py %if 0%{?with_python3} pushd %{py3dir} nosetests nose_parameterized/test.py popd %endif # with_python3 %files %doc python-nose-parameterized-license.txt README.rst PKG-INFO %{python_sitelib}/nose_parameterized %{python_sitelib}/nose_parameterized-*.egg-info %if 0%{?with_python3} %files -n python3-nose-parameterized %doc python-nose-parameterized-license.txt README.rst PKG-INFO %{python3_sitelib}/nose_parameterized %{python3_sitelib}/nose_parameterized-*.egg-info %endif # with_python3 %changelog * Sun Jan 26 2014 Eduardo Echeverria 0.3.3-2 - fixed bad retrieving of requires * Wed Jan 22 2014 Eduardo Echeverria 0.3.3-1 - Initial packaging