forked from pool/python-backoff
- update to version 2.2.1 - Fix type hint for wait generators https://github.com/litl/backoff/issues/177 - Improve type annotation for wait generators from @hauntsaninja - Include exception in details dict of call handlers from @petamas - Improve type hints for call handlers from @cdce8p - Don't use importlib.metadata for __version__ https://github.com/litl/backoff/issues/166 - Fix bug with max_tries/max_time callables https://github.com/litl/backoff/issues/164 - Get max_tries/max_time values for every call fixes #160 (from @jvrsantacruz) - Allow None for jitter keyword arg (typing) - Add raise_on_giveup keyword arg for decorators - Add backoff.runtime wait generator for dynamically setting wait times based on target function return value or exception details - Improve type hints for on_success, on_backoff, on_giveup handlers - Use decorator-specific detail and handler type hints - Optionally use typing_extensions for python 3.7 type hinting - Drop python 3.6 support - Add python 3.10 support OBS-URL: https://build.opensuse.org/request/show/1010355 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-backoff?expand=0&rev=9
75 lines
2.4 KiB
RPMSpec
75 lines
2.4 KiB
RPMSpec
#
|
|
# spec file for package python-backoff
|
|
#
|
|
# Copyright (c) 2022 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
Name: python-backoff
|
|
Version: 2.2.1
|
|
Release: 0
|
|
Summary: Function decoration for backoff and retry
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
URL: https://github.com/litl/backoff
|
|
Source0: https://files.pythonhosted.org/packages/source/b/backoff/backoff-%{version}.tar.gz
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module poetry}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: %{python_module wheel}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
BuildArch: noarch
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module pytest-asyncio}
|
|
BuildRequires: %{python_module pytest-cov}
|
|
BuildRequires: %{python_module requests}
|
|
BuildRequires: %{python_module responses}
|
|
# /SECTION
|
|
%python_subpackages
|
|
|
|
%description
|
|
This module provides function decorators which can be used to wrap a
|
|
function such that it will be retried until some condition is met. It
|
|
is meant to be of use when accessing unreliable resources with the
|
|
potential for intermittent failures i.e. network resources and external
|
|
APIs. Somewhat more generally, it may also be of use for dynamically
|
|
polling resources for externally generated content.
|
|
|
|
Decorators support both regular functions for synchronous code and
|
|
`asyncio <https://docs.python.org/3/library/asyncio.html>`_'s coroutines
|
|
for asynchronous code.
|
|
|
|
%prep
|
|
%setup -q -n backoff-%{version}
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
%pytest
|
|
|
|
%files %{python_files}
|
|
%doc README.rst
|
|
%license LICENSE
|
|
%{python_sitelib}/*
|
|
|
|
%changelog
|