Hello community, here is the log from the commit of package python-Cython for openSUSE:Factory checked in at 2019-11-22 10:24:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Cython (Old) and /work/SRC/openSUSE:Factory/.python-Cython.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Cython" Fri Nov 22 10:24:57 2019 rev:51 rq:749103 version:0.29.14 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Cython/python-Cython.changes 2019-07-30 13:06:30.642370369 +0200 +++ /work/SRC/openSUSE:Factory/.python-Cython.new.26869/python-Cython.changes 2019-11-22 10:25:11.881277551 +0100 @@ -1,0 +2,29 @@ +Sat Nov 16 16:44:06 UTC 2019 - Arun Persaud <[email protected]> + +- update to version 0.29.14: + * Bugs fixed + + The generated code failed to initialise the tp_print slot in + CPython 3.8. Patches by Pablo Galindo and Orivej Desh (Github + issues #3171, #3201). + + ? for bool was missing from the supported NumPy dtypes. Patch by + Max Klein. (Github issue #2675) + + await was not allowed inside of f-strings. Patch by Dmitro + Getz. (Github issue #2877) + + Coverage analysis failed for projects where the code resides in + separate source sub-directories. Patch by Antonio + Valentino. (Github issue #1985) + + An incorrect compiler warning was fixed in automatic C++ string + conversions. Patch by Gerion Entrup. (Github issue #3108) + + Error reports in the Jupyter notebook showed unhelpful stack + traces. Patch by Matthew Edwards (Github issue #3196). + + Python.h is now also included explicitly from public header + files. (Github issue #3133). + + Distutils builds with --parallel did not work when using + Cython's deprecated build_ext command. Patch by Alphadelta14 + (Github issue #3187). + * Other changes + + The PyMemoryView_*() C-API is available in + cpython.memoryview. Patch by Nathan Manville. (Github issue + #2541) + +------------------------------------------------------------------- Old: ---- Cython-0.29.13.tar.gz New: ---- Cython-0.29.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Cython.spec ++++++ --- /var/tmp/diff_new_pack.bqzfi5/_old 2019-11-22 10:25:12.317277422 +0100 +++ /var/tmp/diff_new_pack.bqzfi5/_new 2019-11-22 10:25:12.317277422 +0100 @@ -19,11 +19,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Cython -Version: 0.29.13 +Version: 0.29.14 Release: 0 Summary: The Cython compiler for writing C extensions for the Python language License: Apache-2.0 -Group: Development/Languages/Python URL: http://www.cython.org Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz Source1: python-Cython-rpmlintrc ++++++ Cython-0.29.13.tar.gz -> Cython-0.29.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/.gitrev new/Cython-0.29.14/.gitrev --- old/Cython-0.29.13/.gitrev 2019-07-26 14:10:00.000000000 +0200 +++ new/Cython-0.29.14/.gitrev 2019-11-01 17:46:03.000000000 +0100 @@ -1 +1 @@ -d4610f39a43a658cee1862c899a9696d8a9c9f5f +bfcaf163e3dcf472ef2af5dec6ac3fffd0d34e66 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/CHANGES.rst new/Cython-0.29.14/CHANGES.rst --- old/Cython-0.29.13/CHANGES.rst 2019-07-26 14:09:39.000000000 +0200 +++ new/Cython-0.29.14/CHANGES.rst 2019-11-01 15:13:39.000000000 +0100 @@ -2,6 +2,45 @@ Cython Changelog ================ +0.29.14 (2019-11-01) +==================== + +Bugs fixed +---------- + +* The generated code failed to initialise the ``tp_print`` slot in CPython 3.8. + Patches by Pablo Galindo and Orivej Desh (Github issues #3171, #3201). + +* ``?`` for ``bool`` was missing from the supported NumPy dtypes. + Patch by Max Klein. (Github issue #2675) + +* ``await`` was not allowed inside of f-strings. + Patch by Dmitro Getz. (Github issue #2877) + +* Coverage analysis failed for projects where the code resides in separate + source sub-directories. + Patch by Antonio Valentino. (Github issue #1985) + +* An incorrect compiler warning was fixed in automatic C++ string conversions. + Patch by Gerion Entrup. (Github issue #3108) + +* Error reports in the Jupyter notebook showed unhelpful stack traces. + Patch by Matthew Edwards (Github issue #3196). + +* ``Python.h`` is now also included explicitly from ``public`` header files. + (Github issue #3133). + +* Distutils builds with ``--parallel`` did not work when using Cython's + deprecated ``build_ext`` command. + Patch by Alphadelta14 (Github issue #3187). + +Other changes +------------- + +* The ``PyMemoryView_*()`` C-API is available in ``cpython.memoryview``. + Patch by Nathan Manville. (Github issue #2541) + + 0.29.13 (2019-07-26) ==================== @@ -360,7 +399,7 @@ In this case, it is also automatically mapped to ``%r`` in Python 2.x. * New C macro ``CYTHON_HEX_VERSION`` to access Cython's version in the same style as - ``PY_HEX_VERSION``. + ``PY_VERSION_HEX``. * Constants in ``libc.math`` are now declared as ``const`` to simplify their handling. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Build/IpythonMagic.py new/Cython-0.29.14/Cython/Build/IpythonMagic.py --- old/Cython-0.29.13/Cython/Build/IpythonMagic.py 2018-11-24 10:20:06.000000000 +0100 +++ new/Cython-0.29.14/Cython/Build/IpythonMagic.py 2019-11-01 15:13:39.000000000 +0100 @@ -322,6 +322,9 @@ extension = None if need_cythonize: extensions = self._cythonize(module_name, code, lib_dir, args, quiet=args.quiet) + if extensions is None: + # Compilation failed and printed error message + return None assert len(extensions) == 1 extension = extensions[0] self._code_cache[key] = module_name @@ -329,8 +332,12 @@ if args.pgo: self._profile_pgo_wrapper(extension, lib_dir) - self._build_extension(extension, lib_dir, pgo_step_name='use' if args.pgo else None, - quiet=args.quiet) + try: + self._build_extension(extension, lib_dir, pgo_step_name='use' if args.pgo else None, + quiet=args.quiet) + except distutils.errors.CompileError: + # Build failed and printed error message + return None module = imp.load_dynamic(module_name, module_path) self._import_all(module) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Compiler/FusedNode.py new/Cython-0.29.14/Cython/Compiler/FusedNode.py --- old/Cython-0.29.13/Cython/Compiler/FusedNode.py 2018-09-22 16:18:56.000000000 +0200 +++ new/Cython-0.29.14/Cython/Compiler/FusedNode.py 2019-11-01 15:13:39.000000000 +0100 @@ -507,20 +507,22 @@ ndarray = __Pyx_ImportNumPyArrayTypeIfAvailable() """) + seen_typedefs = set() seen_int_dtypes = set() for buffer_type in all_buffer_types: dtype = buffer_type.dtype + dtype_name = self._dtype_name(dtype) if dtype.is_typedef: - #decl_code.putln("ctypedef %s %s" % (dtype.resolve(), - # self._dtype_name(dtype))) - decl_code.putln('ctypedef %s %s "%s"' % (dtype.resolve(), - self._dtype_name(dtype), - dtype.empty_declaration_code())) + if dtype_name not in seen_typedefs: + seen_typedefs.add(dtype_name) + decl_code.putln( + 'ctypedef %s %s "%s"' % (dtype.resolve(), dtype_name, + dtype.empty_declaration_code())) if buffer_type.dtype.is_int: if str(dtype) not in seen_int_dtypes: seen_int_dtypes.add(str(dtype)) - pyx_code.context.update(dtype_name=self._dtype_name(dtype), + pyx_code.context.update(dtype_name=dtype_name, dtype_type=self._dtype_type(dtype)) pyx_code.local_variable_declarations.put_chunk( u""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Compiler/ModuleNode.py new/Cython-0.29.14/Cython/Compiler/ModuleNode.py --- old/Cython-0.29.13/Cython/Compiler/ModuleNode.py 2019-07-07 10:37:19.000000000 +0200 +++ new/Cython-0.29.14/Cython/Compiler/ModuleNode.py 2019-11-01 15:13:39.000000000 +0100 @@ -176,6 +176,7 @@ h_guard = Naming.h_guard_prefix + self.api_name(env) h_code.put_h_guard(h_guard) h_code.putln("") + h_code.putln('#include "Python.h"') self.generate_type_header_code(h_types, h_code) if options.capi_reexport_cincludes: self.generate_includes(env, [], h_code) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Compiler/Scanning.pxd new/Cython-0.29.14/Cython/Compiler/Scanning.pxd --- old/Cython-0.29.13/Cython/Compiler/Scanning.pxd 2018-11-24 10:20:06.000000000 +0100 +++ new/Cython-0.29.14/Cython/Compiler/Scanning.pxd 2019-11-01 15:13:39.000000000 +0100 @@ -38,7 +38,7 @@ cdef public list indentation_stack cdef public indentation_char cdef public int bracket_nesting_level - cdef bint async_enabled + cdef readonly bint async_enabled cdef public sy cdef public systring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Compiler/Scanning.py new/Cython-0.29.14/Cython/Compiler/Scanning.py --- old/Cython-0.29.13/Cython/Compiler/Scanning.py 2018-11-24 10:20:06.000000000 +0100 +++ new/Cython-0.29.14/Cython/Compiler/Scanning.py 2019-11-01 15:13:39.000000000 +0100 @@ -322,12 +322,25 @@ def __init__(self, file, filename, parent_scanner=None, scope=None, context=None, source_encoding=None, parse_comments=True, initial_pos=None): Scanner.__init__(self, get_lexicon(), file, filename, initial_pos) + + if filename.is_python_file(): + self.in_python_file = True + self.keywords = set(py_reserved_words) + else: + self.in_python_file = False + self.keywords = set(pyx_reserved_words) + + self.async_enabled = 0 + if parent_scanner: self.context = parent_scanner.context self.included_files = parent_scanner.included_files self.compile_time_env = parent_scanner.compile_time_env self.compile_time_eval = parent_scanner.compile_time_eval self.compile_time_expr = parent_scanner.compile_time_expr + + if parent_scanner.async_enabled: + self.enter_async() else: self.context = context self.included_files = scope.included_files @@ -338,17 +351,11 @@ self.compile_time_env.update(context.options.compile_time_env) self.parse_comments = parse_comments self.source_encoding = source_encoding - if filename.is_python_file(): - self.in_python_file = True - self.keywords = set(py_reserved_words) - else: - self.in_python_file = False - self.keywords = set(pyx_reserved_words) self.trace = trace_scanner self.indentation_stack = [0] self.indentation_char = None self.bracket_nesting_level = 0 - self.async_enabled = 0 + self.begin('INDENT') self.sy = '' self.next() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Compiler/TypeSlots.py new/Cython-0.29.14/Cython/Compiler/TypeSlots.py --- old/Cython-0.29.13/Cython/Compiler/TypeSlots.py 2019-06-02 11:26:16.000000000 +0200 +++ new/Cython-0.29.14/Cython/Compiler/TypeSlots.py 2019-11-01 15:13:39.000000000 +0100 @@ -825,7 +825,8 @@ slot_table = ( ConstructorSlot("tp_dealloc", '__dealloc__'), - EmptySlot("tp_print"), #MethodSlot(printfunc, "tp_print", "__print__"), + EmptySlot("tp_print", ifdef="PY_VERSION_HEX < 0x030800b4"), + EmptySlot("tp_vectorcall_offset", ifdef="PY_VERSION_HEX >= 0x030800b4"), EmptySlot("tp_getattr"), EmptySlot("tp_setattr"), @@ -888,6 +889,7 @@ EmptySlot("tp_version_tag"), EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"), EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1"), + EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"), ) #------------------------------------------------------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Coverage.py new/Cython-0.29.14/Cython/Coverage.py --- old/Cython-0.29.13/Cython/Coverage.py 2019-04-14 12:00:58.000000000 +0200 +++ new/Cython-0.29.14/Cython/Coverage.py 2019-11-01 15:13:39.000000000 +0100 @@ -33,13 +33,14 @@ return None -def _find_dep_file_path(main_file, file_path): +def _find_dep_file_path(main_file, file_path, relative_path_search=False): abs_path = os.path.abspath(file_path) - if file_path.endswith('.pxi') and not os.path.exists(abs_path): - # include files are looked up relative to the main source file - pxi_file_path = os.path.join(os.path.dirname(main_file), file_path) - if os.path.exists(pxi_file_path): - abs_path = os.path.abspath(pxi_file_path) + if not os.path.exists(abs_path) and (file_path.endswith('.pxi') or + relative_path_search): + # files are looked up relative to the main source file + rel_file_path = os.path.join(os.path.dirname(main_file), file_path) + if os.path.exists(rel_file_path): + abs_path = os.path.abspath(rel_file_path) # search sys.path for external locations if a valid file hasn't been found if not os.path.exists(abs_path): for sys_path in sys.path: @@ -195,7 +196,8 @@ self._c_files_map = {} for filename, code in code_lines.items(): - abs_path = _find_dep_file_path(c_file, filename) + abs_path = _find_dep_file_path(c_file, filename, + relative_path_search=True) self._c_files_map[abs_path] = (c_file, filename, code) if sourcefile not in self._c_files_map: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Distutils/old_build_ext.py new/Cython-0.29.14/Cython/Distutils/old_build_ext.py --- old/Cython-0.29.13/Cython/Distutils/old_build_ext.py 2018-09-22 16:18:56.000000000 +0200 +++ new/Cython-0.29.14/Cython/Distutils/old_build_ext.py 2019-11-01 15:13:39.000000000 +0100 @@ -191,7 +191,8 @@ for ext in self.extensions: ext.sources = self.cython_sources(ext.sources, ext) - self.build_extension(ext) + # Call original build_extensions + _build_ext.build_ext.build_extensions(self) def cython_sources(self, sources, extension): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Includes/cpython/memoryview.pxd new/Cython-0.29.14/Cython/Includes/cpython/memoryview.pxd --- old/Cython-0.29.13/Cython/Includes/cpython/memoryview.pxd 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.29.14/Cython/Includes/cpython/memoryview.pxd 2019-11-01 15:13:39.000000000 +0100 @@ -0,0 +1,50 @@ +cdef extern from "Python.h": + + ########################################################################### + # MemoryView Objects + ########################################################################### + # A memoryview object exposes the C level buffer interface as a Python + # object which can then be passed around like any other object + + object PyMemoryView_FromObject(object obj) + # Return value: New reference. + # Create a memoryview object from an object that provides the buffer + # interface. If obj supports writable buffer exports, the memoryview object + # will be read/write, otherwise it may be either read-only or read/write at + # the discretion of the exporter. + + object PyMemoryView_FromMemory(char *mem, Py_ssize_t size, int flags) + # Return value: New reference. + # Create a memoryview object using mem as the underlying buffer. flags can + # be one of PyBUF_READ or PyBUF_WRITE. + # New in version 3.3. + + object PyMemoryView_FromBuffer(Py_buffer *view) + # Return value: New reference. + # Create a memoryview object wrapping the given buffer structure view. For + # simple byte buffers, PyMemoryView_FromMemory() is the preferred function. + + object PyMemoryView_GetContiguous(object obj, + int buffertype, + char order) + # Return value: New reference. + # Create a memoryview object to a contiguous chunk of memory (in either ‘C’ + # or ‘F’ortran order) from an object that defines the buffer interface. If + # memory is contiguous, the memoryview object points to the original + # memory. Otherwise, a copy is made and the memoryview points to a new + # bytes object. + + bint PyMemoryView_Check(object obj) + # Return true if the object obj is a memoryview object. It is not currently + # allowed to create subclasses of memoryview. + + Py_buffer *PyMemoryView_GET_BUFFER(object mview) + # Return a pointer to the memoryview’s private copy of the exporter’s + # buffer. mview must be a memoryview instance; this macro doesn’t check its + # type, you must do it yourself or you will risk crashes. + + Py_buffer *PyMemoryView_GET_BASE(object mview) + # Return either a pointer to the exporting object that the memoryview is + # based on or NULL if the memoryview has been created by one of the + # functions PyMemoryView_FromMemory() or PyMemoryView_FromBuffer(). mview + # must be a memoryview instance. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Shadow.py new/Cython-0.29.14/Cython/Shadow.py --- old/Cython-0.29.13/Cython/Shadow.py 2019-07-26 14:09:39.000000000 +0200 +++ new/Cython-0.29.14/Cython/Shadow.py 2019-11-01 15:13:39.000000000 +0100 @@ -1,7 +1,7 @@ # cython.* namespace for pure mode. from __future__ import absolute_import -__version__ = "0.29.13" +__version__ = "0.29.14" try: from __builtin__ import basestring diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/AsyncGen.c new/Cython-0.29.14/Cython/Utility/AsyncGen.c --- old/Cython-0.29.13/Cython/Utility/AsyncGen.c 2019-06-02 11:26:16.000000000 +0200 +++ new/Cython-0.29.14/Cython/Utility/AsyncGen.c 2019-11-01 15:13:39.000000000 +0100 @@ -424,6 +424,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; @@ -656,6 +659,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; @@ -768,6 +774,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; @@ -1050,6 +1059,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/Buffer.c new/Cython-0.29.14/Cython/Utility/Buffer.c --- old/Cython-0.29.13/Cython/Utility/Buffer.c 2019-02-27 13:23:19.000000000 +0100 +++ new/Cython-0.29.14/Cython/Utility/Buffer.c 2019-11-01 15:13:39.000000000 +0100 @@ -298,6 +298,7 @@ static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { switch (ch) { + case '?': return "'bool'"; case 'c': return "'char'"; case 'b': return "'signed char'"; case 'B': return "'unsigned char'"; @@ -342,7 +343,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { switch (ch) { - case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(short); case 'i': case 'I': return sizeof(int); case 'l': case 'L': return sizeof(long); @@ -431,7 +432,7 @@ case 'b': case 'h': case 'i': case 'l': case 'q': case 's': case 'p': return 'I'; - case 'B': case 'H': case 'I': case 'L': case 'Q': + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': return 'U'; case 'f': case 'd': case 'g': return (is_complex ? 'C' : 'R'); @@ -752,7 +753,7 @@ return NULL; } CYTHON_FALLTHROUGH; - case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': case 'l': case 'L': case 'q': case 'Q': case 'f': case 'd': case 'g': case 'O': case 'p': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/Complex.c new/Cython-0.29.14/Cython/Utility/Complex.c --- old/Cython-0.29.13/Cython/Utility/Complex.c 2019-02-08 20:14:39.000000000 +0100 +++ new/Cython-0.29.14/Cython/Utility/Complex.c 2019-11-01 15:13:39.000000000 +0100 @@ -253,7 +253,6 @@ case 1: return a; case 2: - z = __Pyx_c_prod{{func_suffix}}(a, a); return __Pyx_c_prod{{func_suffix}}(a, a); case 3: z = __Pyx_c_prod{{func_suffix}}(a, a); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/Coroutine.c new/Cython-0.29.14/Cython/Utility/Coroutine.c --- old/Cython-0.29.13/Cython/Utility/Coroutine.c 2019-06-02 11:26:16.000000000 +0200 +++ new/Cython-0.29.14/Cython/Utility/Coroutine.c 2019-11-01 15:13:39.000000000 +0100 @@ -1500,6 +1500,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; #if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS @@ -1661,6 +1664,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; static int __pyx_Coroutine_init(void) { @@ -1769,6 +1775,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; @@ -1872,6 +1881,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; static int __pyx_Generator_init(void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/CppConvert.pyx new/Cython-0.29.14/Cython/Utility/CppConvert.pyx --- old/Cython-0.29.13/Cython/Utility/CppConvert.pyx 2017-09-16 09:37:01.000000000 +0200 +++ new/Cython-0.29.14/Cython/Utility/CppConvert.pyx 2019-11-01 15:13:39.000000000 +0100 @@ -11,7 +11,7 @@ @cname("{{cname}}") cdef string {{cname}}(object o) except *: - cdef Py_ssize_t length + cdef Py_ssize_t length = 0 cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) return string(data, length) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/CythonFunction.c new/Cython-0.29.14/Cython/Utility/CythonFunction.c --- old/Cython-0.29.13/Cython/Utility/CythonFunction.c 2019-06-02 11:26:16.000000000 +0200 +++ new/Cython-0.29.14/Cython/Utility/CythonFunction.c 2019-11-01 15:13:39.000000000 +0100 @@ -733,6 +733,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; @@ -1209,6 +1212,9 @@ #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif }; static int __pyx_FusedFunction_init(void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utility/MemoryView.pyx new/Cython-0.29.14/Cython/Utility/MemoryView.pyx --- old/Cython-0.29.13/Cython/Utility/MemoryView.pyx 2019-07-26 14:09:39.000000000 +0200 +++ new/Cython-0.29.14/Cython/Utility/MemoryView.pyx 2019-11-01 17:25:41.000000000 +0100 @@ -1050,7 +1050,7 @@ @cname('__pyx_memoryview_get_slice_from_memoryview') cdef {{memviewslice_name}} *get_slice_from_memview(memoryview memview, - {{memviewslice_name}} *mslice): + {{memviewslice_name}} *mslice) except NULL: cdef _memoryviewslice obj if isinstance(memview, _memoryviewslice): obj = memview @@ -1176,11 +1176,10 @@ @cname('__pyx_memoryview_slice_get_size') cdef Py_ssize_t slice_get_size({{memviewslice_name}} *src, int ndim) nogil: "Return the size of the memory occupied by the slice in number of bytes" - cdef int i - cdef Py_ssize_t size = src.memview.view.itemsize + cdef Py_ssize_t shape, size = src.memview.view.itemsize - for i in range(ndim): - size *= src.shape[i] + for shape in src.shape[:ndim]: + size *= shape return size @@ -1197,11 +1196,11 @@ if order == 'F': for idx in range(ndim): strides[idx] = stride - stride = stride * shape[idx] + stride *= shape[idx] else: for idx in range(ndim - 1, -1, -1): strides[idx] = stride - stride = stride * shape[idx] + stride *= shape[idx] return stride diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/Cython/Utils.py new/Cython-0.29.14/Cython/Utils.py --- old/Cython-0.29.13/Cython/Utils.py 2019-06-30 08:50:51.000000000 +0200 +++ new/Cython-0.29.14/Cython/Utils.py 2019-11-01 15:13:39.000000000 +0100 @@ -442,7 +442,7 @@ def build_hex_version(version_string): """ - Parse and translate '4.3a1' into the readable hex representation '0x040300A1' (like PY_HEX_VERSION). + Parse and translate '4.3a1' into the readable hex representation '0x040300A1' (like PY_VERSION_HEX). """ # First, parse '4.12a1' into [4, 12, 0, 0xA01]. digits = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/PKG-INFO new/Cython-0.29.14/PKG-INFO --- old/Cython-0.29.13/PKG-INFO 2019-07-26 14:10:01.000000000 +0200 +++ new/Cython-0.29.14/PKG-INFO 2019-11-01 17:46:04.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: Cython -Version: 0.29.13 +Version: 0.29.14 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.13/tests/compile/fused_redeclare_T3111.pyx new/Cython-0.29.14/tests/compile/fused_redeclare_T3111.pyx --- old/Cython-0.29.13/tests/compile/fused_redeclare_T3111.pyx 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.29.14/tests/compile/fused_redeclare_T3111.pyx 2019-11-01 17:25:41.000000000 +0100 @@ -0,0 +1,31 @@ +# ticket: 3111 +# mode: compile +# tag: warnings + +ctypedef unsigned char npy_uint8 +ctypedef unsigned short npy_uint16 + + +ctypedef fused dtype_t: + npy_uint8 + +ctypedef fused dtype_t_out: + npy_uint8 + npy_uint16 + + +def foo(dtype_t[:] a, dtype_t_out[:, :] b): + pass + + +# The primary thing we're trying to test here is the _absence_ of the warning +# "__pyxutil:16:4: '___pyx_npy_uint8' redeclared". The remaining warnings are +# unrelated to this test. +_WARNINGS = """ +20:10: 'cpdef_method' redeclared +31:10: 'cpdef_cname_method' redeclared +446:72: Argument evaluation order in C function call is undefined and may not be as expected +446:72: Argument evaluation order in C function call is undefined and may not be as expected +749:34: Argument evaluation order in C function call is undefined and may not be as expected +749:34: Argument evaluation order in C function call is undefined and may not be as expected +""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/tests/run/coverage_cmd_src_layout.srctree new/Cython-0.29.14/tests/run/coverage_cmd_src_layout.srctree --- old/Cython-0.29.13/tests/run/coverage_cmd_src_layout.srctree 1970-01-01 01:00:00.000000000 +0100 +++ new/Cython-0.29.14/tests/run/coverage_cmd_src_layout.srctree 2019-11-01 15:13:39.000000000 +0100 @@ -0,0 +1,162 @@ +# mode: run +# tag: coverage,trace + +""" +PYTHON setup.py build_ext -i +PYTHON -m coverage run --source=src coverage_test.py +PYTHON collect_coverage.py +""" + +######## setup.py ######## + +from distutils.core import setup +from Cython.Build import cythonize + +setup(ext_modules = cythonize([ + 'src/trivial_module.pyx', +])) + + +######## .coveragerc ######## +[run] +plugins = Cython.Coverage + + +######## src/trivial_module.pyx ######## +# cython: linetrace=True +# distutils: define_macros=CYTHON_TRACE=1 + +def func1(int a, int b): + cdef int x = 1 # 5 + c = func2(a) + b # 6 + return x + c # 7 + + +def func2(int a): + return a * 2 # 11 + + +######## coverage_test.py ######## + +import os.path +import trivial_module + + +assert not any( + trivial_module.__file__.endswith(ext) + for ext in '.py .pyc .pyo .pyw .pyx .pxi'.split() +), module.__file__ + + +def run_coverage(module): + assert module.func1(1, 2) == (1 * 2) + 2 + 1 + assert module.func2(2) == 2 * 2 + + +if __name__ == '__main__': + run_coverage(trivial_module) + + +######## collect_coverage.py ######## + +import re +import sys +import os +import os.path +import subprocess +from glob import iglob + + +def run_coverage_command(*command): + env = dict(os.environ, LANG='', LC_ALL='C') + process = subprocess.Popen( + [sys.executable, '-m', 'coverage'] + list(command), + stdout=subprocess.PIPE, env=env) + stdout, _ = process.communicate() + return stdout + + +def run_report(): + stdout = run_coverage_command('report', '--show-missing') + stdout = stdout.decode('iso8859-1') # 'safe' decoding + lines = stdout.splitlines() + print(stdout) + + module_path = 'trivial_module.pyx' + assert any(module_path in line for line in lines), ( + "'%s' not found in coverage report:\n\n%s" % (module_path, stdout)) + + files = {} + line_iter = iter(lines) + for line in line_iter: + if line.startswith('---'): + break + extend = [''] * 2 + for line in line_iter: + if not line or line.startswith('---'): + continue + name, statements, missed, covered, _missing = (line.split(None, 4) + extend)[:5] + missing = [] + for start, end in re.findall('([0-9]+)(?:-([0-9]+))?', _missing): + if end: + missing.extend(range(int(start), int(end)+1)) + else: + missing.append(int(start)) + files[os.path.basename(name)] = (statements, missed, covered, missing) + + assert 5 not in files[module_path][-1], files[module_path] + assert 6 not in files[module_path][-1], files[module_path] + assert 7 not in files[module_path][-1], files[module_path] + assert 11 not in files[module_path][-1], files[module_path] + + +def run_xml_report(): + stdout = run_coverage_command('xml', '-o', '-') + print(stdout) + + import xml.etree.ElementTree as etree + data = etree.fromstring(stdout) + + files = {} + for module in data.iterfind('.//class'): + files[module.get('filename').replace('\\', '/')] = dict( + (int(line.get('number')), int(line.get('hits'))) + for line in module.findall('lines/line') + ) + + module_path = 'src/trivial_module.pyx' + + assert files[module_path][5] > 0, files[module_path] + assert files[module_path][6] > 0, files[module_path] + assert files[module_path][7] > 0, files[module_path] + assert files[module_path][11] > 0, files[module_path] + + +def run_html_report(): + stdout = run_coverage_command('html', '-d', 'html') + _parse_lines = re.compile( + r'<p[^>]* id=["\'][^0-9"\']*(?P<id>[0-9]+)[^0-9"\']*["\'][^>]*' + r' class=["\'][^"\']*(?P<run>mis|run)[^"\']*["\']').findall + + files = {} + for file_path in iglob('html/*.html'): + with open(file_path) as f: + page = f.read() + executed = set() + missing = set() + for line, has_run in _parse_lines(page): + (executed if has_run == 'run' else missing).add(int(line)) + files[file_path] = (executed, missing) + + executed, missing = [data for path, data in files.items() if 'trivial_module' in path][0] + assert executed + assert 5 in executed, executed + assert 6 in executed, executed + assert 7 in executed, executed + assert 11 in executed, executed + + +if __name__ == '__main__': + run_report() + run_xml_report() + run_html_report() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/tests/run/cython_includes.pyx new/Cython-0.29.14/tests/run/cython_includes.pyx --- old/Cython-0.29.13/tests/run/cython_includes.pyx 2018-11-24 10:20:06.000000000 +0100 +++ new/Cython-0.29.14/tests/run/cython_includes.pyx 2019-11-01 15:13:39.000000000 +0100 @@ -27,6 +27,7 @@ cimport cpython.longintrepr cimport cpython.mapping cimport cpython.mem +cimport cpython.memoryview cimport cpython.method cimport cpython.module cimport cpython.number diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/tests/run/fstring.pyx new/Cython-0.29.14/tests/run/fstring.pyx --- old/Cython-0.29.13/tests/run/fstring.pyx 2018-09-22 16:18:56.000000000 +0200 +++ new/Cython-0.29.14/tests/run/fstring.pyx 2019-11-01 15:13:39.000000000 +0100 @@ -513,3 +513,21 @@ x\u0194z-12 """ return u"%s-%d" % (u, i) + + +######################################## +# await inside f-string + +def test_await_inside_f_string(): + """ + >>> test_await_inside_f_string() + PARSED_SUCCESSFULLY + """ + + async def f(): + return "some value" + + async def main(): + print(f"{await f()}") + + print("PARSED_SUCCESSFULLY") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Cython-0.29.13/tests/run/numpy_test.pyx new/Cython-0.29.14/tests/run/numpy_test.pyx --- old/Cython-0.29.13/tests/run/numpy_test.pyx 2018-11-24 10:20:06.000000000 +0100 +++ new/Cython-0.29.14/tests/run/numpy_test.pyx 2019-11-01 15:13:39.000000000 +0100 @@ -134,6 +134,7 @@ ... ValueError: ndarray is not C...contiguous + >>> test_dtype('?', inc1_bool) >>> test_dtype('b', inc1_byte) >>> test_dtype('B', inc1_ubyte) >>> test_dtype('h', inc1_short) @@ -340,6 +341,7 @@ print u" ".join([unicode(arr[i, j]) for j in range(arr.shape[1])]) # Exhaustive dtype tests -- increments element [1] by 1 (or 1+1j) for all dtypes +def inc1_bool(np.ndarray[unsigned char] arr): arr[1] += 1 def inc1_byte(np.ndarray[char] arr): arr[1] += 1 def inc1_ubyte(np.ndarray[unsigned char] arr): arr[1] += 1 def inc1_short(np.ndarray[short] arr): arr[1] += 1 @@ -402,6 +404,13 @@ a = np.array([0, 10+10j], dtype=dtype) inc1(a) if a[1] != (11 + 11j): print u"failed!", a[1] + elif dtype == '?': + # bool ndarrays coerce all values to 0 or 1 + a = np.array([0, 0], dtype=dtype) + inc1(a) + if a[1] != 1: print u"failed!" + inc1(a) + if a[1] != 1: print u"failed!" else: a = np.array([0, 10], dtype=dtype) inc1(a)
