pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/py-cython



Module Name:    pkgsrc
Committed By:   adam
Date:           Mon Oct 15 08:21:03 UTC 2018

Modified Files:
        pkgsrc/devel/py-cython: Makefile PLIST distinfo
        pkgsrc/devel/py-cython/patches: patch-runtests.py
Added Files:
        pkgsrc/devel/py-cython: ALTERNATIVES

Log Message:
py-cython: updated to 0.29

0.29:

Features added
--------------
PEP-489 multi-phase module initialisation has been enabled again. Module reloads in other subinterpreters raise an exception to prevent corruption of the static module state.
A set of mypy compatible PEP-484 declarations were added for Cython’s C data types to integrate with static analysers in typed Python code. They are available in the Cython/Shadow.pyi module and 
describe the types in the special cython module that can be used for typing in Python code.
Memoryviews are supported in PEP-484/526 style type declarations.
@cython.nogil is supported as a C-function decorator in Python code.
Raising exceptions from nogil code will automatically acquire the GIL, instead of requiring an explicit with gil block.
C++ functions can now be declared as potentially raising both C++ and Python exceptions, so that Cython can handle both correctly.
cython.inline() supports a direct language_level keyword argument that was previously only available via a directive.
A new language level name 3str was added that mostly corresponds to language level 3, but keeps unprefixed string literals as type ‘str’ in both Py2 and Py3, and the builtin ‘str’ type unchanged. 
This will become the default in the next Cython release and is meant to help user code a) transition more easily to this new default and b) migrate to Python 3 source code semantics without making 
support for Python 2.x difficult.
In CPython 3.6 and later, looking up globals in the module dict is almost as fast as looking up C globals.
For a Python subclass of an extension type, repeated method calls to non-overridden cpdef methods can avoid the attribute lookup in Py3.6+, which makes them 4x faster.
(In-)equality comparisons of objects to integer literals are faster.
Some internal and 1-argument method calls are faster.
Modules that cimport many external extension types from other Cython modules execute less import requests during module initialisation.
Constant tuples and slices are deduplicated and only created once per module.
The coverage plugin considers more C file extensions such as .cc and .cxx.
The cythonize command accepts compile time variable values (as set by DEF) through the new -E option.
pyximport can import from namespace packages.
Some missing numpy and CPython C-API declarations were added.
Declarations for the pylifecycle C-API functions were added in a new .pxd file cpython.pylifecycle.
The Pythran support was updated to work with the latest Pythran 0.8.7
%a is included in the string formatting types that are optimised into f-strings. 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.
Constants in libc.math are now declared as const to simplify their handling.
An additional check_size clause was added to the ctypedef class name specification to allow suppressing warnings when importing modules with backwards-compatible PyTypeObject size changes.

Bugs fixed
----------
The exception handling in generators and coroutines under CPython 3.7 was adapted to the newly introduced exception stack. Users of Cython 0.28 who want to support Python 3.7 are encouraged to 
upgrade to 0.29 to avoid potentially incorrect error reporting and tracebacks.
Crash when importing a module under Stackless Python that was built for CPython.
2-value slicing of typed sequences failed if the start or stop index was None.
Multiplied string literals lost their factor when they are part of another constant expression (e.g. ‘x’ * 10 + ‘y’ => ‘xy’).
String formatting with the ‘%’ operator didn’t call the special __rmod__() method if the right side is a string subclass that implements it.
The directive language_level=3 did not apply to the first token in the source file.
Overriding cpdef methods did not work in Python subclasses with slots. Note that this can have a performance impact on calls from Cython code.
Fix declarations of builtin or C types using strings in pure python mode.
Generator expressions and lambdas failed to compile in @cfunc functions.
Global names with const types were not excluded from star-import assignments which could lead to invalid C code.
Several internal function signatures were fixed that lead to warnings in gcc-8.
The numpy helper functions set_array_base() and get_array_base() were adapted to the current numpy C-API recommendations.
Some NumPy related code was updated to avoid deprecated API usage.
Several C++ STL declarations were extended and corrected.
C lines of the module init function were unconditionally not reported in exception stack traces.
When PEP-489 support is enabled, reloading the module overwrote any static module state. It now raises an exception instead, given that reloading is not actually supported.
Object-returning, C++ exception throwing functions were not checking that the return value was non-null.
The source file encoding detection could get confused if the c_string_encoding directive appeared within the first two lines.
Cython generated modules no longer emit a warning during import when the size of the NumPy array type is larger than what was found at compile time. Instead, this is assumed to be a backwards 
compatible change on NumPy side.

Other changes
-------------
Cython now emits a warning when no language_level (2, 3 or ‘3str’) is set explicitly, neither as a cythonize() option nor as a compiler directive. This is meant to prepare the transition of the 
default language level from currently Py2 to Py3, since that is what most new users will expect these days. The future default will, however, not enforce unicode literals, because this has proven a 
major obstacle in the support for both Python 2.x and 3.x. The next major release is intended to make this change, so that it will parse all code that does not request a specific language level as 
Python 3 code, but with str literals. The language level 2 will continue to be supported for an indefinite time.
The documentation was restructured, cleaned up and examples are now tested. The NumPy tutorial was also rewritten to simplify the running example.
Cython compiles less of its own modules at build time to reduce the installed package size to about half of its previous size. This makes the compiler slightly slower, by about 5-7%.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/py-cython/ALTERNATIVES
cvs rdiff -u -r1.47 -r1.48 pkgsrc/devel/py-cython/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/devel/py-cython/PLIST
cvs rdiff -u -r1.39 -r1.40 pkgsrc/devel/py-cython/distinfo
cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/py-cython/patches/patch-runtests.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/py-cython/Makefile
diff -u pkgsrc/devel/py-cython/Makefile:1.47 pkgsrc/devel/py-cython/Makefile:1.48
--- pkgsrc/devel/py-cython/Makefile:1.47        Tue Aug  7 09:36:42 2018
+++ pkgsrc/devel/py-cython/Makefile     Mon Oct 15 08:21:03 2018
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.47 2018/08/07 09:36:42 adam Exp $
+# $NetBSD: Makefile,v 1.48 2018/10/15 08:21:03 adam Exp $
 
-DISTNAME=      Cython-0.28.5
+DISTNAME=      Cython-0.29
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:tl}
 CATEGORIES=    lang python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=C/Cython/}
@@ -16,15 +16,15 @@ REPLACE_PYTHON+=    Cython/Debugger/libpyth
 REPLACE_PYTHON+=       cython.py
 
 # for test only
-#USE_LANGUAGES+= c++
+#USE_LANGUAGES=        c c++
 do-test:
        cd ${WRKSRC} && ${PYTHONBIN} runtests.py
 
 post-install:
        cd ${DESTDIR}${PREFIX}/bin && \
-               ${MV} cython cython${PYVERSSUFFIX} && \
-               ${MV} cythonize cythonize${PYVERSSUFFIX} && \
-               ${MV} cygdb cygdb${PYVERSSUFFIX} || ${TRUE}
+               ${MV} cython cython-${PYVERSSUFFIX} && \
+               ${MV} cythonize cythonize-${PYVERSSUFFIX} && \
+               ${MV} cygdb cygdb-${PYVERSSUFFIX} || ${TRUE}
 
 .include "../../lang/python/application.mk"
 .include "../../lang/python/egg.mk"

Index: pkgsrc/devel/py-cython/PLIST
diff -u pkgsrc/devel/py-cython/PLIST:1.23 pkgsrc/devel/py-cython/PLIST:1.24
--- pkgsrc/devel/py-cython/PLIST:1.23   Thu Mar 15 09:30:18 2018
+++ pkgsrc/devel/py-cython/PLIST        Mon Oct 15 08:21:03 2018
@@ -1,7 +1,7 @@
-@comment $NetBSD: PLIST,v 1.23 2018/03/15 09:30:18 adam Exp $
-bin/cygdb${PYVERSSUFFIX}
-bin/cython${PYVERSSUFFIX}
-bin/cythonize${PYVERSSUFFIX}
+@comment $NetBSD: PLIST,v 1.24 2018/10/15 08:21:03 adam Exp $
+bin/cygdb-${PYVERSSUFFIX}
+bin/cython-${PYVERSSUFFIX}
+bin/cythonize-${PYVERSSUFFIX}
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
@@ -26,6 +26,9 @@ ${PYSITELIB}/Cython/Build/Inline.pyo
 ${PYSITELIB}/Cython/Build/IpythonMagic.py
 ${PYSITELIB}/Cython/Build/IpythonMagic.pyc
 ${PYSITELIB}/Cython/Build/IpythonMagic.pyo
+${PYSITELIB}/Cython/Build/Tests/TestCyCache.py
+${PYSITELIB}/Cython/Build/Tests/TestCyCache.pyc
+${PYSITELIB}/Cython/Build/Tests/TestCyCache.pyo
 ${PYSITELIB}/Cython/Build/Tests/TestInline.py
 ${PYSITELIB}/Cython/Build/Tests/TestInline.pyc
 ${PYSITELIB}/Cython/Build/Tests/TestInline.pyo
@@ -66,7 +69,6 @@ ${PYSITELIB}/Cython/Compiler/Code.pxd
 ${PYSITELIB}/Cython/Compiler/Code.py
 ${PYSITELIB}/Cython/Compiler/Code.pyc
 ${PYSITELIB}/Cython/Compiler/Code.pyo
-${PYSITELIB}/Cython/Compiler/Code.so
 ${PYSITELIB}/Cython/Compiler/CodeGeneration.py
 ${PYSITELIB}/Cython/Compiler/CodeGeneration.pyc
 ${PYSITELIB}/Cython/Compiler/CodeGeneration.pyo
@@ -100,7 +102,6 @@ ${PYSITELIB}/Cython/Compiler/Interpreter
 ${PYSITELIB}/Cython/Compiler/Lexicon.py
 ${PYSITELIB}/Cython/Compiler/Lexicon.pyc
 ${PYSITELIB}/Cython/Compiler/Lexicon.pyo
-${PYSITELIB}/Cython/Compiler/Lexicon.so
 ${PYSITELIB}/Cython/Compiler/Main.py
 ${PYSITELIB}/Cython/Compiler/Main.pyc
 ${PYSITELIB}/Cython/Compiler/Main.pyo
@@ -130,7 +131,6 @@ ${PYSITELIB}/Cython/Compiler/Parsing.pxd
 ${PYSITELIB}/Cython/Compiler/Parsing.py
 ${PYSITELIB}/Cython/Compiler/Parsing.pyc
 ${PYSITELIB}/Cython/Compiler/Parsing.pyo
-${PYSITELIB}/Cython/Compiler/Parsing.so
 ${PYSITELIB}/Cython/Compiler/Pipeline.py
 ${PYSITELIB}/Cython/Compiler/Pipeline.pyc
 ${PYSITELIB}/Cython/Compiler/Pipeline.pyo
@@ -140,7 +140,6 @@ ${PYSITELIB}/Cython/Compiler/PyrexTypes.
 ${PYSITELIB}/Cython/Compiler/Pythran.py
 ${PYSITELIB}/Cython/Compiler/Pythran.pyc
 ${PYSITELIB}/Cython/Compiler/Pythran.pyo
-${PYSITELIB}/Cython/Compiler/Pythran.so
 ${PYSITELIB}/Cython/Compiler/Scanning.pxd
 ${PYSITELIB}/Cython/Compiler/Scanning.py
 ${PYSITELIB}/Cython/Compiler/Scanning.pyc
@@ -268,7 +267,6 @@ ${PYSITELIB}/Cython/Distutils/old_build_
 ${PYSITELIB}/Cython/Distutils/old_build_ext.pyc
 ${PYSITELIB}/Cython/Distutils/old_build_ext.pyo
 ${PYSITELIB}/Cython/Includes/Deprecated/python.pxd
-${PYSITELIB}/Cython/Includes/Deprecated/python2.5.pxd
 ${PYSITELIB}/Cython/Includes/Deprecated/python_bool.pxd
 ${PYSITELIB}/Cython/Includes/Deprecated/python_buffer.pxd
 ${PYSITELIB}/Cython/Includes/Deprecated/python_bytes.pxd
@@ -308,7 +306,9 @@ ${PYSITELIB}/Cython/Includes/cpython/__i
 ${PYSITELIB}/Cython/Includes/cpython/array.pxd
 ${PYSITELIB}/Cython/Includes/cpython/bool.pxd
 ${PYSITELIB}/Cython/Includes/cpython/buffer.pxd
+${PYSITELIB}/Cython/Includes/cpython/bytearray.pxd
 ${PYSITELIB}/Cython/Includes/cpython/bytes.pxd
+${PYSITELIB}/Cython/Includes/cpython/ceval.pxd
 ${PYSITELIB}/Cython/Includes/cpython/cobject.pxd
 ${PYSITELIB}/Cython/Includes/cpython/complex.pxd
 ${PYSITELIB}/Cython/Includes/cpython/datetime.pxd
@@ -331,6 +331,7 @@ ${PYSITELIB}/Cython/Includes/cpython/num
 ${PYSITELIB}/Cython/Includes/cpython/object.pxd
 ${PYSITELIB}/Cython/Includes/cpython/oldbuffer.pxd
 ${PYSITELIB}/Cython/Includes/cpython/pycapsule.pxd
+${PYSITELIB}/Cython/Includes/cpython/pylifecycle.pxd
 ${PYSITELIB}/Cython/Includes/cpython/pystate.pxd
 ${PYSITELIB}/Cython/Includes/cpython/pythread.pxd
 ${PYSITELIB}/Cython/Includes/cpython/ref.pxd
@@ -362,6 +363,7 @@ ${PYSITELIB}/Cython/Includes/libcpp/algo
 ${PYSITELIB}/Cython/Includes/libcpp/cast.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/complex.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/deque.pxd
+${PYSITELIB}/Cython/Includes/libcpp/forward_list.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/functional.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/iterator.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/limits.pxd
@@ -446,7 +448,6 @@ ${PYSITELIB}/Cython/Shadow.pyo
 ${PYSITELIB}/Cython/StringIOTree.py
 ${PYSITELIB}/Cython/StringIOTree.pyc
 ${PYSITELIB}/Cython/StringIOTree.pyo
-${PYSITELIB}/Cython/StringIOTree.so
 ${PYSITELIB}/Cython/Tempita/__init__.py
 ${PYSITELIB}/Cython/Tempita/__init__.pyc
 ${PYSITELIB}/Cython/Tempita/__init__.pyo
@@ -466,6 +467,9 @@ ${PYSITELIB}/Cython/TestUtils.pyo
 ${PYSITELIB}/Cython/Tests/TestCodeWriter.py
 ${PYSITELIB}/Cython/Tests/TestCodeWriter.pyc
 ${PYSITELIB}/Cython/Tests/TestCodeWriter.pyo
+${PYSITELIB}/Cython/Tests/TestCythonUtils.py
+${PYSITELIB}/Cython/Tests/TestCythonUtils.pyc
+${PYSITELIB}/Cython/Tests/TestCythonUtils.pyo
 ${PYSITELIB}/Cython/Tests/TestJediTyper.py
 ${PYSITELIB}/Cython/Tests/TestJediTyper.pyc
 ${PYSITELIB}/Cython/Tests/TestJediTyper.pyo

Index: pkgsrc/devel/py-cython/distinfo
diff -u pkgsrc/devel/py-cython/distinfo:1.39 pkgsrc/devel/py-cython/distinfo:1.40
--- pkgsrc/devel/py-cython/distinfo:1.39        Tue Aug  7 09:36:42 2018
+++ pkgsrc/devel/py-cython/distinfo     Mon Oct 15 08:21:03 2018
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.39 2018/08/07 09:36:42 adam Exp $
+$NetBSD: distinfo,v 1.40 2018/10/15 08:21:03 adam Exp $
 
-SHA1 (Cython-0.28.5.tar.gz) = d3e9c49cb1fef58e7ddbfec8ac8c388bae554333
-RMD160 (Cython-0.28.5.tar.gz) = 673d6a4ea7f195b98cd004de31ce511fc668f93e
-SHA512 (Cython-0.28.5.tar.gz) = a6fad634d289dcf978f3b18bd8c4ba37b7f4672376a5e8b4d282dc7e611ebb38748fc1d4de20771dd0b4227edd5c81bd1c916befe1588982eaa711543b75d5c5
-Size (Cython-0.28.5.tar.gz) = 1881107 bytes
+SHA1 (Cython-0.29.tar.gz) = efe76eb5511a4f089cc6719b98624f31916b9258
+RMD160 (Cython-0.29.tar.gz) = 613bcee93bb497a5b951554554464511a1110eec
+SHA512 (Cython-0.29.tar.gz) = f90249c12bb9c1f5b9bcecd66624516d6e255a8d321a5dada2ba4eda360c12623c64b391177e061eac7a37b24ec53f8098fc0e1b46065e69eb0766585f739ab6
+Size (Cython-0.29.tar.gz) = 2037177 bytes
 SHA1 (patch-ac) = d0e06dd9e4b5a34d0614ec17f51c129eb7724323
-SHA1 (patch-runtests.py) = 788ff593da9ce447af368957f1a8be562e2d40da
+SHA1 (patch-runtests.py) = d08d3d8e17d6b75a3067f295d3d3eb63ffe97b48

Index: pkgsrc/devel/py-cython/patches/patch-runtests.py
diff -u pkgsrc/devel/py-cython/patches/patch-runtests.py:1.1 pkgsrc/devel/py-cython/patches/patch-runtests.py:1.2
--- pkgsrc/devel/py-cython/patches/patch-runtests.py:1.1        Sun Sep 14 17:44:49 2014
+++ pkgsrc/devel/py-cython/patches/patch-runtests.py    Mon Oct 15 08:21:03 2018
@@ -1,10 +1,10 @@
-$NetBSD: patch-runtests.py,v 1.1 2014/09/14 17:44:49 wiz Exp $
+$NetBSD: patch-runtests.py,v 1.2 2018/10/15 08:21:03 adam Exp $
 
 Use correct make for pkgsrc.
 
---- runtests.py.orig   2014-09-10 15:49:05.000000000 +0000
+--- runtests.py.orig   2018-10-14 15:27:58.000000000 +0000
 +++ runtests.py
-@@ -1450,12 +1450,12 @@ class EmbedTest(unittest.TestCase):
+@@ -1770,12 +1770,12 @@ class EmbedTest(unittest.TestCase):
          self.old_dir = os.getcwd()
          os.chdir(self.working_dir)
          os.system(
@@ -19,12 +19,12 @@ Use correct make for pkgsrc.
          except:
              pass
          os.chdir(self.old_dir)
-@@ -1476,7 +1476,7 @@ class EmbedTest(unittest.TestCase):
+@@ -1795,7 +1795,7 @@ class EmbedTest(unittest.TestCase):
              cython = os.path.join(CY3_DIR, cython)
          cython = os.path.abspath(os.path.join('..', '..', cython))
-         self.assert_(os.system(
--            "make PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir)) == 0)
-+            "gmake PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir)) == 0)
+         self.assertEqual(0, os.system(
+-            "make PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir)))
++            "gmake PYTHON='%s' CYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, cython, libdir)))
          try:
              os.remove('make.output')
          except OSError:

Added files:

Index: pkgsrc/devel/py-cython/ALTERNATIVES
diff -u /dev/null pkgsrc/devel/py-cython/ALTERNATIVES:1.1
--- /dev/null   Mon Oct 15 08:21:03 2018
+++ pkgsrc/devel/py-cython/ALTERNATIVES Mon Oct 15 08:21:03 2018
@@ -0,0 +1,3 @@
+bin/cygdb @PREFIX@/bin/cygdb-@PYVERSSUFFIX@
+bin/cython @PREFIX@/bin/cython-@PYVERSSUFFIX@
+bin/cythonize @PREFIX@/bin/cythonize-@PYVERSSUFFIX@



Home | Main Index | Thread Index | Old Index