pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/py-cython Update to 0.21:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fb3a61f5fe30
branches:  trunk
changeset: 639502:fb3a61f5fe30
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Sep 14 17:44:49 2014 +0000

description:
Update to 0.21:

0.21 (2014-09-10)
=================

Features added
--------------

* C (cdef) functions allow inner Python functions.

* Enums can now be declared as cpdef to export their values to
  the module's Python namespace.  Cpdef enums in pxd files export
  their values to their own module, iff it exists.

* Allow @staticmethod decorator to declare static cdef methods.
  This is especially useful for declaring "constructors" for
  cdef classes that can take non-Python arguments.

* Taking a ``char*`` from a temporary Python string object is safer
  in more cases and can be done inside of non-trivial expressions,
  including arguments of a function call.  A compile time error
  is raised only when such a pointer is assigned to a variable and
  would thus exceed the lifetime of the string itself.

* Generators have new properties ``__name__`` and ``__qualname__``
  that provide the plain/qualified name of the generator function
  (following CPython 3.5).  See http://bugs.python.org/issue21205

* The ``inline`` function modifier is available as a decorator
  ``@cython.inline`` in pure mode.

* When cygdb is run in a virtualenv, it enables the same virtualenv
  inside of the debugger. Patch by Marc Abramowitz.

* PEP 465: dedicated infix operator for matrix multiplication (A @ B).

* HTML output of annotated code uses Pygments for code highlighting
  and generally received a major overhaul by Matthias Bussonier.

* IPython magic support is now available directly from Cython with
  the command "%load_ext cython".  Cython code can directly be
  executed in a cell when marked with "%%cython".  Code analysis
  is available with "%%cython -a".  Patch by Martín Gaitán.

* Simple support for declaring Python object types in Python signature
  annotations.  Currently requires setting the compiler directive
  ``annotation_typing=True``.

* New directive ``use_switch`` (defaults to True) to optionally disable
  the optimization of chained if statement to C switch statements.

* Defines dynamic_cast et al. in ``libcpp.cast`` and C++ heap data
  structure operations in ``libcpp.algorithm``.

* Shipped header declarations in ``posix.*`` were extended to cover
  more of the POSIX API.  Patches by Lars Buitinck and Mark Peek.

Optimizations
-------------

* Simple calls to C implemented Python functions/methods are faster.
  This also speeds up many operations on builtins that Cython cannot
  otherwise optimise.

* The "and"/"or" operators try to avoid unnecessary coercions of their
  arguments.  They now evaluate the truth value of each argument
  independently and only coerce the final result of the whole expression
  to the target type (e.g. the type on the left side of an assignment).
  This also avoids reference counting overhead for Python values during
  evaluation and generally improves the code flow in the generated C code.

* The Python expression "2 ** N" is optimised into bit shifting.
  See http://bugs.python.org/issue21420

* Cascaded assignments (a = b = ...) try to minimise the number of
  type coercions.

* Calls to ``slice()`` are translated to a straight C-API call.

Bugs fixed
----------

* Crash when assigning memory views from ternary conditional expressions.

* Nested C++ templates could lead to unseparated ">>" characters being
  generated into the C++ declarations, which older C++ compilers could
  not parse.

* Sending SIGINT (Ctrl-C) during parallel cythonize() builds could
  hang the child processes.

* No longer ignore local setup.cfg files for distutils in pyximport.
  Patch by Martin Teichmann.

* Taking a ``char*`` from an indexed Python string generated unsafe
  reference counting code.

* Set literals now create all of their items before trying to add them
  to the set, following the behaviour in CPython.  This makes a
  difference in the rare case that the item creation has side effects
  and some items are not hashable (or if hashing them has side effects,
  too).

* Cython no longer generates the cross product of C functions for code
  that uses memory views of fused types in function signatures (e.g.
  ``cdef func(floating[:] a, floating[:] b)``).  This is considered the
  expected behaviour by most users and was previously inconsistent with
  other structured types like C arrays.  Code that really wants all type
  combinations can create the same fused memoryview type under different
  names and use those in the signature to make it clear which types are
  independent.

* Names that were unknown at compile time were looked up as builtins at
  runtime but not as global module names.  Trying both lookups helps with
  globals() manipulation.

* Fixed stl container conversion for typedef element types.

* ``obj.pop(x)`` truncated large C integer values of x to ``Py_ssize_t``.

* ``__init__.pyc`` is recognised as marking a package directory
  (in addition to .py, .pyx and .pxd).

* Syntax highlighting in ``cython-mode.el`` for Emacs no longer
  incorrectly highlights keywords found as part of longer names.

* Correctly handle ``from cython.submodule cimport name``.

* Fix infinite recursion when using super with cpdef methods.

* No-args ``dir()`` was not guaranteed to return a sorted list.

Other changes
-------------

* The header line in the generated C files no longer contains the
  timestamp but only the Cython version that wrote it.  This was
  changed to make builds more reproducible.

* Removed support for CPython 2.4, 2.5 and 3.1.

* The licensing implications on the generated code were clarified
  to avoid legal constraints for users.

diffstat:

 devel/py-cython/Makefile                  |    7 +-
 devel/py-cython/PLIST                     |   21 ++++-
 devel/py-cython/distinfo                  |   12 +-
 devel/py-cython/log                       |  141 ++++++++++++++++++++++++++++++
 devel/py-cython/patches/patch-ab          |   30 ------
 devel/py-cython/patches/patch-ac          |    8 +-
 devel/py-cython/patches/patch-runtests.py |   30 ++++++
 7 files changed, 205 insertions(+), 44 deletions(-)

diffs (truncated from 338 to 300 lines):

diff -r 68326f4d825e -r fb3a61f5fe30 devel/py-cython/Makefile
--- a/devel/py-cython/Makefile  Sun Sep 14 16:59:45 2014 +0000
+++ b/devel/py-cython/Makefile  Sun Sep 14 17:44:49 2014 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.21 2014/07/22 11:42:51 wiz Exp $
+# $NetBSD: Makefile,v 1.22 2014/09/14 17:44:49 wiz Exp $
 
-DISTNAME=      Cython-0.20.2
+DISTNAME=      Cython-0.21
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/Cy/cy/}
 CATEGORIES=    lang python
 MASTER_SITES=  http://cython.org/release/
@@ -21,13 +21,14 @@
 REPLACE_PYTHON+=       cython.py
 
 # for test only
-#USE_LANGUAGES+= c++
+USE_LANGUAGES+= 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}
 
 .include "../../lang/python/application.mk"
diff -r 68326f4d825e -r fb3a61f5fe30 devel/py-cython/PLIST
--- a/devel/py-cython/PLIST     Sun Sep 14 16:59:45 2014 +0000
+++ b/devel/py-cython/PLIST     Sun Sep 14 17:44:49 2014 +0000
@@ -1,6 +1,7 @@
-@comment $NetBSD: PLIST,v 1.13 2014/07/22 11:42:51 wiz Exp $
+@comment $NetBSD: PLIST,v 1.14 2014/09/14 17:44:49 wiz 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
@@ -19,9 +20,15 @@
 ${PYSITELIB}/Cython/Build/Inline.py
 ${PYSITELIB}/Cython/Build/Inline.pyc
 ${PYSITELIB}/Cython/Build/Inline.pyo
+${PYSITELIB}/Cython/Build/IpythonMagic.py
+${PYSITELIB}/Cython/Build/IpythonMagic.pyc
+${PYSITELIB}/Cython/Build/IpythonMagic.pyo
 ${PYSITELIB}/Cython/Build/Tests/TestInline.py
 ${PYSITELIB}/Cython/Build/Tests/TestInline.pyc
 ${PYSITELIB}/Cython/Build/Tests/TestInline.pyo
+${PYSITELIB}/Cython/Build/Tests/TestIpythonMagic.py
+${PYSITELIB}/Cython/Build/Tests/TestIpythonMagic.pyc
+${PYSITELIB}/Cython/Build/Tests/TestIpythonMagic.pyo
 ${PYSITELIB}/Cython/Build/Tests/TestStripLiterals.py
 ${PYSITELIB}/Cython/Build/Tests/TestStripLiterals.pyc
 ${PYSITELIB}/Cython/Build/Tests/TestStripLiterals.pyo
@@ -322,6 +329,9 @@
 ${PYSITELIB}/Cython/Includes/libc/stdlib.pxd
 ${PYSITELIB}/Cython/Includes/libc/string.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/__init__.pxd
+${PYSITELIB}/Cython/Includes/libcpp/algorithm.pxd
+${PYSITELIB}/Cython/Includes/libcpp/cast.pxd
+${PYSITELIB}/Cython/Includes/libcpp/complex.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/deque.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/list.pxd
 ${PYSITELIB}/Cython/Includes/libcpp/map.pxd
@@ -340,6 +350,12 @@
 ${PYSITELIB}/Cython/Includes/posix/__init__.pxd
 ${PYSITELIB}/Cython/Includes/posix/fcntl.pxd
 ${PYSITELIB}/Cython/Includes/posix/ioctl.pxd
+${PYSITELIB}/Cython/Includes/posix/resource.pxd
+${PYSITELIB}/Cython/Includes/posix/signal.pxd
+${PYSITELIB}/Cython/Includes/posix/stat.pxd
+${PYSITELIB}/Cython/Includes/posix/stdlib.pxd
+${PYSITELIB}/Cython/Includes/posix/time.pxd
+${PYSITELIB}/Cython/Includes/posix/types.pxd
 ${PYSITELIB}/Cython/Includes/posix/unistd.pxd
 ${PYSITELIB}/Cython/Plex/Actions.pxd
 ${PYSITELIB}/Cython/Plex/Actions.py
@@ -408,6 +424,9 @@
 ${PYSITELIB}/Cython/Tests/TestCodeWriter.py
 ${PYSITELIB}/Cython/Tests/TestCodeWriter.pyc
 ${PYSITELIB}/Cython/Tests/TestCodeWriter.pyo
+${PYSITELIB}/Cython/Tests/TestJediTyper.py
+${PYSITELIB}/Cython/Tests/TestJediTyper.pyc
+${PYSITELIB}/Cython/Tests/TestJediTyper.pyo
 ${PYSITELIB}/Cython/Tests/TestStringIOTree.py
 ${PYSITELIB}/Cython/Tests/TestStringIOTree.pyc
 ${PYSITELIB}/Cython/Tests/TestStringIOTree.pyo
diff -r 68326f4d825e -r fb3a61f5fe30 devel/py-cython/distinfo
--- a/devel/py-cython/distinfo  Sun Sep 14 16:59:45 2014 +0000
+++ b/devel/py-cython/distinfo  Sun Sep 14 17:44:49 2014 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.14 2014/07/22 11:42:51 wiz Exp $
+$NetBSD: distinfo,v 1.15 2014/09/14 17:44:49 wiz Exp $
 
-SHA1 (Cython-0.20.2.tar.gz) = e3fd4c32bdfa4a388cce9538417237172c656d55
-RMD160 (Cython-0.20.2.tar.gz) = e78f1779077d6c8e266c9b42b85c8e9031a342d2
-Size (Cython-0.20.2.tar.gz) = 1432614 bytes
-SHA1 (patch-ab) = de923488eb3f08f7e048c35c57bd60cbfb2b4c53
-SHA1 (patch-ac) = 79b421be9b4b72c57df9907533c4732fec9458f9
+SHA1 (Cython-0.21.tar.gz) = f5784539870715e33b51374e9c4451ff6ff21c7f
+RMD160 (Cython-0.21.tar.gz) = f5944014c1e4dccb8ec23af96efc05c137917371
+Size (Cython-0.21.tar.gz) = 1490358 bytes
+SHA1 (patch-ac) = d0e06dd9e4b5a34d0614ec17f51c129eb7724323
+SHA1 (patch-runtests.py) = 788ff593da9ce447af368957f1a8be562e2d40da
diff -r 68326f4d825e -r fb3a61f5fe30 devel/py-cython/log
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/py-cython/log       Sun Sep 14 17:44:49 2014 +0000
@@ -0,0 +1,141 @@
+0.21 (2014-09-10)
+=================
+
+Features added
+--------------
+
+* C (cdef) functions allow inner Python functions.
+
+* Enums can now be declared as cpdef to export their values to
+  the module's Python namespace.  Cpdef enums in pxd files export
+  their values to their own module, iff it exists.
+
+* Allow @staticmethod decorator to declare static cdef methods.
+  This is especially useful for declaring "constructors" for
+  cdef classes that can take non-Python arguments.
+
+* Taking a ``char*`` from a temporary Python string object is safer
+  in more cases and can be done inside of non-trivial expressions,
+  including arguments of a function call.  A compile time error
+  is raised only when such a pointer is assigned to a variable and
+  would thus exceed the lifetime of the string itself.
+
+* Generators have new properties ``__name__`` and ``__qualname__``
+  that provide the plain/qualified name of the generator function
+  (following CPython 3.5).  See http://bugs.python.org/issue21205
+
+* The ``inline`` function modifier is available as a decorator
+  ``@cython.inline`` in pure mode.
+
+* When cygdb is run in a virtualenv, it enables the same virtualenv
+  inside of the debugger. Patch by Marc Abramowitz.
+
+* PEP 465: dedicated infix operator for matrix multiplication (A @ B).
+
+* HTML output of annotated code uses Pygments for code highlighting
+  and generally received a major overhaul by Matthias Bussonier.
+
+* IPython magic support is now available directly from Cython with
+  the command "%load_ext cython".  Cython code can directly be
+  executed in a cell when marked with "%%cython".  Code analysis
+  is available with "%%cython -a".  Patch by Martín Gaitán.
+
+* Simple support for declaring Python object types in Python signature
+  annotations.  Currently requires setting the compiler directive
+  ``annotation_typing=True``.
+
+* New directive ``use_switch`` (defaults to True) to optionally disable
+  the optimization of chained if statement to C switch statements.
+
+* Defines dynamic_cast et al. in ``libcpp.cast`` and C++ heap data
+  structure operations in ``libcpp.algorithm``.
+
+* Shipped header declarations in ``posix.*`` were extended to cover
+  more of the POSIX API.  Patches by Lars Buitinck and Mark Peek.
+
+Optimizations
+-------------
+
+* Simple calls to C implemented Python functions/methods are faster.
+  This also speeds up many operations on builtins that Cython cannot
+  otherwise optimise.
+
+* The "and"/"or" operators try to avoid unnecessary coercions of their
+  arguments.  They now evaluate the truth value of each argument
+  independently and only coerce the final result of the whole expression
+  to the target type (e.g. the type on the left side of an assignment).
+  This also avoids reference counting overhead for Python values during
+  evaluation and generally improves the code flow in the generated C code.
+
+* The Python expression "2 ** N" is optimised into bit shifting.
+  See http://bugs.python.org/issue21420
+
+* Cascaded assignments (a = b = ...) try to minimise the number of
+  type coercions.
+
+* Calls to ``slice()`` are translated to a straight C-API call.
+
+Bugs fixed
+----------
+
+* Crash when assigning memory views from ternary conditional expressions.
+
+* Nested C++ templates could lead to unseparated ">>" characters being
+  generated into the C++ declarations, which older C++ compilers could
+  not parse.
+
+* Sending SIGINT (Ctrl-C) during parallel cythonize() builds could
+  hang the child processes.
+
+* No longer ignore local setup.cfg files for distutils in pyximport.
+  Patch by Martin Teichmann.
+
+* Taking a ``char*`` from an indexed Python string generated unsafe
+  reference counting code.
+
+* Set literals now create all of their items before trying to add them
+  to the set, following the behaviour in CPython.  This makes a
+  difference in the rare case that the item creation has side effects
+  and some items are not hashable (or if hashing them has side effects,
+  too).
+
+* Cython no longer generates the cross product of C functions for code
+  that uses memory views of fused types in function signatures (e.g.
+  ``cdef func(floating[:] a, floating[:] b)``).  This is considered the
+  expected behaviour by most users and was previously inconsistent with
+  other structured types like C arrays.  Code that really wants all type
+  combinations can create the same fused memoryview type under different
+  names and use those in the signature to make it clear which types are
+  independent.
+
+* Names that were unknown at compile time were looked up as builtins at
+  runtime but not as global module names.  Trying both lookups helps with
+  globals() manipulation.
+
+* Fixed stl container conversion for typedef element types.
+
+* ``obj.pop(x)`` truncated large C integer values of x to ``Py_ssize_t``.
+
+* ``__init__.pyc`` is recognised as marking a package directory
+  (in addition to .py, .pyx and .pxd).
+
+* Syntax highlighting in ``cython-mode.el`` for Emacs no longer
+  incorrectly highlights keywords found as part of longer names.
+
+* Correctly handle ``from cython.submodule cimport name``.
+
+* Fix infinite recursion when using super with cpdef methods.
+
+* No-args ``dir()`` was not guaranteed to return a sorted list.
+
+Other changes
+-------------
+
+* The header line in the generated C files no longer contains the
+  timestamp but only the Cython version that wrote it.  This was
+  changed to make builds more reproducible.
+
+* Removed support for CPython 2.4, 2.5 and 3.1.
+
+* The licensing implications on the generated code were clarified
+  to avoid legal constraints for users.
diff -r 68326f4d825e -r fb3a61f5fe30 devel/py-cython/patches/patch-ab
--- a/devel/py-cython/patches/patch-ab  Sun Sep 14 16:59:45 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-$NetBSD: patch-ab,v 1.3 2012/08/12 21:08:46 wiz Exp $
-
-Use correct make for pkgsrc.
-
---- runtests.py.orig   2012-04-21 11:34:22.000000000 +0000
-+++ runtests.py
-@@ -1100,12 +1100,12 @@ class EmbedTest(unittest.TestCase):
-         self.old_dir = os.getcwd()
-         os.chdir(self.working_dir)
-         os.system(
--            "make PYTHON='%s' clean > /dev/null" % sys.executable)
-+            "gmake PYTHON='%s' clean > /dev/null" % sys.executable)
- 
-     def tearDown(self):
-         try:
-             os.system(
--                "make PYTHON='%s' clean > /dev/null" % sys.executable)
-+                "gmake PYTHON='%s' clean > /dev/null" % sys.executable)
-         except:
-             pass
-         os.chdir(self.old_dir)
-@@ -1126,7 +1126,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)
-         try:
-             os.remove('make.output')
-         except OSError:
diff -r 68326f4d825e -r fb3a61f5fe30 devel/py-cython/patches/patch-ac
--- a/devel/py-cython/patches/patch-ac  Sun Sep 14 16:59:45 2014 +0000
+++ b/devel/py-cython/patches/patch-ac  Sun Sep 14 17:44:49 2014 +0000
@@ -1,11 +1,11 @@
-$NetBSD: patch-ac,v 1.4 2012/12/16 16:07:53 wiz Exp $
+$NetBSD: patch-ac,v 1.5 2014/09/14 17:44:49 wiz Exp $
 
 Add missing rpath.
 
---- Demos/embed/Makefile.orig  2012-12-14 08:53:21.000000000 +0000
+--- Demos/embed/Makefile.orig  2014-09-10 15:49:05.000000000 +0000
 +++ Demos/embed/Makefile
-@@ -15,7 +15,7 @@ LIBS=$(shell $(PYTHON) -c "import distut
- SYSLIBS= $(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SYSLIBS'))")
+@@ -15,7 +15,7 @@ LIBS := $(shell $(PYTHON) -c "import dis



Home | Main Index | Thread Index | Old Index