Hello community,

here is the log from the commit of package python-typing for openSUSE:Factory 
checked in at 2019-03-04 09:12:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-typing (Old)
 and      /work/SRC/openSUSE:Factory/.python-typing.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-typing"

Mon Mar  4 09:12:11 2019 rev:8 rq:680763 version:3.6.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-typing/python-typing.changes      
2018-12-27 00:29:03.275679632 +0100
+++ /work/SRC/openSUSE:Factory/.python-typing.new.28833/python-typing.changes   
2019-03-04 09:12:13.136689043 +0100
@@ -1,0 +2,11 @@
+Sat Mar  2 04:20:06 UTC 2019 - John Vandenberg <[email protected]>
+
+- Add test-sys-executable.patch to use python3 in Python 3 tests
+
+-------------------------------------------------------------------
+Fri Mar  1 10:07:01 UTC 2019 - Ondřej Súkup <[email protected]>
+
+- update to 3.6.6
+ *  no upstream changelog
+
+-------------------------------------------------------------------

Old:
----
  typing-3.6.4.tar.gz

New:
----
  test-sys-executable.patch
  typing-3.6.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-typing.spec ++++++
--- /var/tmp/diff_new_pack.GpLkbV/_old  2019-03-04 09:12:14.708688760 +0100
+++ /var/tmp/diff_new_pack.GpLkbV/_new  2019-03-04 09:12:14.716688759 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-typing
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,13 +21,14 @@
 %endif
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-typing
-Version:        3.6.4
+Version:        3.6.6
 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:         test-sys-executable.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -42,6 +43,7 @@
 
 %prep
 %setup -q -n typing-%{version}
+%patch0 -p0
 ln -s python2 python_%{python2_bin_suffix}
 ln -s src python_%{python3_bin_suffix}
 

++++++ test-sys-executable.patch ++++++
--- src/test_typing.py.orig     2019-03-02 11:18:09.992292250 +0700
+++ src/test_typing.py  2019-03-02 11:17:31.303970230 +0700
@@ -2649,7 +2649,7 @@
         file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                  'typing.py')
         try:
-            subprocess.check_output('python -OO {}'.format(file_path),
+            subprocess.check_output('python3 -OO {}'.format(file_path),
                                     stderr=subprocess.STDOUT,
                                     shell=True)
         except subprocess.CalledProcessError:
++++++ typing-3.6.4.tar.gz -> typing-3.6.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/PKG-INFO new/typing-3.6.6/PKG-INFO
--- old/typing-3.6.4/PKG-INFO   2018-01-25 01:49:49.000000000 +0100
+++ new/typing-3.6.6/PKG-INFO   2018-08-26 18:11:36.000000000 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: typing
-Version: 3.6.4
+Version: 3.6.6
 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
 Author-email: [email protected]
 License: PSF
-Description-Content-Type: UNKNOWN
 Description: Typing -- Type Hints for Python
         
         This is a backport of the standard library typing module to Python
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/python2/test_typing.py 
new/typing-3.6.6/python2/test_typing.py
--- old/typing-3.6.4/python2/test_typing.py     2018-01-25 01:18:10.000000000 
+0100
+++ new/typing-3.6.6/python2/test_typing.py     2018-08-26 18:04:32.000000000 
+0200
@@ -2,8 +2,10 @@
 
 import collections
 import contextlib
+import os
 import pickle
 import re
+import subprocess
 import sys
 from unittest import TestCase, main, SkipTest
 from copy import copy, deepcopy
@@ -1229,6 +1231,76 @@
         with self.assertRaises(Exception):
             D[T]
 
+    def test_new_with_args(self):
+
+        class A(Generic[T]):
+            pass
+
+        class B(object):
+            def __new__(cls, arg):
+                # call object.__new__
+                obj = super(B, cls).__new__(cls)
+                obj.arg = arg
+                return obj
+
+        # mro: C, A, Generic, B, object
+        class C(A, B):
+            pass
+
+        c = C('foo')
+        self.assertEqual(c.arg, 'foo')
+
+    def test_new_with_args2(self):
+
+        class A(object):
+            def __init__(self, arg):
+                self.from_a = arg
+                # call object
+                super(A, self).__init__()
+
+        # mro: C, Generic, A, object
+        class C(Generic[T], A):
+            def __init__(self, arg):
+                self.from_c = arg
+                # call Generic
+                super(C, self).__init__(arg)
+
+        c = C('foo')
+        self.assertEqual(c.from_a, 'foo')
+        self.assertEqual(c.from_c, 'foo')
+
+    def test_new_no_args(self):
+
+        class A(Generic[T]):
+            pass
+
+        with self.assertRaises(TypeError):
+            A('foo')
+
+        class B(object):
+            def __new__(cls):
+                # call object
+                obj = super(B, cls).__new__(cls)
+                obj.from_b = 'b'
+                return obj
+
+        # mro: C, A, Generic, B, object
+        class C(A, B):
+            def __init__(self, arg):
+                self.arg = arg
+
+            def __new__(cls, arg):
+                # call A
+                obj = super(C, cls).__new__(cls)
+                obj.from_c = 'c'
+                return obj
+
+        c = C('foo')
+        self.assertEqual(c.arg, 'foo')
+        self.assertEqual(c.from_b, 'b')
+        self.assertEqual(c.from_c, 'c')
+
+
 
 class ClassVarTests(BaseTestCase):
 
@@ -1896,6 +1968,16 @@
 
         self.assertIsNone(typing.get_type_hints(foo))
 
+    def test_typing_compiles_with_opt(self):
+        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)
+        except subprocess.CalledProcessError:
+            self.fail('Module does not compile with optimize=2 (-OO flag).')
+
 
 if __name__ == '__main__':
     main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/python2/typing.py 
new/typing-3.6.6/python2/typing.py
--- old/typing-3.6.4/python2/typing.py  2018-01-24 04:20:14.000000000 +0100
+++ new/typing-3.6.6/python2/typing.py  2018-08-26 18:04:32.000000000 +0200
@@ -73,6 +73,7 @@
     'NewType',
     'no_type_check',
     'no_type_check_decorator',
+    'NoReturn',
     'overload',
     'Text',
     'TYPE_CHECKING',
@@ -1287,10 +1288,18 @@
     # Assure type is erased on instantiation,
     # but attempt to store it in __orig_class__
     if cls.__origin__ is None:
-        return base_cls.__new__(cls)
+        if (base_cls.__new__ is object.__new__ and
+                cls.__init__ is not object.__init__):
+            return base_cls.__new__(cls)
+        else:
+            return base_cls.__new__(cls, *args, **kwds)
     else:
         origin = cls._gorg
-        obj = base_cls.__new__(origin)
+        if (base_cls.__new__ is object.__new__ and
+                cls.__init__ is not object.__init__):
+            obj = base_cls.__new__(origin)
+        else:
+            obj = base_cls.__new__(origin, *args, **kwds)
         try:
             obj.__orig_class__ = cls
         except AttributeError:
@@ -2052,7 +2061,7 @@
     def close(self):
         pass
 
-    @abstractmethod
+    @abstractproperty
     def closed(self):
         pass
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/setup.cfg new/typing-3.6.6/setup.cfg
--- old/typing-3.6.4/setup.cfg  2018-01-25 01:49:49.000000000 +0100
+++ new/typing-3.6.6/setup.cfg  2018-08-26 18:11:36.000000000 +0200
@@ -1,3 +1,6 @@
+[metadata]
+license-file = LICENSE
+
 [egg_info]
 tag_build = 
 tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/setup.py new/typing-3.6.6/setup.py
--- old/typing-3.6.4/setup.py   2018-01-25 01:36:17.000000000 +0100
+++ new/typing-3.6.6/setup.py   2018-08-26 18:11:31.000000000 +0200
@@ -9,7 +9,7 @@
                      'to install the typing package.\n')
     exit(1)
 
-version = '3.6.4'
+version = '3.6.6'
 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.6.4/src/test_typing.py 
new/typing-3.6.6/src/test_typing.py
--- old/typing-3.6.4/src/test_typing.py 2018-01-25 01:18:10.000000000 +0100
+++ new/typing-3.6.6/src/test_typing.py 2018-08-26 18:04:32.000000000 +0200
@@ -1,7 +1,9 @@
 import contextlib
 import collections
+import os
 import pickle
 import re
+import subprocess
 import sys
 from unittest import TestCase, main, skipUnless, SkipTest, expectedFailure
 from copy import copy, deepcopy
@@ -1310,6 +1312,75 @@
         with self.assertRaises(Exception):
             D[T]
 
+    def test_new_with_args(self):
+
+        class A(Generic[T]):
+            pass
+
+        class B:
+            def __new__(cls, arg):
+                # call object
+                obj = super().__new__(cls)
+                obj.arg = arg
+                return obj
+
+        # mro: C, A, Generic, B, object
+        class C(A, B):
+            pass
+
+        c = C('foo')
+        self.assertEqual(c.arg, 'foo')
+
+    def test_new_with_args2(self):
+
+        class A:
+            def __init__(self, arg):
+                self.from_a = arg
+                # call object
+                super().__init__()
+
+        # mro: C, Generic, A, object
+        class C(Generic[T], A):
+            def __init__(self, arg):
+                self.from_c = arg
+                # call Generic
+                super().__init__(arg)
+
+        c = C('foo')
+        self.assertEqual(c.from_a, 'foo')
+        self.assertEqual(c.from_c, 'foo')
+
+    def test_new_no_args(self):
+
+        class A(Generic[T]):
+            pass
+
+        with self.assertRaises(TypeError):
+            A('foo')
+
+        class B:
+            def __new__(cls):
+                # call object
+                obj = super().__new__(cls)
+                obj.from_b = 'b'
+                return obj
+
+        # mro: C, A, Generic, B, object
+        class C(A, B):
+            def __init__(self, arg):
+                self.arg = arg
+
+            def __new__(cls, arg):
+                # call A
+                obj = super().__new__(cls)
+                obj.from_c = 'c'
+                return obj
+
+        c = C('foo')
+        self.assertEqual(c.arg, 'foo')
+        self.assertEqual(c.from_b, 'b')
+        self.assertEqual(c.from_c, 'c')
+
 
 class ClassVarTests(BaseTestCase):
 
@@ -1739,6 +1810,8 @@
         self.assertEqual(gth(HasForeignBaseClass),
                          {'some_xrepr': XRepr, 'other_a': mod_generics_cache.A,
                           'some_b': mod_generics_cache.B})
+        self.assertEqual(gth(XRepr.__new__),
+                         {'x': int, 'y': int})
         self.assertEqual(gth(mod_generics_cache.B),
                          {'my_inner_a1': mod_generics_cache.B.A,
                           'my_inner_a2': mod_generics_cache.B.A,
@@ -2572,6 +2645,16 @@
         self.assertIn('SupportsBytes', a)
         self.assertIn('SupportsComplex', a)
 
+    def test_typing_compiles_with_opt(self):
+        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)
+        except subprocess.CalledProcessError:
+            self.fail('Module does not compile with optimize=2 (-OO flag).')
+
 
 if __name__ == '__main__':
     main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/src/typing.egg-info/PKG-INFO 
new/typing-3.6.6/src/typing.egg-info/PKG-INFO
--- old/typing-3.6.4/src/typing.egg-info/PKG-INFO       2018-01-25 
01:49:49.000000000 +0100
+++ new/typing-3.6.6/src/typing.egg-info/PKG-INFO       2018-08-26 
18:11:36.000000000 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: typing
-Version: 3.6.4
+Version: 3.6.6
 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
 Author-email: [email protected]
 License: PSF
-Description-Content-Type: UNKNOWN
 Description: Typing -- Type Hints for Python
         
         This is a backport of the standard library typing module to Python
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/src/typing.egg-info/SOURCES.txt 
new/typing-3.6.6/src/typing.egg-info/SOURCES.txt
--- old/typing-3.6.4/src/typing.egg-info/SOURCES.txt    2018-01-25 
01:49:49.000000000 +0100
+++ new/typing-3.6.6/src/typing.egg-info/SOURCES.txt    2018-08-26 
18:11:36.000000000 +0200
@@ -1,6 +1,7 @@
 LICENSE
 MANIFEST.in
 README.rst
+setup.cfg
 setup.py
 python2/mod_generics_cache.py
 python2/test_typing.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typing-3.6.4/src/typing.py 
new/typing-3.6.6/src/typing.py
--- old/typing-3.6.4/src/typing.py      2018-01-24 04:20:14.000000000 +0100
+++ new/typing-3.6.6/src/typing.py      2018-08-26 18:04:32.000000000 +0200
@@ -90,6 +90,7 @@
     'NewType',
     'no_type_check',
     'no_type_check_decorator',
+    'NoReturn',
     'overload',
     'Text',
     'TYPE_CHECKING',
@@ -1181,10 +1182,18 @@
     # Assure type is erased on instantiation,
     # but attempt to store it in __orig_class__
     if cls.__origin__ is None:
-        return base_cls.__new__(cls)
+        if (base_cls.__new__ is object.__new__ and
+                cls.__init__ is not object.__init__):
+            return base_cls.__new__(cls)
+        else:
+            return base_cls.__new__(cls, *args, **kwds)
     else:
         origin = cls._gorg
-        obj = base_cls.__new__(origin)
+        if (base_cls.__new__ is object.__new__ and
+                cls.__init__ is not object.__init__):
+            obj = base_cls.__new__(origin)
+        else:
+            obj = base_cls.__new__(origin, *args, **kwds)
         try:
             obj.__orig_class__ = cls
         except AttributeError:
@@ -2146,6 +2155,7 @@
                                 "follow default field(s) {default_names}"
                                 .format(field_name=field_name,
                                         default_names=', 
'.join(defaults_dict.keys())))
+        nm_tpl.__new__.__annotations__ = collections.OrderedDict(types)
         nm_tpl.__new__.__defaults__ = tuple(defaults)
         nm_tpl._field_defaults = defaults_dict
         # update from user namespace without overriding special namedtuple 
attributes
@@ -2259,7 +2269,7 @@
     def close(self) -> None:
         pass
 
-    @abstractmethod
+    @abstractproperty
     def closed(self) -> bool:
         pass
 


Reply via email to