Hello community, here is the log from the commit of package python-funcy for openSUSE:Factory checked in at 2020-08-18 15:05:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-funcy (Old) and /work/SRC/openSUSE:Factory/.python-funcy.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-funcy" Tue Aug 18 15:05:16 2020 rev:7 rq:825356 version:1.14 Changes: -------- --- /work/SRC/openSUSE:Factory/python-funcy/python-funcy.changes 2019-08-13 13:23:40.685380274 +0200 +++ /work/SRC/openSUSE:Factory/.python-funcy.new.3399/python-funcy.changes 2020-08-18 15:05:25.579901082 +0200 @@ -1,0 +2,10 @@ +Sun Aug 9 10:12:11 UTC 2020 - John Vandenberg <[email protected]> + +- Update to v1.14 + * stated Python 3.7 and 3.8 support + * dropped Python 2.6 + * added @wrap_prop() + * added filter_errors param to @retry() + * published nullcontext properly + +------------------------------------------------------------------- Old: ---- funcy-1.13.tar.gz New: ---- funcy-1.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-funcy.spec ++++++ --- /var/tmp/diff_new_pack.7PerWk/_old 2020-08-18 15:05:27.087901706 +0200 +++ /var/tmp/diff_new_pack.7PerWk/_new 2020-08-18 15:05:27.091901707 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-funcy # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,12 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-funcy -Version: 1.13 +Version: 1.14 Release: 0 Summary: Functional tools for Python License: BSD-3-Clause Group: Development/Languages/Python -URL: http://github.com/Suor/funcy +URL: https://github.com/Suor/funcy Source: https://files.pythonhosted.org/packages/source/f/funcy/funcy-%{version}.tar.gz BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} ++++++ funcy-1.13.tar.gz -> funcy-1.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/CHANGELOG new/funcy-1.14/CHANGELOG --- old/funcy-1.13/CHANGELOG 2019-08-04 13:49:10.000000000 +0200 +++ new/funcy-1.14/CHANGELOG 2019-11-28 20:08:47.000000000 +0100 @@ -1,3 +1,10 @@ +1.14 +- stated Python 3.7 and 3.8 support +- dropped Python 2.6 +- added @wrap_prop() +- added filter_errors param to @retry() +- published nullcontext properly + 1.13 - added @wrap_with() - added nullcontext diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/PKG-INFO new/funcy-1.14/PKG-INFO --- old/funcy-1.13/PKG-INFO 2019-08-04 13:56:20.000000000 +0200 +++ new/funcy-1.14/PKG-INFO 2019-11-28 20:41:42.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: funcy -Version: 1.13 +Version: 1.14 Summary: A fancy and practical functional tools Home-page: http://github.com/Suor/funcy Author: Alexander Schepanovski @@ -17,7 +17,7 @@ or `read the docs <http://funcy.readthedocs.org/>`_. Or jump directly to `cheatsheet <http://funcy.readthedocs.io/en/stable/cheatsheet.html>`_. - Works with Python 2.6+, 3.3+ and pypy. + Works with Python 2.7, 3.4+ and pypy. Installation @@ -212,13 +212,13 @@ Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 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: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/README.rst new/funcy-1.14/README.rst --- old/funcy-1.13/README.rst 2018-10-03 14:49:11.000000000 +0200 +++ new/funcy-1.14/README.rst 2019-11-16 20:17:14.000000000 +0100 @@ -7,7 +7,7 @@ or `read the docs <http://funcy.readthedocs.org/>`_. Or jump directly to `cheatsheet <http://funcy.readthedocs.io/en/stable/cheatsheet.html>`_. -Works with Python 2.6+, 3.3+ and pypy. +Works with Python 2.7, 3.4+ and pypy. Installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/VERSION new/funcy-1.14/VERSION --- old/funcy-1.13/VERSION 2019-08-04 13:49:35.000000000 +0200 +++ new/funcy-1.14/VERSION 2019-11-28 20:15:30.000000000 +0100 @@ -1 +1 @@ -1.13 +1.14 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/funcy/compat.py new/funcy-1.14/funcy/compat.py --- old/funcy-1.13/funcy/compat.py 2019-04-30 12:25:18.000000000 +0200 +++ new/funcy-1.14/funcy/compat.py 2019-11-28 13:43:34.000000000 +0100 @@ -25,30 +25,6 @@ from collections import Mapping, Set, Sequence, Iterable, Iterator, Hashable # noqa -try: - from contextlib import nullcontext -except ImportError: - class nullcontext(object): - """Context manager that does no additional processing. - - Used as a stand-in for a normal context manager, when a particular - block of code is only sometimes used with a normal context manager: - - cm = optional_cm if condition else nullcontext() - with cm: - # Perform operation, using optional_cm if condition is True - """ - - def __init__(self, enter_result=None): - self.enter_result = enter_result - - def __enter__(self): - return self.enter_result - - def __exit__(self, *excinfo): - pass - - import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/funcy/flow.py new/funcy-1.14/funcy/flow.py --- old/funcy-1.13/funcy/flow.py 2019-07-15 10:59:07.000000000 +0200 +++ new/funcy-1.14/funcy/flow.py 2019-11-28 19:29:12.000000000 +0100 @@ -6,7 +6,7 @@ from .decorators import decorator, wraps, get_argnames, arggetter, contextmanager -__all__ = ['raiser', 'ignore', 'silent', 'suppress', 'reraise', 'retry', 'fallback', +__all__ = ['raiser', 'ignore', 'silent', 'suppress', 'nullcontext', 'reraise', 'retry', 'fallback', 'limit_error_rate', 'ErrorRateExceeded', 'post_processing', 'collecting', 'joining', 'once', 'once_per', 'once_per_args', @@ -76,6 +76,31 @@ return exctype is not None and issubclass(exctype, self._exceptions) +### Backport of Python 3.7 nullcontext +try: + from contextlib import nullcontext +except ImportError: + class nullcontext(object): + """Context manager that does no additional processing. + + Used as a stand-in for a normal context manager, when a particular + block of code is only sometimes used with a normal context manager: + + cm = optional_cm if condition else nullcontext() + with cm: + # Perform operation, using optional_cm if condition is True + """ + + def __init__(self, enter_result=None): + self.enter_result = enter_result + + def __enter__(self): + return self.enter_result + + def __exit__(self, *excinfo): + pass + + @contextmanager def reraise(errors, into): """Reraises errors as other exception.""" @@ -87,7 +112,7 @@ @decorator -def retry(call, tries, errors=Exception, timeout=0): +def retry(call, tries, errors=Exception, timeout=0, filter_errors=None): """Makes decorated function retry up to tries times. Retries only on specified errors. Sleeps timeout or timeout(attempt) seconds between tries.""" @@ -95,7 +120,10 @@ for attempt in range(tries): try: return call() - except errors: + except errors as e: + if not (filter_errors is None or filter_errors(e)): + raise + # Reraise error on last attempt if attempt + 1 == tries: raise @@ -210,7 +238,7 @@ @decorator -def wrap_with(call, manager): +def wrap_with(call, ctx): """Turn context manager into a decorator""" - with manager: + with ctx: return call() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/funcy/objects.py new/funcy-1.14/funcy/objects.py --- old/funcy-1.13/funcy/objects.py 2019-03-27 09:07:03.000000000 +0100 +++ new/funcy-1.14/funcy/objects.py 2019-11-28 14:14:52.000000000 +0100 @@ -6,7 +6,7 @@ from .strings import cut_prefix -__all__ = ['cached_property', 'cached_readonly', 'monkey', 'namespace', 'LazyObject'] +__all__ = ['cached_property', 'cached_readonly', 'wrap_prop', 'monkey', 'namespace', 'LazyObject'] class cached_property(object): @@ -35,6 +35,34 @@ raise AttributeError("property is read-only") +def wrap_prop(ctx): + """Wrap a property accessors with a context manager""" + def decorator(prop): + class WrapperProp(object): + def __repr__(self): + return repr(prop) + + def __get__(self, instance, type=None): + if instance is None: + return self + + with ctx: + return prop.__get__(instance, type) + + if hasattr(prop, '__set__'): + def __set__(self, name, value): + with ctx: + return prop.__set__(name, value) + + if hasattr(prop, '__del__'): + def __del__(self, name): + with ctx: + return prop.__del__(name) + + return WrapperProp() + return decorator + + def monkey(cls, name=None): """ Monkey patches class or module by adding to it decorated function. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/funcy/py3.py new/funcy-1.14/funcy/py3.py --- old/funcy-1.13/funcy/py3.py 2019-05-11 09:53:54.000000000 +0200 +++ new/funcy-1.14/funcy/py3.py 2019-11-28 13:59:25.000000000 +0100 @@ -13,7 +13,6 @@ from .objects import * from .debug import * from .primitives import * -from .compat import nullcontext # noqa # Setup __all__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/funcy.egg-info/PKG-INFO new/funcy-1.14/funcy.egg-info/PKG-INFO --- old/funcy-1.13/funcy.egg-info/PKG-INFO 2019-08-04 13:56:20.000000000 +0200 +++ new/funcy-1.14/funcy.egg-info/PKG-INFO 2019-11-28 20:41:41.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: funcy -Version: 1.13 +Version: 1.14 Summary: A fancy and practical functional tools Home-page: http://github.com/Suor/funcy Author: Alexander Schepanovski @@ -17,7 +17,7 @@ or `read the docs <http://funcy.readthedocs.org/>`_. Or jump directly to `cheatsheet <http://funcy.readthedocs.io/en/stable/cheatsheet.html>`_. - Works with Python 2.6+, 3.3+ and pypy. + Works with Python 2.7, 3.4+ and pypy. Installation @@ -212,13 +212,13 @@ Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 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: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/funcy.egg-info/SOURCES.txt new/funcy-1.14/funcy.egg-info/SOURCES.txt --- old/funcy-1.13/funcy.egg-info/SOURCES.txt 2019-08-04 13:56:20.000000000 +0200 +++ new/funcy-1.14/funcy.egg-info/SOURCES.txt 2019-11-28 20:41:41.000000000 +0100 @@ -47,6 +47,7 @@ tests/__pycache__/__init__.cpython-35.pyc tests/__pycache__/__init__.cpython-36.pyc tests/__pycache__/__init__.cpython-37.pyc +tests/__pycache__/__init__.cpython-38.pyc tests/__pycache__/__init__.pypy-41.pyc tests/__pycache__/test_calc.cpython-27-PYTEST.pyc tests/__pycache__/test_calc.cpython-35-PYTEST.pyc @@ -54,6 +55,7 @@ tests/__pycache__/test_calc.cpython-36-PYTEST.pyc tests/__pycache__/test_calc.cpython-37-PYTEST.pyc tests/__pycache__/test_calc.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_calc.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_calc.pypy-41-PYTEST.pyc tests/__pycache__/test_colls.cpython-27-PYTEST.pyc tests/__pycache__/test_colls.cpython-35-PYTEST.pyc @@ -61,6 +63,7 @@ tests/__pycache__/test_colls.cpython-36-PYTEST.pyc tests/__pycache__/test_colls.cpython-37-PYTEST.pyc tests/__pycache__/test_colls.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_colls.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_colls.pypy-41-PYTEST.pyc tests/__pycache__/test_debug.cpython-27-PYTEST.pyc tests/__pycache__/test_debug.cpython-35-PYTEST.pyc @@ -68,6 +71,7 @@ tests/__pycache__/test_debug.cpython-36-PYTEST.pyc tests/__pycache__/test_debug.cpython-37-PYTEST.pyc tests/__pycache__/test_debug.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_debug.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_debug.pypy-41-PYTEST.pyc tests/__pycache__/test_decorators.cpython-27-PYTEST.pyc tests/__pycache__/test_decorators.cpython-35-PYTEST.pyc @@ -75,6 +79,7 @@ tests/__pycache__/test_decorators.cpython-36-PYTEST.pyc tests/__pycache__/test_decorators.cpython-37-PYTEST.pyc tests/__pycache__/test_decorators.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_decorators.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_decorators.pypy-41-PYTEST.pyc tests/__pycache__/test_flow.cpython-27-PYTEST.pyc tests/__pycache__/test_flow.cpython-35-PYTEST.pyc @@ -82,6 +87,7 @@ tests/__pycache__/test_flow.cpython-36-PYTEST.pyc tests/__pycache__/test_flow.cpython-37-PYTEST.pyc tests/__pycache__/test_flow.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_flow.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_flow.pypy-41-PYTEST.pyc tests/__pycache__/test_funcmakers.cpython-27-PYTEST.pyc tests/__pycache__/test_funcmakers.cpython-35-PYTEST.pyc @@ -89,6 +95,7 @@ tests/__pycache__/test_funcmakers.cpython-36-PYTEST.pyc tests/__pycache__/test_funcmakers.cpython-37-PYTEST.pyc tests/__pycache__/test_funcmakers.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_funcmakers.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_funcmakers.pypy-41-PYTEST.pyc tests/__pycache__/test_funcolls.cpython-27-PYTEST.pyc tests/__pycache__/test_funcolls.cpython-35-PYTEST.pyc @@ -96,6 +103,7 @@ tests/__pycache__/test_funcolls.cpython-36-PYTEST.pyc tests/__pycache__/test_funcolls.cpython-37-PYTEST.pyc tests/__pycache__/test_funcolls.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_funcolls.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_funcolls.pypy-41-PYTEST.pyc tests/__pycache__/test_funcs.cpython-27-PYTEST.pyc tests/__pycache__/test_funcs.cpython-35-PYTEST.pyc @@ -103,6 +111,7 @@ tests/__pycache__/test_funcs.cpython-36-PYTEST.pyc tests/__pycache__/test_funcs.cpython-37-PYTEST.pyc tests/__pycache__/test_funcs.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_funcs.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_funcs.pypy-41-PYTEST.pyc tests/__pycache__/test_interface.cpython-27-PYTEST.pyc tests/__pycache__/test_interface.cpython-35-PYTEST.pyc @@ -110,6 +119,7 @@ tests/__pycache__/test_interface.cpython-36-PYTEST.pyc tests/__pycache__/test_interface.cpython-37-PYTEST.pyc tests/__pycache__/test_interface.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_interface.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_interface.pypy-41-PYTEST.pyc tests/__pycache__/test_objects.cpython-27-PYTEST.pyc tests/__pycache__/test_objects.cpython-35-PYTEST.pyc @@ -117,6 +127,7 @@ tests/__pycache__/test_objects.cpython-36-PYTEST.pyc tests/__pycache__/test_objects.cpython-37-PYTEST.pyc tests/__pycache__/test_objects.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_objects.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_objects.pypy-41-PYTEST.pyc tests/__pycache__/test_seqs.cpython-27-PYTEST.pyc tests/__pycache__/test_seqs.cpython-35-PYTEST.pyc @@ -124,6 +135,7 @@ tests/__pycache__/test_seqs.cpython-36-PYTEST.pyc tests/__pycache__/test_seqs.cpython-37-PYTEST.pyc tests/__pycache__/test_seqs.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_seqs.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_seqs.pypy-41-PYTEST.pyc tests/__pycache__/test_strings.cpython-27-PYTEST.pyc tests/__pycache__/test_strings.cpython-35-PYTEST.pyc @@ -131,6 +143,7 @@ tests/__pycache__/test_strings.cpython-36-PYTEST.pyc tests/__pycache__/test_strings.cpython-37-PYTEST.pyc tests/__pycache__/test_strings.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_strings.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_strings.pypy-41-PYTEST.pyc tests/__pycache__/test_tree.cpython-27-PYTEST.pyc tests/__pycache__/test_tree.cpython-35-PYTEST.pyc @@ -138,6 +151,7 @@ tests/__pycache__/test_tree.cpython-36-PYTEST.pyc tests/__pycache__/test_tree.cpython-37-PYTEST.pyc tests/__pycache__/test_tree.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_tree.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_tree.pypy-41-PYTEST.pyc tests/__pycache__/test_types.cpython-27-PYTEST.pyc tests/__pycache__/test_types.cpython-35-PYTEST.pyc @@ -145,4 +159,5 @@ tests/__pycache__/test_types.cpython-36-PYTEST.pyc tests/__pycache__/test_types.cpython-37-PYTEST.pyc tests/__pycache__/test_types.cpython-37-pytest-5.0.1.pyc +tests/__pycache__/test_types.cpython-38-pytest-5.3.1.pyc tests/__pycache__/test_types.pypy-41-PYTEST.pyc \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/setup.py new/funcy-1.14/setup.py --- old/funcy-1.13/setup.py 2018-10-03 14:49:11.000000000 +0200 +++ new/funcy-1.14/setup.py 2019-11-28 20:15:42.000000000 +0100 @@ -27,13 +27,13 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', Binary files old/funcy-1.13/tests/__pycache__/__init__.cpython-38.pyc and new/funcy-1.14/tests/__pycache__/__init__.cpython-38.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_calc.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_calc.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_colls.cpython-37-pytest-5.0.1.pyc and new/funcy-1.14/tests/__pycache__/test_colls.cpython-37-pytest-5.0.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_colls.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_colls.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_debug.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_debug.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_decorators.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_decorators.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_flow.cpython-27-PYTEST.pyc and new/funcy-1.14/tests/__pycache__/test_flow.cpython-27-PYTEST.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_flow.cpython-37-pytest-5.0.1.pyc and new/funcy-1.14/tests/__pycache__/test_flow.cpython-37-pytest-5.0.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_flow.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_flow.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_funcmakers.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_funcmakers.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_funcolls.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_funcolls.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_funcs.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_funcs.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_interface.cpython-27-PYTEST.pyc and new/funcy-1.14/tests/__pycache__/test_interface.cpython-27-PYTEST.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_interface.cpython-37-pytest-5.0.1.pyc and new/funcy-1.14/tests/__pycache__/test_interface.cpython-37-pytest-5.0.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_interface.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_interface.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_objects.cpython-27-PYTEST.pyc and new/funcy-1.14/tests/__pycache__/test_objects.cpython-27-PYTEST.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_objects.cpython-37-pytest-5.0.1.pyc and new/funcy-1.14/tests/__pycache__/test_objects.cpython-37-pytest-5.0.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_objects.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_objects.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_seqs.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_seqs.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_strings.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_strings.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_tree.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_tree.cpython-38-pytest-5.3.1.pyc differ Binary files old/funcy-1.13/tests/__pycache__/test_types.cpython-38-pytest-5.3.1.pyc and new/funcy-1.14/tests/__pycache__/test_types.cpython-38-pytest-5.3.1.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/tests/test_colls.py new/funcy-1.14/tests/test_colls.py --- old/funcy-1.13/tests/test_colls.py 2019-03-12 16:51:38.000000000 +0100 +++ new/funcy-1.14/tests/test_colls.py 2019-11-28 20:14:12.000000000 +0100 @@ -12,10 +12,6 @@ return type(a) is type(b) and a == b \ and (a.default_factory == b.default_factory if isinstance(a, defaultdict) else True) -def S(*args): - """"Set literal" for the poor python 2.6""" - return set(args) - def inc(x): return x + 1 @@ -64,7 +60,7 @@ assert eq(join([('a', 'b'), ('c',)]), tuple('abc')) assert eq(join([{'a': 1}, {'b': 2}]), {'a': 1, 'b': 2}) assert eq(join([{'a': 1}, {'a': 2}]), {'a': 2}) - assert eq(join([S(1,2), S(3)]), S(1,2,3)) + assert eq(join([{1,2}, {3}]), {1,2,3}) it1 = (x for x in range(2)) it2 = (x for x in range(5, 7)) @@ -79,7 +75,7 @@ assert join(iter('abc')) == 'abc' assert join(iter([[1], [2]])) == [1, 2] assert eq(join(iter([{'a': 1}, {'b': 2}])), {'a': 1, 'b': 2}) - assert eq(join(iter([S(1,2), S(3)])), S(1,2,3)) + assert eq(join(iter([{1,2}, {3}])), {1,2,3}) it1 = (x for x in range(2)) it2 = (x for x in range(5, 7)) @@ -100,7 +96,7 @@ def test_walk(): assert eq(walk(inc, [1,2,3]), [2,3,4]) assert eq(walk(inc, (1,2,3)), (2,3,4)) - assert eq(walk(inc, S(1,2,3)), S(2,3,4)) + assert eq(walk(inc, {1,2,3}), {2,3,4}) assert eq(walk(hinc, {1:1,2:2,3:3}), {2:2,3:3,4:4}) def test_walk_iter(): @@ -111,10 +107,10 @@ assert isinstance(it, Iterator) and list(it) == [1,2,3] def test_walk_extended(): - assert walk(None, S(2, 3)) == S(2, 3) - assert walk(r'\d+', S('a2', '13b')) == S('2', '13') + assert walk(None, {2, 3}) == {2, 3} + assert walk(r'\d+', {'a2', '13b'}) == {'2', '13'} assert walk({'a': '1', 'b': '2'}, 'ab') == '12' - assert walk(S(1, 2, 3), (0, 1, 2)) == (False, True, True) + assert walk({1, 2, 3}, (0, 1, 2)) == (False, True, True) def test_walk_keys(): assert walk_keys(str.upper, {'a': 1, 'b':2}) == {'A': 1, 'B': 2} @@ -135,14 +131,14 @@ def test_select(): assert eq(select(_ > 1, [1,2,3]), [2,3]) assert eq(select(_ > 1, (1,2,3)), (2,3)) - assert eq(select(_ > 1, S(1,2,3)), S(2,3)) + assert eq(select(_ > 1, {1,2,3}), {2,3}) assert eq(select(_[1] > 1, {'a':1,'b':2,'c':3}), {'b':2,'c':3}) assert select(_[1] > 1, defaultdict(int)) == {} def test_select_extended(): assert select(None, [2, 3, 0]) == [2, 3] assert select(r'\d', 'a23bn45') == '2345' - assert select(S(1,2,3), (0, 1, 2, 4, 1)) == (1, 2, 1) + assert select({1,2,3}, (0, 1, 2, 4, 1)) == (1, 2, 1) def test_select_keys(): assert select_keys(_[0] == 'a', {'a':1, 'b':2, 'ab':3}) == {'a': 1, 'ab':3} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/tests/test_flow.py new/funcy-1.14/tests/test_flow.py --- old/funcy-1.13/tests/test_flow.py 2019-07-15 11:07:28.000000000 +0200 +++ new/funcy-1.14/tests/test_flow.py 2019-11-28 19:56:27.000000000 +0100 @@ -69,19 +69,12 @@ def test_retry(): - calls = [] + with pytest.raises(MyError): + _make_failing()() + assert retry(2, MyError)(_make_failing())() == 1 - def failing(n=1): - if len(calls) < n: - calls.append(1) - raise MyError - return 1 - - with pytest.raises(MyError): failing() - calls = [] - assert retry(2, MyError)(failing)() == 1 - calls = [] - with pytest.raises(MyError): retry(2, MyError)(failing)(2) + with pytest.raises(MyError): + retry(2, MyError)(_make_failing(n=2))() def test_retry_timeout(monkeypatch): @@ -93,27 +86,41 @@ # sleep only between tries, so retry is 11, but sleep summary is ~0.1 sec del timeouts[:] - with pytest.raises(MyError): retry(11, MyError, timeout=1)(failing)() + with pytest.raises(MyError): + retry(11, MyError, timeout=1)(failing)() assert timeouts == [1] * 10 # exponential timeout del timeouts[:] - with pytest.raises(MyError): retry(4, MyError, timeout=lambda a: 2 ** a)(failing)() + with pytest.raises(MyError): + retry(4, MyError, timeout=lambda a: 2 ** a)(failing)() assert timeouts == [1, 2, 4] def test_retry_many_errors(): + assert retry(2, (MyError, RuntimeError))(_make_failing())() == 1 + assert retry(2, [MyError, RuntimeError])(_make_failing())() == 1 + + +def test_retry_filter(): + error_pred = lambda e: 'x' in str(e) + retry_deco = retry(2, MyError, filter_errors=error_pred) + + assert retry_deco(_make_failing(e=MyError('x')))() == 1 + with pytest.raises(MyError): + retry_deco(_make_failing())() + + +def _make_failing(n=1, e=MyError): calls = [] - def failing(n=1): + def failing(): if len(calls) < n: calls.append(1) - raise MyError + raise e return 1 - assert retry(2, (MyError, RuntimeError))(failing)() == 1 - calls = [] - assert retry(2, [MyError, RuntimeError])(failing)() == 1 + return failing def test_fallback(): @@ -199,6 +206,7 @@ def test_wrap_with(): calls = [] + # Not using @contextmanager to not make this a decorator class Manager: def __enter__(self): calls.append(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/funcy-1.13/tests/test_objects.py new/funcy-1.14/tests/test_objects.py --- old/funcy-1.13/tests/test_objects.py 2019-03-27 09:07:11.000000000 +0100 +++ new/funcy-1.14/tests/test_objects.py 2019-11-28 15:16:38.000000000 +0100 @@ -1,6 +1,7 @@ import sys import pytest from funcy.objects import * +from funcy import suppress ### @cached_property @@ -48,6 +49,50 @@ a.prop = 8 +def test_wrap_prop(): + calls = [] + + # Not using @contextmanager to not make this a decorator + class Manager: + def __init__(self, name): + self.name = name + + def __enter__(self): + calls.append(self.name) + return self + + def __exit__(self, *args): + pass + + class A(object): + @wrap_prop(Manager('p')) + @property + def prop(self): + return 1 + + @wrap_prop(Manager('cp')) + @cached_property + def cached_prop(self): + return 1 + + a = A() + assert a.prop and calls == ['p'] + assert a.prop and calls == ['p', 'p'] + assert a.cached_prop and calls == ['p', 'p', 'cp'] + assert a.cached_prop and calls == ['p', 'p', 'cp'] + + # Wrap __set__ for data props + a = A() + calls[:] = [] + with suppress(AttributeError): + a.prop = 2 + assert calls == ['p'] + + # Do not wrap __set__ for non-data props + a.cached_property = 2 + assert calls == ['p'] + + ### Monkey tests def test_monkey():
