Hello community,

here is the log from the commit of package python-Cython for openSUSE:Factory 
checked in at 2019-07-30 13:06:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Cython (Old)
 and      /work/SRC/openSUSE:Factory/.python-Cython.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Cython"

Tue Jul 30 13:06:29 2019 rev:50 rq:718922 version:0.29.13

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Cython/python-Cython.changes      
2019-06-18 14:50:00.429668698 +0200
+++ /work/SRC/openSUSE:Factory/.python-Cython.new.4126/python-Cython.changes    
2019-07-30 13:06:30.642370369 +0200
@@ -1,0 +2,46 @@
+Fri Jul 26 17:36:50 CEST 2019 - Matej Cepl <[email protected]>
+
+- Update to 0.29.13:
+  - A reference leak for None was fixed when converting
+    a memoryview to a Python object. (Github issue #3023)
+  - The declaration of PyGILState_STATE in cpython.pystate was
+    unusable. Patch by Kirill Smelkov. (Github issue #2997)
+  - The declarations in posix.mman were extended. Patches by
+    Kirill Smelkov. (Github issues #2893, #2894, #3012)
+
+-------------------------------------------------------------------
+Sun Jul 21 16:56:52 UTC 2019 - Arun Persaud <[email protected]>
+
+- update to version 0.29.12:
+  * Fix compile error in CPython 3.8b2 regarding the PyCode_New()
+    signature. (Github issue #3031)
+  * Fix a C compiler warning about a missing int downcast. (Github
+    issue #3028)
+  * Fix reported error positions of undefined builtins and
+    constants. Patch by Orivej Desh. (Github issue #3030)
+  * A 32 bit issue in the Pythran support was resolved. Patch by Serge
+    Guelton. (Github issue #3032)
+
+-------------------------------------------------------------------
+Sat Jul  6 21:26:09 UTC 2019 - Arun Persaud <[email protected]>
+
+- update to version 0.29.11:
+  * Bugs fixed
+    + Fix compile error in CPython 3.8b2 regarding the PyCode_New()
+      signature. Patch by Nick Coghlan. (Github issue #3009)
+    + Invalid C code generated for lambda functions in cdef
+      methods. Patch by Josh Tobin. (Github issue #2967)
+    + Support slice handling in newer Pythran versions. Patch by Serge
+      Guelton. (Github issue #2989)
+    + A reference leak in power-of-2 calculation was fixed. Patch by
+      Sebastian Berg. (Github issue #3022)
+    + The search order for include files was changed. Previously it
+      was include_directories, Cython/Includes, sys.path. Now it is
+      include_directories, sys.path, Cython/Includes. This was done to
+      allow third-party *.pxd files to override the ones in
+      Cython. Original patch by Matti Picus. (Github issue #2905)
+    + Setting language_level=2 in a file did not work if
+      language_level=3 was enabled globally before. Patch by Jeroen
+      Demeyer. (Github issue #2791)
+
+-------------------------------------------------------------------

Old:
----
  Cython-0.29.10.tar.gz

New:
----
  Cython-0.29.13.tar.gz

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

Other differences:
------------------
++++++ python-Cython.spec ++++++
--- /var/tmp/diff_new_pack.DE9Byu/_old  2019-07-30 13:06:31.414370169 +0200
+++ /var/tmp/diff_new_pack.DE9Byu/_new  2019-07-30 13:06:31.418370168 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         oldpython python
 Name:           python-Cython
-Version:        0.29.10
+Version:        0.29.13
 Release:        0
 Summary:        The Cython compiler for writing C extensions for the Python 
language
 License:        Apache-2.0

++++++ Cython-0.29.10.tar.gz -> Cython-0.29.13.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/.gitrev new/Cython-0.29.13/.gitrev
--- old/Cython-0.29.10/.gitrev  2019-06-02 11:27:04.000000000 +0200
+++ new/Cython-0.29.13/.gitrev  2019-07-26 14:10:00.000000000 +0200
@@ -1 +1 @@
-34de6ba89d71a201019a0f4bc2bf24e6fa4e870f
+d4610f39a43a658cee1862c899a9696d8a9c9f5f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/CHANGES.rst 
new/Cython-0.29.13/CHANGES.rst
--- old/Cython-0.29.10/CHANGES.rst      2019-06-02 11:26:16.000000000 +0200
+++ new/Cython-0.29.13/CHANGES.rst      2019-07-26 14:09:39.000000000 +0200
@@ -2,6 +2,74 @@
 Cython Changelog
 ================
 
+0.29.13 (2019-07-26)
+====================
+
+Bugs fixed
+----------
+
+* A reference leak for ``None`` was fixed when converting a memoryview
+  to a Python object.  (Github issue #3023)
+
+* The declaration of ``PyGILState_STATE`` in ``cpython.pystate`` was unusable.
+  Patch by Kirill Smelkov.  (Github issue #2997)
+
+
+Other changes
+-------------
+
+* The declarations in ``posix.mman`` were extended.
+  Patches by Kirill Smelkov.  (Github issues #2893, #2894, #3012)
+
+
+0.29.12 (2019-07-07)
+====================
+
+Bugs fixed
+----------
+
+* Fix compile error in CPython 3.8b2 regarding the ``PyCode_New()`` signature.
+  (Github issue #3031)
+
+* Fix a C compiler warning about a missing ``int`` downcast.
+  (Github issue #3028)
+
+* Fix reported error positions of undefined builtins and constants.
+  Patch by Orivej Desh.  (Github issue #3030)
+
+* A 32 bit issue in the Pythran support was resolved.
+  Patch by Serge Guelton.  (Github issue #3032)
+
+
+0.29.11 (2019-06-30)
+====================
+
+Bugs fixed
+----------
+
+* Fix compile error in CPython 3.8b2 regarding the ``PyCode_New()`` signature.
+  Patch by Nick Coghlan. (Github issue #3009)
+
+* Invalid C code generated for lambda functions in cdef methods.
+  Patch by Josh Tobin.  (Github issue #2967)
+
+* Support slice handling in newer Pythran versions.
+  Patch by Serge Guelton.  (Github issue #2989)
+
+* A reference leak in power-of-2 calculation was fixed.
+  Patch by Sebastian Berg.  (Github issue #3022)
+
+* The search order for include files was changed. Previously it was
+  ``include_directories``, ``Cython/Includes``, ``sys.path``. Now it is
+  ``include_directories``, ``sys.path``, ``Cython/Includes``. This was done to
+  allow third-party ``*.pxd`` files to override the ones in Cython.
+  Original patch by Matti Picus.  (Github issue #2905)
+
+* Setting ``language_level=2`` in a file did not work if ``language_level=3``
+  was enabled globally before.
+  Patch by Jeroen Demeyer.  (Github issue #2791)
+
+
 0.29.10 (2019-06-02)
 ====================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Build/Dependencies.py 
new/Cython-0.29.13/Cython/Build/Dependencies.py
--- old/Cython-0.29.10/Cython/Build/Dependencies.py     2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/Cython/Build/Dependencies.py     2019-06-30 
08:50:51.000000000 +0200
@@ -34,10 +34,8 @@
 
 try:
     import pythran
-    import pythran.config
-    pythran_version = pythran.__version__
 except:
-    pythran_version = None
+    pythran = None
 
 from .. import Utils
 from ..Utils import (cached_function, cached_method, path_exists,
@@ -125,13 +123,13 @@
 
 
 def update_pythran_extension(ext):
-    if not pythran_version:
+    if pythran is None:
         raise RuntimeError("You first need to install Pythran to use the 
np_pythran directive.")
-    pythran_ext = (
-        pythran.config.make_extension(python=True)
-        if pythran_version >= '0.9' or pythran_version >= '0.8.7'
-        else pythran.config.make_extension()
-    )
+    try:
+        pythran_ext = pythran.config.make_extension(python=True)
+    except TypeError:  # older pythran version only
+        pythran_ext = pythran.config.make_extension()
+
     ext.include_dirs.extend(pythran_ext['include_dirs'])
     ext.extra_compile_args.extend(pythran_ext['extra_compile_args'])
     ext.extra_link_args.extend(pythran_ext['extra_link_args'])
@@ -947,8 +945,9 @@
     if 'common_utility_include_dir' in options:
         safe_makedirs(options['common_utility_include_dir'])
 
-    pythran_options = None
-    if pythran_version:
+    if pythran is None:
+        pythran_options = None
+    else:
         pythran_options = CompilationOptions(**options)
         pythran_options.cplus = True
         pythran_options.np_pythran = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Compiler/Code.py 
new/Cython-0.29.13/Cython/Compiler/Code.py
--- old/Cython-0.29.10/Cython/Compiler/Code.py  2019-02-08 20:14:39.000000000 
+0100
+++ new/Cython-0.29.13/Cython/Compiler/Code.py  2019-07-07 10:37:19.000000000 
+0200
@@ -2357,6 +2357,8 @@
     def error_goto(self, pos):
         lbl = self.funcstate.error_label
         self.funcstate.use_label(lbl)
+        if pos is None:
+            return 'goto %s;' % lbl
         return "__PYX_ERR(%s, %s, %s)" % (
             self.lookup_filename(pos[0]),
             pos[1],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Compiler/Main.py 
new/Cython-0.29.13/Cython/Compiler/Main.py
--- old/Cython-0.29.10/Cython/Compiler/Main.py  2018-11-24 10:20:06.000000000 
+0100
+++ new/Cython-0.29.13/Cython/Compiler/Main.py  2019-06-30 08:50:51.000000000 
+0200
@@ -38,6 +38,8 @@
 
 verbose = 0
 
+standard_include_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
+                                        os.path.pardir, 'Includes'))
 
 class CompilationData(object):
     #  Bundles the information that is passed from transform to transform.
@@ -88,10 +90,6 @@
         self.pxds = {}  # full name -> node tree
         self._interned = {}  # (type(value), value, *key_args) -> 
interned_value
 
-        standard_include_path = os.path.abspath(os.path.normpath(
-            os.path.join(os.path.dirname(__file__), os.path.pardir, 
'Includes')))
-        self.include_directories = include_directories + 
[standard_include_path]
-
         if language_level is not None:
             self.set_language_level(language_level)
 
@@ -99,18 +97,17 @@
 
     def set_language_level(self, level):
         from .Future import print_function, unicode_literals, absolute_import, 
division
-        future_directives = []
+        future_directives = set()
         if level == '3str':
-            future_directives = [print_function, absolute_import, division]
-            self.future_directives.discard(unicode_literals)
             level = 3
         else:
             level = int(level)
             if level >= 3:
-                future_directives = [print_function, unicode_literals, 
absolute_import, division]
+                future_directives.add(unicode_literals)
+        if level >= 3:
+            future_directives.update([print_function, absolute_import, 
division])
         self.language_level = level
-        if future_directives:
-            self.future_directives.update(future_directives)
+        self.future_directives = future_directives
         if level >= 3:
             self.modules['builtins'] = self.modules['__builtin__']
 
@@ -290,8 +287,13 @@
 
     def search_include_directories(self, qualified_name, suffix, pos,
                                    include=False, sys_path=False):
-        return Utils.search_include_directories(
-            tuple(self.include_directories), qualified_name, suffix, pos, 
include, sys_path)
+        include_dirs = self.include_directories
+        if sys_path:
+            include_dirs = include_dirs + sys.path
+        # include_dirs must be hashable for caching in @cached_function
+        include_dirs = tuple(include_dirs + [standard_include_path])
+        return search_include_directories(include_dirs, qualified_name,
+                                          suffix, pos, include)
 
     def find_root_package_dir(self, file_path):
         return Utils.find_root_package_dir(file_path)
@@ -778,6 +780,56 @@
         return compile_multiple(source, options)
 
 
[email protected]_function
+def search_include_directories(dirs, qualified_name, suffix, pos, 
include=False):
+    """
+    Search the list of include directories for the given file name.
+
+    If a source file position is given, first searches the directory
+    containing that file. Returns None if not found, but does not
+    report an error.
+
+    The 'include' option will disable package dereferencing.
+    """
+
+    if pos:
+        file_desc = pos[0]
+        if not isinstance(file_desc, FileSourceDescriptor):
+            raise RuntimeError("Only file sources for code supported")
+        if include:
+            dirs = (os.path.dirname(file_desc.filename),) + dirs
+        else:
+            dirs = (Utils.find_root_package_dir(file_desc.filename),) + dirs
+
+    dotted_filename = qualified_name
+    if suffix:
+        dotted_filename += suffix
+
+    if not include:
+        names = qualified_name.split('.')
+        package_names = tuple(names[:-1])
+        module_name = names[-1]
+        module_filename = module_name + suffix
+        package_filename = "__init__" + suffix
+
+    for dirname in dirs:
+        path = os.path.join(dirname, dotted_filename)
+        if os.path.exists(path):
+            return path
+
+        if not include:
+            package_dir = Utils.check_package_dir(dirname, package_names)
+            if package_dir is not None:
+                path = os.path.join(package_dir, module_filename)
+                if os.path.exists(path):
+                    return path
+                path = os.path.join(package_dir, module_name,
+                                    package_filename)
+                if os.path.exists(path):
+                    return path
+    return None
+
+
 # ------------------------------------------------------------------------
 #
 #  Main command-line entry point
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Compiler/ModuleNode.py 
new/Cython-0.29.13/Cython/Compiler/ModuleNode.py
--- old/Cython-0.29.10/Cython/Compiler/ModuleNode.py    2019-04-14 
12:00:58.000000000 +0200
+++ new/Cython-0.29.13/Cython/Compiler/ModuleNode.py    2019-07-07 
10:37:19.000000000 +0200
@@ -2416,10 +2416,10 @@
 
         if Options.cache_builtins:
             code.putln("/*--- Builtin init code ---*/")
-            code.put_error_if_neg(self.pos, "__Pyx_InitCachedBuiltins()")
+            code.put_error_if_neg(None, "__Pyx_InitCachedBuiltins()")
 
         code.putln("/*--- Constants init code ---*/")
-        code.put_error_if_neg(self.pos, "__Pyx_InitCachedConstants()")
+        code.put_error_if_neg(None, "__Pyx_InitCachedConstants()")
 
         code.putln("/*--- Global type/function init code ---*/")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Compiler/Options.py 
new/Cython-0.29.13/Cython/Compiler/Options.py
--- old/Cython-0.29.10/Cython/Compiler/Options.py       2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/Cython/Compiler/Options.py       2019-07-26 
14:09:39.000000000 +0200
@@ -58,8 +58,12 @@
 
 #: Decref global variables in each module on exit for garbage collection.
 #: 0: None, 1+: interned objects, 2+: cdef globals, 3+: types objects
-#: Mostly for reducing noise in Valgrind, only executes at process exit
+#: Mostly for reducing noise in Valgrind as it typically executes at process 
exit
 #: (when all memory will be reclaimed anyways).
+#: Note that directly or indirectly executed cleanup code that makes use of 
global
+#: variables or types may no longer be safe when enabling the respective level 
since
+#: there is no guaranteed order in which the (reference counted) objects will
+#: be cleaned up.  The order can change due to live references and reference 
cycles.
 generate_cleanup_code = False
 
 #: Should tp_clear() set object fields to None instead of clearing them to 
NULL?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.10/Cython/Compiler/ParseTreeTransforms.py 
new/Cython-0.29.13/Cython/Compiler/ParseTreeTransforms.py
--- old/Cython-0.29.10/Cython/Compiler/ParseTreeTransforms.py   2019-04-14 
12:00:58.000000000 +0200
+++ new/Cython-0.29.13/Cython/Compiler/ParseTreeTransforms.py   2019-06-30 
08:50:51.000000000 +0200
@@ -2715,9 +2715,12 @@
             node.needs_outer_scope = True
             return
 
+        # entry.cname can contain periods (eg. a derived C method of a class).
+        # We want to use the cname as part of a C struct name, so we replace
+        # periods with double underscores.
         as_name = '%s_%s' % (
             target_module_scope.next_id(Naming.closure_class_prefix),
-            node.entry.cname)
+            node.entry.cname.replace('.','__'))
 
         entry = target_module_scope.declare_c_class(
             name=as_name, pos=node.pos, defining=True,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Compiler/Pythran.py 
new/Cython-0.29.13/Cython/Compiler/Pythran.py
--- old/Cython-0.29.10/Cython/Compiler/Pythran.py       2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/Cython/Compiler/Pythran.py       2019-07-07 
10:37:19.000000000 +0200
@@ -8,11 +8,10 @@
 
 try:
     import pythran
-    pythran_version = pythran.__version__
-    pythran_is_0_8_7 = pythran_version >= '0.9' or pythran_version >= '0.8.7'
+    pythran_is_pre_0_9 = tuple(map(int, pythran.__version__.split('.')[0:2])) 
< (0, 9)
 except ImportError:
-    pythran_version = None
-    pythran_is_0_8_7 = False
+    pythran = None
+    pythran_is_pre_0_9 = True
 
 
 # Pythran/Numpy specific operations
@@ -41,10 +40,10 @@
             ctype = dtype.typedef_cname
         else:
             raise ValueError("unsupported type %s!" % dtype)
-        if pythran_is_0_8_7:
-            return "pythonic::types::%s<%s,pythonic::types::pshape<%s>>" % 
(ptype,ctype, ",".join(("Py_ssize_t",)*ndim))
-        else:
+        if pythran_is_pre_0_9:
             return "pythonic::types::%s<%s,%d>" % (ptype,ctype, ndim)
+        else:
+            return "pythonic::types::%s<%s,pythonic::types::pshape<%s>>" % 
(ptype,ctype, ",".join(("long",)*ndim))
     if Ty.is_pythran_expr:
         return Ty.pythran_type
     #if Ty.is_none:
@@ -82,14 +81,8 @@
 def _index_type_code(index_with_type):
     idx, index_type = index_with_type
     if idx.is_slice:
-        if idx.step.is_none:
-            func = "contiguous_slice"
-            n = 2
-        else:
-            func = "slice"
-            n = 3
-        return "pythonic::types::%s(%s)" % (
-            func, ",".join(["0"]*n))
+        n = 2 + int(not idx.step.is_none)
+        return "pythonic::__builtin__::functor::slice{}(%s)" % 
(",".join(["0"]*n))
     elif index_type.is_int:
         return "std::declval<%s>()" % index_type.sign_and_name()
     elif index_type.is_pythran_expr:
@@ -129,7 +122,10 @@
         return []
     return np_func_to_list(func.obj) + [func.attribute]
 
-if pythran_version:
+if pythran is None:
+    def pythran_is_numpy_func_supported(name):
+        return False
+else:
     def pythran_is_numpy_func_supported(func):
         CurF = pythran.tables.MODULES['numpy']
         FL = np_func_to_list(func)
@@ -138,9 +134,6 @@
             if CurF is None:
                 return False
         return True
-else:
-    def pythran_is_numpy_func_supported(name):
-        return False
 
 def pythran_functor(func):
     func = np_func_to_list(func)
@@ -214,6 +207,7 @@
     env.add_include_file("pythonic/types/bool.hpp")
     env.add_include_file("pythonic/types/ndarray.hpp")
     env.add_include_file("pythonic/numpy/power.hpp")
+    env.add_include_file("pythonic/__builtin__/slice.hpp")
     env.add_include_file("<new>")  # for placement new
 
     for i in (8, 16, 32, 64):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.10/Cython/Debugger/Tests/TestLibCython.py 
new/Cython-0.29.13/Cython/Debugger/Tests/TestLibCython.py
--- old/Cython-0.29.10/Cython/Debugger/Tests/TestLibCython.py   2017-09-16 
09:37:01.000000000 +0200
+++ new/Cython-0.29.13/Cython/Debugger/Tests/TestLibCython.py   2019-06-30 
08:50:51.000000000 +0200
@@ -40,7 +40,7 @@
     else:
         stdout, _ = p.communicate()
         # Based on Lib/test/test_gdb.py
-        regex = "GNU gdb [^\d]*(\d+)\.(\d+)"
+        regex = r"GNU gdb [^\d]*(\d+)\.(\d+)"
         gdb_version = re.match(regex, stdout.decode('ascii', 'ignore'))
 
     if gdb_version:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Includes/cpython/pystate.pxd 
new/Cython-0.29.13/Cython/Includes/cpython/pystate.pxd
--- old/Cython-0.29.10/Cython/Includes/cpython/pystate.pxd      2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/Cython/Includes/cpython/pystate.pxd      2019-07-26 
14:09:39.000000000 +0200
@@ -20,7 +20,8 @@
 
     # This is not actually a struct, but make sure it can never be coerced to
     # an int or used in arithmetic expressions
-    ctypedef struct PyGILState_STATE
+    ctypedef struct PyGILState_STATE:
+        pass
 
     # The type of the trace function registered using PyEval_SetProfile() and
     # PyEval_SetTrace().
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Includes/posix/mman.pxd 
new/Cython-0.29.13/Cython/Includes/posix/mman.pxd
--- old/Cython-0.29.10/Cython/Includes/posix/mman.pxd   2016-12-10 
16:41:15.000000000 +0100
+++ new/Cython-0.29.13/Cython/Includes/posix/mman.pxd   2019-07-26 
14:09:39.000000000 +0200
@@ -24,6 +24,8 @@
     enum: MAP_NOCORE                #  Typically available only on BSD
     enum: MAP_NOSYNC
 
+    void *MAP_FAILED
+
     void *mmap(void *addr, size_t Len, int prot, int flags, int fd, off_t off)
     int   munmap(void *addr, size_t Len)
     int   mprotect(void *addr, size_t Len, int prot)
@@ -46,17 +48,34 @@
     int   munlock(const void *addr, size_t Len)
     int   mlockall(int flags)
     int   munlockall()
+    # Linux-specific
+    enum: MLOCK_ONFAULT
+    enum: MCL_ONFAULT
+    int   mlock2(const void *addr, size_t len, int flags)
 
     int shm_open(const char *name, int oflag, mode_t mode)
     int shm_unlink(const char *name)
 
     # often available
-    enum: MADV_REMOVE               # pre-POSIX advice flags; often available
+    enum: MADV_NORMAL               # pre-POSIX advice flags; should translate 
1-1 to POSIX_*
+    enum: MADV_RANDOM               # but in practice it is not always the 
same.
+    enum: MADV_SEQUENTIAL
+    enum: MADV_WILLNEED
+    enum: MADV_DONTNEED
+    enum: MADV_REMOVE               # other pre-POSIX advice flags; often 
available
     enum: MADV_DONTFORK
     enum: MADV_DOFORK
     enum: MADV_HWPOISON
     enum: MADV_MERGEABLE,
     enum: MADV_UNMERGEABLE
+    enum: MADV_SOFT_OFFLINE
+    enum: MADV_HUGEPAGE
+    enum: MADV_NOHUGEPAGE
+    enum: MADV_DONTDUMP
+    enum: MADV_DODUMP
+    enum: MADV_FREE
+    enum: MADV_WIPEONFORK
+    enum: MADV_KEEPONFORK
     int   madvise(void *addr, size_t Len, int advice)
 
     # sometimes available
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Shadow.py 
new/Cython-0.29.13/Cython/Shadow.py
--- old/Cython-0.29.10/Cython/Shadow.py 2019-06-02 11:26:16.000000000 +0200
+++ new/Cython-0.29.13/Cython/Shadow.py 2019-07-26 14:09:39.000000000 +0200
@@ -1,7 +1,7 @@
 # cython.* namespace for pure mode.
 from __future__ import absolute_import
 
-__version__ = "0.29.10"
+__version__ = "0.29.13"
 
 try:
     from __builtin__ import basestring
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Utility/MemoryView.pyx 
new/Cython-0.29.13/Cython/Utility/MemoryView.pyx
--- old/Cython-0.29.10/Cython/Utility/MemoryView.pyx    2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/Cython/Utility/MemoryView.pyx    2019-07-26 
14:09:39.000000000 +0200
@@ -372,6 +372,10 @@
     def __dealloc__(memoryview self):
         if self.obj is not None:
             __Pyx_ReleaseBuffer(&self.view)
+        elif (<__pyx_buffer *> &self.view).obj == Py_None:
+            # Undo the incref in __cinit__() above.
+            (<__pyx_buffer *> &self.view).obj = NULL
+            Py_DECREF(Py_None)
 
         cdef int i
         global __pyx_memoryview_thread_locks_used
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Utility/ModuleSetupCode.c 
new/Cython-0.29.13/Cython/Utility/ModuleSetupCode.c
--- old/Cython-0.29.10/Cython/Utility/ModuleSetupCode.c 2019-05-27 
21:37:21.000000000 +0200
+++ new/Cython-0.29.13/Cython/Utility/ModuleSetupCode.c 2019-07-07 
10:37:19.000000000 +0200
@@ -381,12 +381,12 @@
   #define __Pyx_DefaultClassType PyClass_Type
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
-#if PY_VERSION_HEX < 0x030800A4
+#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, 
fline, lnos) \
-          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, 
lnos)
+          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, 
fline, lnos)
 #else
   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, 
fline, lnos) \
-          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, 
fline, lnos)
+          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, 
lnos)
 #endif
   #define __Pyx_DefaultClassType PyType_Type
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Utility/ObjectHandling.c 
new/Cython-0.29.13/Cython/Utility/ObjectHandling.c
--- old/Cython-0.29.10/Cython/Utility/ObjectHandling.c  2019-02-27 
13:23:19.000000000 +0100
+++ new/Cython-0.29.13/Cython/Utility/ObjectHandling.c  2019-07-07 
10:37:19.000000000 +0200
@@ -1933,7 +1933,7 @@
 
 // let's assume that the non-public C-API function might still change during 
the 3.6 beta phase
 #if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject 
**args, int nargs, PyObject *kwargs);
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject 
**args, Py_ssize_t nargs, PyObject *kwargs);
 #else
 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) 
_PyFunction_FastCallDict(func, args, nargs, kwargs)
 #endif
@@ -2014,7 +2014,7 @@
 
 
 #if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject 
**args, int nargs, PyObject *kwargs) {
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject 
**args, Py_ssize_t nargs, PyObject *kwargs) {
     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
     PyObject *globals = PyFunction_GET_GLOBALS(func);
     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
@@ -2108,12 +2108,12 @@
     //#elif PY_MAJOR_VERSION >= 3
 #if PY_MAJOR_VERSION >= 3
     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
-                               args, nargs,
+                               args, (int)nargs,
                                k, (int)nk,
                                d, (int)nd, kwdefs, closure);
 #else
     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
-                               args, nargs,
+                               args, (int)nargs,
                                k, (int)nk,
                                d, (int)nd, closure);
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Utility/Optimize.c 
new/Cython-0.29.13/Cython/Utility/Optimize.c
--- old/Cython-0.29.10/Cython/Utility/Optimize.c        2019-02-27 
13:23:19.000000000 +0100
+++ new/Cython-0.29.13/Cython/Utility/Optimize.c        2019-06-30 
08:50:51.000000000 +0200
@@ -685,9 +685,11 @@
             return PyLong_FromUnsignedLongLong(value);
 #endif
         } else {
-            PyObject *one = PyInt_FromLong(1L);
+            PyObject *result, *one = PyInt_FromLong(1L);
             if (unlikely(!one)) return NULL;
-            return PyNumber_Lshift(one, exp);
+            result = PyNumber_Lshift(one, exp);
+            Py_DECREF(one);
+            return result;
         }
     } else if (shiftby == -1 && PyErr_Occurred()) {
         PyErr_Clear();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/Cython/Utils.py 
new/Cython-0.29.13/Cython/Utils.py
--- old/Cython-0.29.10/Cython/Utils.py  2018-11-24 10:20:06.000000000 +0100
+++ new/Cython-0.29.13/Cython/Utils.py  2019-06-30 08:50:51.000000000 +0200
@@ -124,54 +124,6 @@
 
 
 @cached_function
-def search_include_directories(dirs, qualified_name, suffix, pos,
-                               include=False, sys_path=False):
-    # Search the list of include directories for the given
-    # file name. If a source file position is given, first
-    # searches the directory containing that file. Returns
-    # None if not found, but does not report an error.
-    # The 'include' option will disable package dereferencing.
-    # If 'sys_path' is True, also search sys.path.
-    if sys_path:
-        dirs = dirs + tuple(sys.path)
-    if pos:
-        file_desc = pos[0]
-        from Cython.Compiler.Scanning import FileSourceDescriptor
-        if not isinstance(file_desc, FileSourceDescriptor):
-            raise RuntimeError("Only file sources for code supported")
-        if include:
-            dirs = (os.path.dirname(file_desc.filename),) + dirs
-        else:
-            dirs = (find_root_package_dir(file_desc.filename),) + dirs
-
-    dotted_filename = qualified_name
-    if suffix:
-        dotted_filename += suffix
-    if not include:
-        names = qualified_name.split('.')
-        package_names = tuple(names[:-1])
-        module_name = names[-1]
-        module_filename = module_name + suffix
-        package_filename = "__init__" + suffix
-
-    for dir in dirs:
-        path = os.path.join(dir, dotted_filename)
-        if path_exists(path):
-            return path
-        if not include:
-            package_dir = check_package_dir(dir, package_names)
-            if package_dir is not None:
-                path = os.path.join(package_dir, module_filename)
-                if path_exists(path):
-                    return path
-                path = os.path.join(dir, package_dir, module_name,
-                                    package_filename)
-                if path_exists(path):
-                    return path
-    return None
-
-
-@cached_function
 def find_root_package_dir(file_path):
     dir = os.path.dirname(file_path)
     if file_path == dir:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/PKG-INFO new/Cython-0.29.13/PKG-INFO
--- old/Cython-0.29.10/PKG-INFO 2019-06-02 11:27:04.000000000 +0200
+++ new/Cython-0.29.13/PKG-INFO 2019-07-26 14:10:01.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: Cython
-Version: 0.29.10
+Version: 0.29.13
 Summary: The Cython compiler for writing C extensions for the Python language.
 Home-page: http://cython.org/
 Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/runtests.py 
new/Cython-0.29.13/runtests.py
--- old/Cython-0.29.10/runtests.py      2019-05-27 21:37:21.000000000 +0200
+++ new/Cython-0.29.13/runtests.py      2019-06-30 08:50:51.000000000 +0200
@@ -758,12 +758,10 @@
         pythran_dir = self.pythran_dir
         if 'pythran' in tags['tag'] and not pythran_dir and 'cpp' in languages:
             import pythran.config
-            from pythran import __version__ as pythran_version
-            pythran_ext = (
-                pythran.config.make_extension(python=True)
-                if pythran_version >= '0.9' or pythran_version >= '0.8.7'
-                else pythran.config.make_extension()
-            )
+            try:
+                pythran_ext = pythran.config.make_extension(python=True)
+            except TypeError:  # old pythran version syntax
+                pythran_ext = pythran.config.make_extension()
             pythran_dir = pythran_ext['include_dirs'][0]
 
         preparse_list = tags.get('preparse', ['id'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/tests/compile/find_pxd.srctree 
new/Cython-0.29.13/tests/compile/find_pxd.srctree
--- old/Cython-0.29.10/tests/compile/find_pxd.srctree   2015-09-10 
18:25:36.000000000 +0200
+++ new/Cython-0.29.13/tests/compile/find_pxd.srctree   2019-06-30 
08:50:51.000000000 +0200
@@ -6,12 +6,13 @@
 from Cython.Distutils.extension import Extension
 
 import sys
-sys.path.append("path")
+sys.path.insert(0, "path")
 
 ext_modules = [
     Extension("a", ["a.pyx"]),
     Extension("b", ["b.pyx"]),
     Extension("c", ["c.pyx"]),
+    Extension("d", ["d.pyx"]),
 ]
 
 ext_modules = cythonize(ext_modules, include_path=["include"])
@@ -37,3 +38,15 @@
 
 ######## path/c.pxd ########
 +++syntax error just to show that this file is not actually cimported+++
+
+######## path/numpy/__init__.pxd ########
+
+# gh-2905: This should be found before Cython/Inlude/numpy/__init__.pxd
+
+ctypedef int my_type
+
+######## d.pyx ########
+
+cimport numpy
+
+cdef numpy.my_type foo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/tests/memoryview/memoryview.pyx 
new/Cython-0.29.13/tests/memoryview/memoryview.pyx
--- old/Cython-0.29.10/tests/memoryview/memoryview.pyx  2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/tests/memoryview/memoryview.pyx  2019-07-26 
14:09:39.000000000 +0200
@@ -698,6 +698,16 @@
     buf = mslice
     buf[1] = {3-2: 2+(2*4)-2}
 
+
+def test_pyview_of_memview(int[:] ints):
+    """
+    >>> A = IntMockBuffer(None, [1, 2, 3])
+    >>> len(test_pyview_of_memview(A))
+    3
+    """
+    return ints
+
+
 def test_generic_slicing(arg, indirect=False):
     """
     Test simple slicing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Cython-0.29.10/tests/run/closure_in_derived_class_T2967.pyx 
new/Cython-0.29.13/tests/run/closure_in_derived_class_T2967.pyx
--- old/Cython-0.29.10/tests/run/closure_in_derived_class_T2967.pyx     
1970-01-01 01:00:00.000000000 +0100
+++ new/Cython-0.29.13/tests/run/closure_in_derived_class_T2967.pyx     
2019-06-30 08:50:51.000000000 +0200
@@ -0,0 +1,18 @@
+# mode: run
+# tag: closures
+# ticket: 2967
+
+cdef class BaseClass:
+    cdef func(self):
+        pass
+cdef class ClosureInsideExtensionClass(BaseClass):
+    """
+    >>> y = ClosureInsideExtensionClass(42)
+    >>> y.test(42)
+    43
+    """
+    cdef func(self):
+        a = 1
+        return (lambda x : x+a)
+    def test(self, b):
+        return self.func()(b)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/tests/run/cpython_capi.pyx 
new/Cython-0.29.13/tests/run/cpython_capi.pyx
--- old/Cython-0.29.10/tests/run/cpython_capi.pyx       2018-11-24 
10:20:06.000000000 +0100
+++ new/Cython-0.29.13/tests/run/cpython_capi.pyx       2019-07-26 
14:09:39.000000000 +0200
@@ -2,6 +2,7 @@
 # tag: c-api
 
 from cpython cimport mem
+from cpython.pystate cimport PyGILState_Ensure, PyGILState_Release, 
PyGILState_STATE
 
 
 def test_pymalloc():
@@ -47,3 +48,17 @@
             mem.PyMem_RawFree(m)
     assert m2
     return retval
+
+
+def test_gilstate():
+    """
+    >>> test_gilstate()
+    'ok'
+    """
+
+    # cython used to have invalid definition for PyGILState_STATE, which was
+    # making the following code fail to compile
+    cdef PyGILState_STATE gstate = PyGILState_Ensure()
+    # TODO assert that GIL is taken
+    PyGILState_Release(gstate)
+    return 'ok'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/tests/run/error_pos.srctree 
new/Cython-0.29.13/tests/run/error_pos.srctree
--- old/Cython-0.29.10/tests/run/error_pos.srctree      1970-01-01 
01:00:00.000000000 +0100
+++ new/Cython-0.29.13/tests/run/error_pos.srctree      2019-07-07 
10:37:19.000000000 +0200
@@ -0,0 +1,24 @@
+PYTHON setup.py build_ext --inplace
+PYTHON test_error_pos.py
+
+######## setup.py ###########
+from distutils.core import setup
+from Cython.Build import cythonize
+
+setup(ext_modules=cythonize("error_pos.pyx"))
+
+######## error_pos.pyx ###########
+from os import *
+
+abcdefg(line)
+
+######## test_error_pos.py ###########
+import subprocess
+import sys
+
+cmd = [sys.executable, '-c', 'import error_pos']
+proc = subprocess.Popen(cmd, stderr=subprocess.PIPE)
+_, err = proc.communicate()
+# The error should contain the line number and the line text where the
+# undefined identifier is used.
+assert b'line 3, in init error_pos' and b'abcdefg(line)' in err, err
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Cython-0.29.10/tests/run/language_level.srctree 
new/Cython-0.29.13/tests/run/language_level.srctree
--- old/Cython-0.29.10/tests/run/language_level.srctree 2015-06-22 
14:53:11.000000000 +0200
+++ new/Cython-0.29.13/tests/run/language_level.srctree 2019-06-30 
08:50:51.000000000 +0200
@@ -7,12 +7,19 @@
 from Cython.Build.Dependencies import cythonize
 from distutils.core import setup
 
-setup(
-    ext_modules = (cythonize("infile*.py") +
-                   cythonize("directive2.py", 
compiler_directives={'language_level': 2}) +
-                   cythonize("directive3.py", 
compiler_directives={'language_level': 3})
-                   )
-)
+ext_modules = []
+
+# Test language_level specified in the cythonize() call
+ext_modules += cythonize("directive2.py", 
compiler_directives={'language_level': 2})
+ext_modules += cythonize("directive3.py", 
compiler_directives={'language_level': 3})
+
+# Test language_level specified in the source file. We give a
+# conflicting directive to cythonize() to check that the language_level
+# is correctly overridden when compiling
+ext_modules += cythonize("infile2.py", compiler_directives={'language_level': 
3})
+ext_modules += cythonize("infile3.py", compiler_directives={'language_level': 
2})
+
+setup(ext_modules=ext_modules)
 
 ######## directive3.py ########
 


Reply via email to