Hello community, here is the log from the commit of package python-typing for openSUSE:Leap:15.2 checked in at 2020-06-11 16:18:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-typing (Old) and /work/SRC/openSUSE:Leap:15.2/.python-typing.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typing" Thu Jun 11 16:18:26 2020 rev:16 rq:813235 version:3.7.4 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/python-typing/python-typing.changes 2020-01-15 15:53:57.635615692 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-typing.new.3606/python-typing.changes 2020-06-11 16:19:09.162924145 +0200 @@ -1,0 +2,46 @@ +Thu May 14 09:16:45 UTC 2020 - Matej Cepl <[email protected]> + +- Update to 3.7.4 (jsc#SLE-12548, bsc#1162547): + - Fix subclassing builtin protocols on older Python versions + - Move Protocol, runtime_checkable, Final, final, Literal, + and TypedDict to typing + - Add support for Python 3.8 in typing_extensions + - Unify the implementation of annotated in src_py2 and src_py3 + - Add Annotated in python2 + - Pep 593 py3 + - Drop support of Python 3.3 + - [typing-extensions] Simple implementation for IntVar + - Add a python 3.7+ version of Annotated to typing_extensions + - Add SupportsIndex + - Add TypedDict to typing_extensions + - Add Final to the README + - Run the tests using the current Python executable + - Fix GeneralMeta.__instancecheck__() for old style classes + - Add Literal[...] types to typing_extensions + - Fix instance/subclass checks of functions against runtime protocols. + - Bump typing_extension version + - Improve PyPI entry for typing_extensions + - Add Final to typing_extensions + - include license file for typing-extensions and in wheels + - Fix IO.closed to be property + - Backport Generic.__new__ fix + - Bump typing_extensions version before release + - Add missing 'NoReturn' to __all__ in typing.py + - Add annotations to NamedTuple children __new__ constructors + - Fix typing_extensions to support PEP 560 + - Pass *args and **kwargs to superclass in Generic.__new__ + - Fix interaction between generics and __init_subclass__ + - Fix protocols in unions (runtime problem) + - Fix interaction between typing_extensions and collections.abc + - Override subclass check for the singledispatch library + - Fix copying generic instances in Python 3 + - Switch to setuptools in typing_extensions + - Add class Protocol and @runtime to typing extensions + - get_type_hints(): find the right globalns for classes and modules + - Document the workflow for publishing wheels + - Make sure copy and deepcopy are returning same class + - Update pytest and pytest-xdist versions +- Add isinstance_w_gen_prot_subcls.patch to fix failing test + test_protocol_instance_works (gh#python/typing#656) + +------------------------------------------------------------------- Old: ---- typing-3.6.2.tar.gz New: ---- isinstance_w_gen_prot_subcls.patch typing-3.7.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-typing.spec ++++++ --- /var/tmp/diff_new_pack.jhmeVY/_old 2020-06-11 16:19:09.490925033 +0200 +++ /var/tmp/diff_new_pack.jhmeVY/_new 2020-06-11 16:19:09.494925043 +0200 @@ -20,13 +20,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-typing -Version: 3.6.2 +Version: 3.7.4 Release: 0 Summary: Type Hints for Python License: Python-2.0 Group: Development/Languages/Python Url: https://docs.python.org/3.5/library/typing.html Source: https://files.pythonhosted.org/packages/source/t/typing/typing-%{version}.tar.gz +Patch0: isinstance_w_gen_prot_subcls.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -50,6 +51,8 @@ %prep %setup -q -n typing-%{version} +%autopatch -p1 + ln -s python2 python_%{python2_bin_suffix} %if "%python3_bin_suffix" != "" ln -s src python_%{python3_bin_suffix} @@ -64,7 +67,8 @@ %if %{with tests} %check -%python_expand $python python_%{$python_bin_suffix}/test_typing.py +export PYTHONDONTWRITEBYTECODE=1 +%python_exec python_%{$python_bin_suffix}/test_typing.py %endif %files %{python_files} ++++++ isinstance_w_gen_prot_subcls.patch ++++++ >From a75292e5aa5aafb4b25207c2cc2a9d4647754bd0 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi <[email protected]> Date: Thu, 22 Aug 2019 13:15:51 +0100 Subject: [PATCH 1/2] Fix isinstance() with generic protocol subclasses after subscripting --- python2/test_typing.py | 21 +++++++++++++++++++++ python2/typing.py | 19 +++++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) --- a/python2/test_typing.py +++ b/python2/test_typing.py @@ -749,6 +749,27 @@ class ProtocolTests(BaseTestCase): self.assertIsInstance(C(1), P) self.assertIsInstance(C(1), PG) + def test_protocol_checks_after_subscript(self): + class P(Protocol[T]): pass + class C(P[T]): pass + class Old1: pass + class New1(object): pass + class Old2: pass + class New2(object): pass + CA = C[Any] # noqa + + self.assertNotIsInstance(Old1(), C) + self.assertNotIsInstance(New1(), C) + self.assertNotIsSubclass(Old2, C) + self.assertNotIsSubclass(New2, C) + + class D1(C[Any]): pass + class D2(C[Any]): pass + CI = C[int] # noqa + + self.assertIsInstance(D1(), C) + self.assertIsSubclass(D2, C) + def test_protocols_support_register(self): @runtime_checkable class P(Protocol): --- a/python2/typing.py +++ b/python2/typing.py @@ -1393,14 +1393,17 @@ class GenericMeta(TypingMeta, abc.ABCMet def __subclasscheck__(self, cls): if self.__origin__ is not None: - # This should only be modules within the standard - # library. singledispatch is the only exception, because - # it's a Python 2 backport of functools.singledispatch. - if sys._getframe(1).f_globals['__name__'] not in ['abc', 'functools', - 'singledispatch']: - raise TypeError("Parameterized generics cannot be used with class " - "or instance checks") - return False + # These should only be modules within the standard library. + # singledispatch is an exception, because it's a Python 2 backport + # of functools.singledispatch. + whitelist = ['abc', 'functools', 'singledispatch'] + if (sys._getframe(1).f_globals['__name__'] in whitelist or + # The second frame is needed for the case where we came + # from _ProtocolMeta.__subclasscheck__. + sys._getframe(2).f_globals['__name__'] in whitelist): + return False + raise TypeError("Parameterized generics cannot be used with class " + "or instance checks") if self is Generic: raise TypeError("Class %r cannot be used with class " "or instance checks" % self) ++++++ typing-3.6.2.tar.gz -> typing-3.7.4.tar.gz ++++++ ++++ 3717 lines of diff (skipped)
