Blob Blame History Raw
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif

%global pypi_name retryz


Name:           python-%{pypi_name}
Version:        0.1.8
Release:        1%{?dist}
Summary:        Retry decorator with a bunch of configuration parameters

License:        ASL 2.0
URL:            https://pypi.python.org/pypi/retryz
Source0:        https://pypi.io/packages/source/%(n=%{pypi_name}; echo ${n:0:1})/%{pypi_name}/%{pypi_name}-%{version}.zip
BuildArch:      noarch

%description
Retry decorator with a bunch of configuration parameters.

%package -n python2-%{pypi_name}
Summary:        %{summary}

%{?python_provide:%python_provide python2-%{pypi_name}}

Requires:       python2

BuildRequires:  python2-devel

# for running tests
BuildRequires:  python2-pytest
BuildRequires:  python2-hamcrest


%description -n python2-%{pypi_name}
Retry decorator with a bunch of configuration parameters.

%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary:        %{summary}

%{?python_provide:%python_provide python3-%{pypi_name}}

Requires:       python3

BuildRequires:  python3-devel

# for running tests
BuildRequires:  python3-pytest
BuildRequires:  python3-hamcrest

%description -n python3-%{pypi_name}
Retry decorator with a bunch of configuration parameters.

%endif

%prep
%setup -q -n %{pypi_name}-%{upstream_version}

%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif

%check
PYTHONPATH=. py.test-2.7
%if 0%{?with_python3}
PYTHONPATH=. py.test-3
%endif


%install
%py2_install

%if 0%{?with_python3}
%py3_install
%endif

%files -n python2-%{pypi_name}
%license LICENSE.txt
%doc README.rst
%{python2_sitelib}/retryz*

%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/retryz*
%endif

%changelog
* Wed Feb 01 2017 Eric Harney <eharney@redhat.com> - 0.1.8-1
- Initial package