6c38b2e
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
6c38b2e
%if 0%{?fedora}
6c38b2e
%global with_python3 1
6c38b2e
%endif
6c38b2e
6c38b2e
%global pypi_name retryz
6c38b2e
6c38b2e
6c38b2e
Name:           python-%{pypi_name}
6c38b2e
Version:        0.1.8
6c38b2e
Release:        1%{?dist}
6c38b2e
Summary:        Retry decorator with a bunch of configuration parameters
6c38b2e
6c38b2e
License:        ASL 2.0
6c38b2e
URL:            https://pypi.python.org/pypi/retryz
6c38b2e
Source0:        https://pypi.io/packages/source/%(n=%{pypi_name}; echo ${n:0:1})/%{pypi_name}/%{pypi_name}-%{version}.zip
6c38b2e
BuildArch:      noarch
6c38b2e
6c38b2e
%description
6c38b2e
Retry decorator with a bunch of configuration parameters.
6c38b2e
6c38b2e
%package -n python2-%{pypi_name}
6c38b2e
Summary:        %{summary}
6c38b2e
6c38b2e
%{?python_provide:%python_provide python2-%{pypi_name}}
6c38b2e
6c38b2e
Requires:       python2
6c38b2e
6c38b2e
BuildRequires:  python2-devel
6c38b2e
6c38b2e
# for running tests
6c38b2e
BuildRequires:  python2-pytest
6c38b2e
BuildRequires:  python2-hamcrest
6c38b2e
6c38b2e
6c38b2e
%description -n python2-%{pypi_name}
6c38b2e
Retry decorator with a bunch of configuration parameters.
6c38b2e
6c38b2e
%if 0%{?with_python3}
6c38b2e
%package -n python3-%{pypi_name}
6c38b2e
Summary:        %{summary}
6c38b2e
6c38b2e
%{?python_provide:%python_provide python3-%{pypi_name}}
6c38b2e
6c38b2e
Requires:       python3
6c38b2e
6c38b2e
BuildRequires:  python3-devel
6c38b2e
6c38b2e
# for running tests
6c38b2e
BuildRequires:  python3-pytest
6c38b2e
BuildRequires:  python3-hamcrest
6c38b2e
6c38b2e
%description -n python3-%{pypi_name}
6c38b2e
Retry decorator with a bunch of configuration parameters.
6c38b2e
6c38b2e
%endif
6c38b2e
6c38b2e
%prep
6c38b2e
%setup -q -n %{pypi_name}-%{upstream_version}
6c38b2e
6c38b2e
%build
6c38b2e
%py2_build
6c38b2e
%if 0%{?with_python3}
6c38b2e
%py3_build
6c38b2e
%endif
6c38b2e
6c38b2e
%check
6c38b2e
PYTHONPATH=. py.test-2.7
6c38b2e
%if 0%{?with_python3}
6c38b2e
PYTHONPATH=. py.test-3
6c38b2e
%endif
6c38b2e
6c38b2e
6c38b2e
%install
6c38b2e
%py2_install
6c38b2e
6c38b2e
%if 0%{?with_python3}
6c38b2e
%py3_install
6c38b2e
%endif
6c38b2e
6c38b2e
%files -n python2-%{pypi_name}
6c38b2e
%license LICENSE.txt
6c38b2e
%doc README.rst
6c38b2e
%{python2_sitelib}/retryz*
6c38b2e
6c38b2e
%if 0%{?with_python3}
6c38b2e
%files -n python3-%{pypi_name}
6c38b2e
%license LICENSE.txt
6c38b2e
%doc README.rst
6c38b2e
%{python3_sitelib}/retryz*
6c38b2e
%endif
6c38b2e
6c38b2e
%changelog
6c38b2e
* Wed Feb 01 2017 Eric Harney <eharney@redhat.com> - 0.1.8-1
6c38b2e
- Initial package