## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 8;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           python-reretry
Version:        0.11.8
Release:        %autorelease
Summary:        Easy to use retry decorator

License:        Apache-2.0
URL:            https://github.com/leshchenko1979/reretry
# Missing release 0.11.2 on PyPI
# https://github.com/leshchenko1979/reretry/issues/7
# Source:         %%{pypi_source reretry}
Source:         %{url}/archive/%{version}/reretry-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
# Optional dependency; allows preserving function signatures. Add a BR to make
# sure it is available, and so that we test with it.
BuildRequires:  python3dist(decorator)

# Depend explicitly on pytest, not just indirectly via pytest-asyncio in
# tests/requirements.txt.
BuildRequires:  python3dist(pytest)

%global common_description %{expand:
An easy to use retry decorator.

This package is a fork from the retry package, but with some of added
community-sourced features.

Features

New features in reretry:

  • Log traceback of an error that lead to a failed attempt.
  • Call a custom callback after each failed attempt.
  • Can be used with async functions.

From original retry:

  • Retry on specific exceptions.
  • Set a maximum number of retries.
  • Set a delay between retries.
  • Set a maximum delay between retries.
  • Set backoff and jitter parameters.
  • Use a custom logger.
  • No external dependencies (stdlib only).
  • (Optionally) Preserve function signatures (pip install decorator).}

%description %{common_description}


%package -n python3-reretry
Summary:        %{summary}

# Optional dependency; allows preserving function signatures.
Recommends:     python3dist(decorator)

%description -n python3-reretry %{common_description}


%prep
%autosetup -n reretry-%{version}


%generate_buildrequires
%pyproject_buildrequires tests/test-requirements.txt


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files -l reretry


%check
%pytest


%files -n python3-reretry -f %{pyproject_files}
%doc README.md


%changelog
## START: Generated by rpmautospec
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.8-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.8-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Dec 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.8-6
- Assert that %%pyproject_files contains a license file

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.8-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.11.8-4
- Rebuilt for Python 3.12

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sun Dec 18 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.8-1
- Update to 0.11.8 (close RHBZ#2154647)

* Thu Aug 25 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.2-2
- Update License to SPDX

* Tue Jul 26 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.11.2-1
- Initial package (close RHBZ#2110001)
## END: Generated by rpmautospec