Hello community, here is the log from the commit of package python-typing for openSUSE:Factory checked in at 2019-09-23 12:03:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-typing (Old) and /work/SRC/openSUSE:Factory/.python-typing.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typing" Mon Sep 23 12:03:31 2019 rev:10 rq:729746 version:3.7.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-typing/python-typing.changes 2019-07-30 13:07:02.286362189 +0200 +++ /work/SRC/openSUSE:Factory/.python-typing.new.7948/python-typing.changes 2019-09-23 12:03:32.809943645 +0200 @@ -1,0 +2,7 @@ +Tue Sep 10 09:39:56 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 3.7.4.1: + * No upstream changelog +- Remove merged patch test-sys-executable.patch + +------------------------------------------------------------------- Old: ---- test-sys-executable.patch typing-3.7.4.tar.gz New: ---- typing-3.7.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-typing.spec ++++++ --- /var/tmp/diff_new_pack.Rb5a7f/_old 2019-09-23 12:03:33.625943511 +0200 +++ /var/tmp/diff_new_pack.Rb5a7f/_new 2019-09-23 12:03:33.629943510 +0200 @@ -16,26 +16,25 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} %if %{python3_version_nodots} > 34 %define skip_python3 1 %endif -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-typing -Version: 3.7.4 +Version: 3.7.4.1 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 +URL: https://docs.python.org/3.5/library/typing.html Source: https://files.pythonhosted.org/packages/source/t/typing/typing-%{version}.tar.gz -Patch0: test-sys-executable.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildArch: noarch %if 0%{?suse_version} > 1320 BuildRequires: python3-testsuite %endif -BuildArch: noarch %python_subpackages %description @@ -43,7 +42,6 @@ %prep %setup -q -n typing-%{version} -%patch0 -p0 ln -s python2 python_%{python2_bin_suffix} ln -s src python_%{python3_bin_suffix} ++++++ typing-3.7.4.tar.gz -> typing-3.7.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/PKG-INFO new/typing-3.7.4.1/PKG-INFO --- old/typing-3.7.4/PKG-INFO 2019-06-20 00:31:38.000000000 +0200 +++ new/typing-3.7.4.1/PKG-INFO 2019-08-22 15:35:36.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: typing -Version: 3.7.4 +Version: 3.7.4.1 Summary: Type Hints for Python Home-page: https://docs.python.org/3/library/typing.html Author: Guido van Rossum, Jukka Lehtosalo, Łukasz Langa, Ivan Levkivskyi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/python2/test_typing.py new/typing-3.7.4.1/python2/test_typing.py --- old/typing-3.7.4/python2/test_typing.py 2019-06-19 23:38:29.000000000 +0200 +++ new/typing-3.7.4.1/python2/test_typing.py 2019-08-22 13:55:53.000000000 +0200 @@ -749,6 +749,27 @@ 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): @@ -988,12 +1009,12 @@ self.assertIsInstance(C(), P) self.assertIsInstance(D(), P) - def test_protocols_in_unions(self): - class P(Protocol): - x = None # type: int - Alias = typing.Union[typing.Iterable, P] - Alias2 = typing.Union[P, typing.Iterable] - self.assertEqual(Alias, Alias2) + def test_protocols_in_unions(self): + class P(Protocol): + x = None # type: int + Alias = typing.Union[typing.Iterable, P] + Alias2 = typing.Union[P, typing.Iterable] + self.assertEqual(Alias, Alias2) def test_protocols_pickleable(self): global P, CP # pickle wants to reference the class by name @@ -1827,7 +1848,6 @@ self.assertEqual(c.from_c, 'c') - class ClassVarTests(BaseTestCase): def test_basics(self): @@ -2308,8 +2328,8 @@ self.assertIsSubclass(MMB[str, str], typing.Mapping) self.assertIsSubclass(MMC, MMA) - class I(typing.Iterable): pass - self.assertNotIsSubclass(list, I) + class It(typing.Iterable): pass + self.assertNotIsSubclass(list, It) class G(typing.Generator[int, int, int]): pass def g(): yield 0 @@ -2366,8 +2386,8 @@ self.assertIsSubclass(S, typing.MutableSequence) self.assertIsSubclass(S, typing.Iterable) - class I(collections.Iterable): pass - self.assertIsSubclass(I, typing.Iterable) + class It(collections.Iterable): pass + self.assertIsSubclass(It, typing.Iterable) class A(collections.Mapping): pass class B: pass @@ -2659,7 +2679,7 @@ class NoTpCheck(object): class Inn(object): def __init__(self, x): - # type: (this is not actually a type) -> None + # type: (this is not actually a type) -> None # noqa pass self.assertTrue(NoTpCheck.__no_type_check__) self.assertTrue(NoTpCheck.Inn.__init__.__no_type_check__) @@ -2676,9 +2696,8 @@ file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'typing.py') try: - subprocess.check_output('python -OO {}'.format(file_path), - stderr=subprocess.STDOUT, - shell=True) + subprocess.check_output([sys.executable, '-OO', file_path], + stderr=subprocess.STDOUT) except subprocess.CalledProcessError: self.fail('Module does not compile with optimize=2 (-OO flag).') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/python2/typing.py new/typing-3.7.4.1/python2/typing.py --- old/typing-3.7.4/python2/typing.py 2019-06-19 23:38:29.000000000 +0200 +++ new/typing-3.7.4.1/python2/typing.py 2019-08-22 14:56:37.000000000 +0200 @@ -1393,14 +1393,17 @@ 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) @@ -1780,7 +1783,8 @@ if cls._is_protocol: for base in cls.__mro__[1:]: if not (base in (object, Generic) or - base.__module__ == '_abcoll' and base.__name__ in _PROTO_WHITELIST or + base.__module__ == '_abcoll' and + base.__name__ in _PROTO_WHITELIST or isinstance(base, TypingMeta) and base._is_protocol or isinstance(base, GenericMeta) and base.__origin__ is Generic): raise TypeError('Protocols can only inherit from other protocols,' @@ -1834,7 +1838,9 @@ def __subclasscheck__(self, cls): if (self.__dict__.get('_is_protocol', None) and not self.__dict__.get('_is_runtime_protocol', None)): - if sys._getframe(1).f_globals['__name__'] in ['abc', 'functools']: + if (sys._getframe(1).f_globals['__name__'] in ['abc', 'functools'] or + # This is needed because we remove subclasses from unions on Python 2. + sys._getframe(2).f_globals['__name__'] == 'typing'): return False raise TypeError("Instance and class checks can only be used with" " @runtime_checkable protocols") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/setup.py new/typing-3.7.4.1/setup.py --- old/typing-3.7.4/setup.py 2019-06-19 23:39:27.000000000 +0200 +++ new/typing-3.7.4.1/setup.py 2019-08-22 15:18:05.000000000 +0200 @@ -9,7 +9,7 @@ 'to install the typing package.\n') exit(1) -version = '3.7.4' +version = '3.7.4.1' description = 'Type Hints for Python' long_description = '''\ Typing -- Type Hints for Python diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/src/mod_generics_cache.py new/typing-3.7.4.1/src/mod_generics_cache.py --- old/typing-3.7.4/src/mod_generics_cache.py 2019-06-16 02:17:02.000000000 +0200 +++ new/typing-3.7.4.1/src/mod_generics_cache.py 2019-08-07 18:00:13.000000000 +0200 @@ -12,11 +12,9 @@ T = TypeVar('T') - class A(Generic[T]): some_b: 'B' - class B(Generic[T]): class A(Generic[T]): pass @@ -35,13 +33,11 @@ T = TypeVar('T') - class A(Generic[T]): __annotations__ = dict( some_b='B' ) - class B(Generic[T]): class A(Generic[T]): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/src/test_typing.py new/typing-3.7.4.1/src/test_typing.py --- old/typing-3.7.4/src/test_typing.py 2019-06-19 23:38:29.000000000 +0200 +++ new/typing-3.7.4.1/src/test_typing.py 2019-08-22 13:46:59.000000000 +0200 @@ -12,7 +12,7 @@ from typing import TypeVar, AnyStr from typing import T, KT, VT # Not in __all__. from typing import Union, Optional -from typing import Tuple, List, MutableMapping +from typing import Tuple, List, MutableMapping, Iterator from typing import Callable from typing import Generic, ClassVar, GenericMeta from typing import cast @@ -1539,7 +1539,7 @@ def test_delayed_syntax_error(self): - def foo(a: 'Node[T'): + def foo(a: 'Node[T'): # noqa pass with self.assertRaises(SyntaxError): @@ -1555,7 +1555,7 @@ def test_name_error(self): - def foo(a: 'Noode[T]'): + def foo(a: 'Noode[T]'): # noqa pass with self.assertRaises(NameError): @@ -1564,7 +1564,7 @@ def test_no_type_check(self): @no_type_check - def foo(a: 'whatevers') -> {}: + def foo(a: 'whatevers') -> {}: # noqa pass th = get_type_hints(foo) @@ -1574,7 +1574,7 @@ @no_type_check class C: - def foo(a: 'whatevers') -> {}: + def foo(a: 'whatevers') -> {}: # noqa pass cth = get_type_hints(C.foo) @@ -1600,12 +1600,12 @@ self.assertEqual(magic_decorator.__name__, 'magic_decorator') @magic_decorator - def foo(a: 'whatevers') -> {}: + def foo(a: 'whatevers') -> {}: # noqa pass @magic_decorator class C: - def foo(a: 'whatevers') -> {}: + def foo(a: 'whatevers') -> {}: # noqa pass self.assertEqual(foo.__name__, 'foo') @@ -1764,7 +1764,7 @@ # fake names for the sake of static analysis ann_module = ann_module2 = ann_module3 = None A = B = CSub = G = CoolEmployee = CoolEmployeeWithDefault = object - XMeth = XRepr = NoneAndForward = object + XMeth = XRepr = NoneAndForward = HasForeignBaseClass = object gth = get_type_hints @@ -1826,7 +1826,7 @@ @no_type_check class NoTpCheck: class Inn: - def __init__(self, x: 'not a type'): ... + def __init__(self, x: 'not a type'): ... # noqa self.assertTrue(NoTpCheck.__no_type_check__) self.assertTrue(NoTpCheck.Inn.__init__.__no_type_check__) self.assertEqual(gth(ann_module2.NTC.meth), {}) @@ -2233,8 +2233,8 @@ self.assertIsSubclass(MMB[str, str], typing.Mapping) self.assertIsSubclass(MMC, MMA) - class I(typing.Iterable): ... - self.assertNotIsSubclass(list, I) + class It(typing.Iterable): ... + self.assertNotIsSubclass(list, It) class G(typing.Generator[int, int, int]): ... def g(): yield 0 @@ -2316,8 +2316,8 @@ self.assertIsSubclass(S, typing.MutableSequence) self.assertIsSubclass(S, typing.Iterable) - class I(collections_abc.Iterable): ... - self.assertIsSubclass(I, typing.Iterable) + class It(collections_abc.Iterable): ... + self.assertIsSubclass(It, typing.Iterable) class A(collections_abc.Mapping, metaclass=abc.ABCMeta): ... class B: ... @@ -2653,9 +2653,8 @@ file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'typing.py') try: - subprocess.check_output('python -OO {}'.format(file_path), - stderr=subprocess.STDOUT, - shell=True) + subprocess.check_output([sys.executable, '-OO', file_path], + stderr=subprocess.STDOUT) except subprocess.CalledProcessError: self.fail('Module does not compile with optimize=2 (-OO flag).') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typing-3.7.4/src/typing.egg-info/PKG-INFO new/typing-3.7.4.1/src/typing.egg-info/PKG-INFO --- old/typing-3.7.4/src/typing.egg-info/PKG-INFO 2019-06-20 00:31:37.000000000 +0200 +++ new/typing-3.7.4.1/src/typing.egg-info/PKG-INFO 2019-08-22 15:35:36.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: typing -Version: 3.7.4 +Version: 3.7.4.1 Summary: Type Hints for Python Home-page: https://docs.python.org/3/library/typing.html Author: Guido van Rossum, Jukka Lehtosalo, Łukasz Langa, Ivan Levkivskyi
