Hello community,
here is the log from the commit of package python-tenacity for openSUSE:Factory
checked in at 2019-12-21 12:34:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tenacity (Old)
and /work/SRC/openSUSE:Factory/.python-tenacity.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tenacity"
Sat Dec 21 12:34:32 2019 rev:10 rq:758620 version:6.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tenacity/python-tenacity.changes
2019-08-28 18:38:26.497252828 +0200
+++
/work/SRC/openSUSE:Factory/.python-tenacity.new.6675/python-tenacity.changes
2019-12-21 12:34:54.099463678 +0100
@@ -1,0 +2,6 @@
+Fri Dec 20 18:42:18 UTC 2019 - Dirk Mueller <[email protected]>
+
+- update to 6.0.0
+ * Python 3.8 enablement
+
+-------------------------------------------------------------------
Old:
----
tenacity-5.1.1.tar.gz
New:
----
tenacity-6.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-tenacity.spec ++++++
--- /var/tmp/diff_new_pack.UgFofU/_old 2019-12-21 12:34:55.511464350 +0100
+++ /var/tmp/diff_new_pack.UgFofU/_new 2019-12-21 12:34:55.511464350 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-tenacity
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-tenacity
-Version: 5.1.1
+Version: 6.0.0
Release: 0
Summary: Python module for retrying code until it succeeeds
License: Apache-2.0
@@ -43,7 +43,7 @@
Requires: python-monotonic >= 0.6
%endif
%if 0%{?_no_weakdeps}
-Requires: python-tornado
+Requires: python-tornado >= 4.5
%else
Recommends: python-tornado
%endif
++++++ tenacity-5.1.1.tar.gz -> tenacity-6.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/.circleci/config.yml
new/tenacity-6.0.0/.circleci/config.yml
--- old/tenacity-5.1.1/.circleci/config.yml 2019-08-16 10:42:58.000000000
+0200
+++ new/tenacity-6.0.0/.circleci/config.yml 2019-11-06 13:12:32.000000000
+0100
@@ -3,7 +3,7 @@
jobs:
pep8:
docker:
- - image: circleci/python:3.7
+ - image: circleci/python:3.8
steps:
- checkout
- run:
@@ -46,7 +46,38 @@
command: |
sudo pip install tox
tox -e py37
-
+ py38:
+ docker:
+ - image: circleci/python:3.8
+ steps:
+ - checkout
+ - run:
+ command: |
+ sudo pip install tox
+ tox -e py38
+ deploy:
+ docker:
+ - image: circleci/python:3.8
+ steps:
+ - checkout
+ - run: |
+ python -m venv venv
+ - run: |
+ venv/bin/pip install twine wheel
+ - run:
+ name: init .pypirc
+ command: |
+ echo -e "[pypi]" >> ~/.pypirc
+ echo -e "username = __token__" >> ~/.pypirc
+ echo -e "password = $PYPI_TOKEN" >> ~/.pypirc
+ - run:
+ name: create packages
+ command: |
+ venv/bin/python setup.py sdist bdist_wheel
+ - run:
+ name: upload to PyPI
+ command: |
+ venv/bin/twine upload dist/*
workflows:
version: 2
@@ -58,3 +89,10 @@
- py35
- py36
- py37
+ - py38
+ - deploy:
+ filters:
+ tags:
+ only: /[0-9]+(\.[0-9]+)*/
+ branches:
+ ignore: /.*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/.mergify.yml
new/tenacity-6.0.0/.mergify.yml
--- old/tenacity-5.1.1/.mergify.yml 2019-08-16 10:42:58.000000000 +0200
+++ new/tenacity-6.0.0/.mergify.yml 2019-11-06 13:12:32.000000000 +0100
@@ -6,6 +6,7 @@
- "status-success=ci/circleci: py35"
- "status-success=ci/circleci: py36"
- "status-success=ci/circleci: py37"
+ - "status-success=ci/circleci: py38"
- "#approved-reviews-by>=1"
- label!=work-in-progress
actions:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/PKG-INFO new/tenacity-6.0.0/PKG-INFO
--- old/tenacity-5.1.1/PKG-INFO 2019-08-16 10:46:24.000000000 +0200
+++ new/tenacity-6.0.0/PKG-INFO 2019-11-06 13:12:40.568314800 +0100
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: tenacity
-Version: 5.1.1
-Summary: Retry code until it succeeeds
+Version: 6.0.0
+Summary: Retry code until it succeeds
Home-page: https://github.com/jd/tenacity
Author: Julien Danjou
Author-email: [email protected]
License: Apache 2.0
-Description: UNKNOWN
+Description: Tenacity is a general-purpose retrying library to simplify the
task of adding retry behavior to just about anything.
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
@@ -17,6 +17,6 @@
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Utilities
-Description-Content-Type: text/x-rst
Provides-Extra: doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/README.rst
new/tenacity-6.0.0/README.rst
--- old/tenacity-5.1.1/README.rst 2019-08-16 10:42:58.000000000 +0200
+++ new/tenacity-6.0.0/README.rst 2019-11-06 13:12:32.000000000 +0100
@@ -61,6 +61,7 @@
- Customize retrying on Exceptions
- Customize retrying on expected returned result
- Retry on coroutines
+- Retry code block with context manager
Installation
@@ -598,6 +599,27 @@
retryer = Retrying(stop=stop_after_attempt(max_attempts), reraise=True)
retryer(never_good_enough, 'I really do try')
+Retrying code block
+~~~~~~~~~~~~~~~~~~~
+
+Tenacity allows you to retry a code block without the need to wraps it in an
+isolated function. This makes it easy to isolate failing block while sharing
+context. The trick is to combine a for loop and a context manager.
+
+.. testcode::
+
+ from tenacity import Retrying, RetryError, stop_after_attempt
+
+ try:
+ for attempt in Retrying(stop=stop_after_attempt(3)):
+ with attempt:
+ raise Exception('My code is failing!')
+ except RetryError:
+ pass
+
+You can configure every details of retry policy by configuring the Retrying
+object.
+
Async and retry
~~~~~~~~~~~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/doc/source/index.rst
new/tenacity-6.0.0/doc/source/index.rst
--- old/tenacity-5.1.1/doc/source/index.rst 2019-08-16 10:42:58.000000000
+0200
+++ new/tenacity-6.0.0/doc/source/index.rst 2019-11-06 13:12:32.000000000
+0100
@@ -61,6 +61,7 @@
- Customize retrying on Exceptions
- Customize retrying on expected returned result
- Retry on coroutines
+- Retry code block with context manager
Installation
@@ -598,6 +599,27 @@
retryer = Retrying(stop=stop_after_attempt(max_attempts), reraise=True)
retryer(never_good_enough, 'I really do try')
+Retrying code block
+~~~~~~~~~~~~~~~~~~~
+
+Tenacity allows you to retry a code block without the need to wraps it in an
+isolated function. This makes it easy to isolate failing block while sharing
+context. The trick is to combine a for loop and a context manager.
+
+.. testcode::
+
+ from tenacity import Retrying, RetryError, stop_after_attempt
+
+ try:
+ for attempt in Retrying(stop=stop_after_attempt(3)):
+ with attempt:
+ raise Exception('My code is failing!')
+ except RetryError:
+ pass
+
+You can configure every details of retry policy by configuring the Retrying
+object.
+
Async and retry
~~~~~~~~~~~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/setup.cfg new/tenacity-6.0.0/setup.cfg
--- old/tenacity-5.1.1/setup.cfg 2019-08-16 10:46:24.000000000 +0200
+++ new/tenacity-6.0.0/setup.cfg 2019-11-06 13:12:40.568314800 +0100
@@ -2,10 +2,8 @@
name = tenacity
license = Apache 2.0
url = https://github.com/jd/tenacity
-summary = Retry code until it succeeeds
-description-file =
- README.rst
-long_description_content_type = text/x-rst
+summary = Retry code until it succeeds
+long_description = Tenacity is a general-purpose retrying library to simplify
the task of adding retry behavior to just about anything.
author = Julien Danjou
author-email = [email protected]
home-page = https://github.com/jd/tenacity
@@ -19,6 +17,7 @@
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
+ Programming Language :: Python :: 3.8
Topic :: Utilities
[options]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity/__init__.py
new/tenacity-6.0.0/tenacity/__init__.py
--- old/tenacity-5.1.1/tenacity/__init__.py 2019-08-16 10:41:56.000000000
+0200
+++ new/tenacity-6.0.0/tenacity/__init__.py 2019-11-06 13:12:32.000000000
+0100
@@ -161,6 +161,7 @@
def __init__(self, last_attempt):
self.last_attempt = last_attempt
+ super(RetryError, self).__init__(last_attempt)
def reraise(self):
if self.last_attempt.failed:
@@ -171,6 +172,24 @@
return "{0}[{1}]".format(self.__class__.__name__, self.last_attempt)
+class AttemptManager(object):
+ """Manage attempt context."""
+
+ def __init__(self, retry_state):
+ self.retry_state = retry_state
+
+ def __enter__(self):
+ pass
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ if isinstance(exc_value, BaseException):
+ self.retry_state.set_exception((exc_type, exc_value, traceback))
+ return True # Swallow exception.
+ else:
+ # We don't have the result, actually.
+ self.retry_state.set_result(None)
+
+
class BaseRetrying(object):
def __init__(self,
@@ -345,6 +364,20 @@
return DoSleep(sleep)
+ def __iter__(self):
+ self.begin(None)
+
+ retry_state = RetryCallState(self, fn=None, args=(), kwargs={})
+ while True:
+ do = self.iter(retry_state=retry_state)
+ if isinstance(do, DoAttempt):
+ yield AttemptManager(retry_state=retry_state)
+ elif isinstance(do, DoSleep):
+ retry_state.prepare_for_next_attempt()
+ self.sleep(do)
+ else:
+ break
+
class Retrying(BaseRetrying):
"""Retrying controller."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity/_asyncio.py
new/tenacity-6.0.0/tenacity/_asyncio.py
--- old/tenacity-5.1.1/tenacity/_asyncio.py 2019-08-16 10:41:56.000000000
+0200
+++ new/tenacity-6.0.0/tenacity/_asyncio.py 2019-11-06 13:12:32.000000000
+0100
@@ -16,7 +16,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import asyncio
+try:
+ import asyncio
+except ImportError:
+ asyncio = None
+
import sys
from tenacity import BaseRetrying
@@ -25,31 +29,38 @@
from tenacity import RetryCallState
-class AsyncRetrying(BaseRetrying):
+if asyncio:
+ class AsyncRetrying(BaseRetrying):
- def __init__(self,
- sleep=asyncio.sleep,
- **kwargs):
- super(AsyncRetrying, self).__init__(**kwargs)
- self.sleep = sleep
-
- @asyncio.coroutine
- def call(self, fn, *args, **kwargs):
- self.begin(fn)
-
- retry_state = RetryCallState(
- retry_object=self, fn=fn, args=args, kwargs=kwargs)
- while True:
- do = self.iter(retry_state=retry_state)
- if isinstance(do, DoAttempt):
- try:
- result = yield from fn(*args, **kwargs)
- except BaseException:
- retry_state.set_exception(sys.exc_info())
+ def __init__(self,
+ sleep=asyncio.sleep,
+ **kwargs):
+ super(AsyncRetrying, self).__init__(**kwargs)
+ self.sleep = sleep
+
+ def wraps(self, fn):
+ fn = super().wraps(fn)
+ # Ensure wrapper is recognized as a coroutine function.
+ fn._is_coroutine = asyncio.coroutines._is_coroutine
+ return fn
+
+ @asyncio.coroutine
+ def call(self, fn, *args, **kwargs):
+ self.begin(fn)
+
+ retry_state = RetryCallState(
+ retry_object=self, fn=fn, args=args, kwargs=kwargs)
+ while True:
+ do = self.iter(retry_state=retry_state)
+ if isinstance(do, DoAttempt):
+ try:
+ result = yield from fn(*args, **kwargs)
+ except BaseException:
+ retry_state.set_exception(sys.exc_info())
+ else:
+ retry_state.set_result(result)
+ elif isinstance(do, DoSleep):
+ retry_state.prepare_for_next_attempt()
+ yield from self.sleep(do)
else:
- retry_state.set_result(result)
- elif isinstance(do, DoSleep):
- retry_state.prepare_for_next_attempt()
- yield from self.sleep(do)
- else:
- return do
+ return do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity/tests/test_asyncio.py
new/tenacity-6.0.0/tenacity/tests/test_asyncio.py
--- old/tenacity-5.1.1/tenacity/tests/test_asyncio.py 2019-08-16
10:41:56.000000000 +0200
+++ new/tenacity-6.0.0/tenacity/tests/test_asyncio.py 2019-11-06
13:12:32.000000000 +0100
@@ -36,9 +36,8 @@
@retry
[email protected]
-def _retryable_coroutine(thing):
- yield from asyncio.sleep(0.00001)
+async def _retryable_coroutine(thing):
+ await asyncio.sleep(0.00001)
return thing.go()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity/tests/test_tenacity.py
new/tenacity-6.0.0/tenacity/tests/test_tenacity.py
--- old/tenacity-5.1.1/tenacity/tests/test_tenacity.py 2019-08-16
10:42:58.000000000 +0200
+++ new/tenacity-6.0.0/tenacity/tests/test_tenacity.py 2019-11-06
13:12:32.000000000 +0100
@@ -1326,6 +1326,71 @@
self.assertIsInstance(result, tenacity.Future)
+class TestContextManager(unittest.TestCase):
+ def test_context_manager_retry_one(self):
+ from tenacity import Retrying
+
+ raise_ = True
+
+ for attempt in Retrying():
+ with attempt:
+ if raise_:
+ raise_ = False
+ raise Exception("Retry it!")
+
+ def test_context_manager_on_error(self):
+ from tenacity import Retrying
+
+ class CustomError(Exception):
+ pass
+
+ retry = Retrying(retry=tenacity.retry_if_exception_type(IOError))
+
+ def test():
+ for attempt in retry:
+ with attempt:
+ raise CustomError("Don't retry!")
+
+ self.assertRaises(CustomError, test)
+
+ def test_context_manager_retry_error(self):
+ from tenacity import Retrying
+
+ retry = Retrying(stop=tenacity.stop_after_attempt(2))
+
+ def test():
+ for attempt in retry:
+ with attempt:
+ raise Exception("Retry it!")
+
+ self.assertRaises(RetryError, test)
+
+ def test_context_manager_reraise(self):
+ from tenacity import Retrying
+
+ class CustomError(Exception):
+ pass
+
+ retry = Retrying(reraise=True, stop=tenacity.stop_after_attempt(2))
+
+ def test():
+ for attempt in retry:
+ with attempt:
+ raise CustomError("Don't retry!")
+
+ self.assertRaises(CustomError, test)
+
+
+class TestRetryException(unittest.TestCase):
+
+ def test_retry_error_is_pickleable(self):
+ import pickle
+ expected = RetryError(last_attempt=123)
+ pickled = pickle.dumps(expected)
+ actual = pickle.loads(pickled)
+ self.assertEqual(expected.last_attempt, actual.last_attempt)
+
+
@contextmanager
def reports_deprecation_warning():
__tracebackhide__ = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity.egg-info/PKG-INFO
new/tenacity-6.0.0/tenacity.egg-info/PKG-INFO
--- old/tenacity-5.1.1/tenacity.egg-info/PKG-INFO 2019-08-16
10:46:24.000000000 +0200
+++ new/tenacity-6.0.0/tenacity.egg-info/PKG-INFO 2019-11-06
13:12:40.000000000 +0100
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: tenacity
-Version: 5.1.1
-Summary: Retry code until it succeeeds
+Version: 6.0.0
+Summary: Retry code until it succeeds
Home-page: https://github.com/jd/tenacity
Author: Julien Danjou
Author-email: [email protected]
License: Apache 2.0
-Description: UNKNOWN
+Description: Tenacity is a general-purpose retrying library to simplify the
task of adding retry behavior to just about anything.
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
@@ -17,6 +17,6 @@
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Utilities
-Description-Content-Type: text/x-rst
Provides-Extra: doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity.egg-info/SOURCES.txt
new/tenacity-6.0.0/tenacity.egg-info/SOURCES.txt
--- old/tenacity-5.1.1/tenacity.egg-info/SOURCES.txt 2019-08-16
10:46:24.000000000 +0200
+++ new/tenacity-6.0.0/tenacity.egg-info/SOURCES.txt 2019-11-06
13:12:40.000000000 +0100
@@ -28,7 +28,6 @@
tenacity.egg-info/PKG-INFO
tenacity.egg-info/SOURCES.txt
tenacity.egg-info/dependency_links.txt
-tenacity.egg-info/pbr.json
tenacity.egg-info/requires.txt
tenacity.egg-info/top_level.txt
tenacity/tests/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tenacity-5.1.1/tenacity.egg-info/pbr.json
new/tenacity-6.0.0/tenacity.egg-info/pbr.json
--- old/tenacity-5.1.1/tenacity.egg-info/pbr.json 2019-08-16
10:42:49.000000000 +0200
+++ new/tenacity-6.0.0/tenacity.egg-info/pbr.json 1970-01-01
01:00:00.000000000 +0100
@@ -1 +0,0 @@
-{"git_version": "58495e5", "is_release": false}
\ No newline at end of file