From 0696e987e3a589338fd32b583973563c9045b934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kone=C4=8Dn=C3=BD?= Date: Fri, 3 Apr 2020 16:28:06 +0200 Subject: [PATCH] Update to 4.4.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Konečný --- python-decorator.spec | 16 ++-- python39.patch | 170 ------------------------------------------ sources | 2 +- 3 files changed, 8 insertions(+), 180 deletions(-) delete mode 100644 python39.patch diff --git a/python-decorator.spec b/python-decorator.spec index e6b07a6..e3c6be1 100644 --- a/python-decorator.spec +++ b/python-decorator.spec @@ -1,20 +1,14 @@ %global pypi_name decorator Name: python-%{pypi_name} -Version: 4.4.0 -Release: 6%{?dist} +Version: 4.4.2 +Release: 1%{?dist} Summary: Module to simplify usage of decorators License: BSD URL: https://github.com/micheles/decorator Source0: %pypi_source decorator -# Python 3.9 compatibility -# https://bugzilla.redhat.com/show_bug.cgi?id=1787746 -# https://github.com/micheles/decorator/issues/75 -# https://github.com/micheles/decorator/pull/76 -Patch1: python39.patch - BuildArch: noarch BuildRequires: python3-setuptools @@ -52,13 +46,17 @@ find %{buildroot} -name SOURCES.txt~ -exec rm -f {} \; %{__python3} setup.py test %files -n python3-%{pypi_name} -%doc README.md CHANGES.md +%doc README.rst CHANGES.md %license LICENSE.txt %{python3_sitelib}/decorator.py %{python3_sitelib}/decorator-*.egg-info/ %{python3_sitelib}/__pycache__/* %changelog +* Fri Apr 03 2020 Michal Konečný - 4.4.2-1 +- new version + Remove python39.patch no longer needed + * Thu Jan 30 2020 Fedora Release Engineering - 4.4.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/python39.patch b/python39.patch deleted file mode 100644 index c1ced80..0000000 --- a/python39.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 482f0833884fe490d50eb03a08eebfb19e9ed46d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Sat, 4 Jan 2020 23:59:54 +0100 -Subject: [PATCH 1/2] Python 3.9 compatibility - -Thread.isAlive() is deprecated in 3.8 and removed in 3.9: - - $ python3.8 -c 'import threading; t = threading.Thread(); t.isAlive()' - :1: DeprecationWarning: isAlive() is deprecated, use is_alive() instead - - $ python3.9 -c 'import threading; t = threading.Thread(); t.isAlive()' - Traceback (most recent call last): - File "", line 1, in - AttributeError: 'Thread' object has no attribute 'isAlive' - -Fixes https://github.com/micheles/decorator/issues/75 ---- - src/tests/documentation.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/tests/documentation.py b/src/tests/documentation.py -index 2888ea1..bd3367c 100644 ---- a/src/tests/documentation.py -+++ b/src/tests/documentation.py -@@ -1531,7 +1531,7 @@ def set_result(): - f.thread = threading.Thread(None, set_result) - f.thread.start() - return msg -- elif f.thread.isAlive(): -+ elif f.thread.is_alive(): - return msg - else: # the thread is ended, return the stored result - del f.thread - -From 89907e760bdc32c3a6e5169015ded485b4d992fb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Sun, 5 Jan 2020 00:13:52 +0100 -Subject: [PATCH 2/2] On Python 3.9, we cannot longer avoid using - collections.abc - -Related to https://github.com/micheles/decorator/issues/75#issuecomment-570827328 ---- - docs/documentation.md | 35 +++++++++++++++++---------------- - src/tests/documentation.py | 40 ++++++++++++++++++++------------------ - 2 files changed, 39 insertions(+), 36 deletions(-) - -diff --git a/src/tests/documentation.py b/src/tests/documentation.py -index bd3367c..60a37a2 100644 ---- a/src/tests/documentation.py -+++ b/src/tests/documentation.py -@@ -9,6 +9,7 @@ - import collections.abc as c - except ImportError: - c = collections -+ collections.abc = collections - from decorator import (decorator, decorate, FunctionMaker, contextmanager, - dispatch_on, __version__) - -@@ -1008,15 +1009,16 @@ def coro_to_func(coro, *args, **kw): - $$WithLength - - This class defines a ``__len__`` method, and is therefore --considered to be a subclass of the abstract base class ``collections.Sized``: -+considered to be a subclass of the abstract base class -+``collections.abc.Sized`` (``collections.Sized`` on Python 2): - - ```python -->>> issubclass(WithLength, collections.Sized) -+>>> issubclass(WithLength, collections.abc.Sized) - True - - ``` - --However, ``collections.Sized`` is not in the MRO_ of ``WithLength``; it -+However, ``collections.abc.Sized`` is not in the MRO_ of ``WithLength``; it - is not a true ancestor. Any implementation of generic functions (even - with single dispatch) must go through some contorsion to take into - account the virtual ancestors. -@@ -1037,7 +1039,7 @@ def coro_to_func(coro, *args, **kw): - - ``` - --...even if ``collections.Sized`` is not a true ancestor of ``WithLength``. -+...even if ``collections.abc.Sized`` is not a true ancestor of ``WithLength``. - - Of course, this is a contrived example--you could just use the - builtin ``len``--but you should get the idea. -@@ -1053,14 +1055,14 @@ def coro_to_func(coro, *args, **kw): - $$SomeSet - - Here, the author of ``SomeSet`` made a mistake by inheriting from --``collections.Sized`` (instead of ``collections.Set``). -+``collections.abc.Sized`` (instead of ``collections.abc.Set``). - - This is not a problem. You can register *a posteriori* --``collections.Set`` as a virtual ancestor of ``SomeSet``: -+``collections.abc.Set`` as a virtual ancestor of ``SomeSet``: - - ```python -->>> _ = collections.Set.register(SomeSet) -->>> issubclass(SomeSet, collections.Set) -+>>> _ = collections.abc.Set.register(SomeSet) -+>>> issubclass(SomeSet, collections.abc.Set) - True - - ``` -@@ -1080,10 +1082,10 @@ def coro_to_func(coro, *args, **kw): - ``` - - Sometimes it is not clear how to dispatch. For instance, consider a --class ``C`` registered both as ``collections.Iterable`` and --``collections.Sized``, and defines a generic function ``g`` with --implementations for both ``collections.Iterable`` *and* --``collections.Sized``: -+class ``C`` registered both as ``collections.abc.Iterable`` and -+``collections.abc.Sized``, and defines a generic function ``g`` with -+implementations for both ``collections.abc.Iterable`` *and* -+``collections.abc.Sized``: - - $$singledispatch_example1 - -@@ -1784,7 +1786,7 @@ def __len__(self): - return 0 - - --class SomeSet(collections.Sized): -+class SomeSet(collections.abc.Sized): - # methods that make SomeSet set-like - # not shown ... - def __len__(self): -@@ -1796,12 +1798,12 @@ def get_length(obj): - raise NotImplementedError(type(obj)) - - --@get_length.register(collections.Sized) -+@get_length.register(collections.abc.Sized) - def get_length_sized(obj): - return len(obj) - - --@get_length.register(collections.Set) -+@get_length.register(collections.abc.Set) - def get_length_set(obj): - return 1 - -@@ -1810,8 +1812,8 @@ class C(object): - "Registered as Sized and Iterable" - - --collections.Sized.register(C) --collections.Iterable.register(C) -+collections.abc.Sized.register(C) -+collections.abc.Iterable.register(C) - - - def singledispatch_example1(): -@@ -1821,11 +1823,11 @@ def singledispatch_example1(): - def g(obj): - raise NotImplementedError(type(g)) - -- @g.register(collections.Sized) -+ @g.register(collections.abc.Sized) - def g_sized(object): - return "sized" - -- @g.register(collections.Iterable) -+ @g.register(collections.abc.Iterable) - def g_iterable(object): - return "iterable" - diff --git a/sources b/sources index 2e4fab2..607efb6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (decorator-4.4.0.tar.gz) = 32c35c80581cb7fd0b2461d21c7eb14190294b2ccc9f92749b6bc74449f7d02a26281e9a2817f6f16871a6cddb7b02b8fae8119c22256fe43a6aaa31a7599dd5 +SHA512 (decorator-4.4.2.tar.gz) = c068efd4e70764ac447b772c9c29625c2180dad256b2b4e46a50a8479fc1d7de09b114c2ba11bb37dd58774ed9460d2e0ea9fa76061833a2d3c2676ac91a0db1