summaryrefslogtreecommitdiff
path: root/devel/py-cython
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2014-09-14 17:44:49 +0000
committerwiz <wiz@pkgsrc.org>2014-09-14 17:44:49 +0000
commit73c69fb082c3e07d03846bf75897ffa7537f1c73 (patch)
tree1e24aeb9e9183a70ceed4dfaea68f801d892b1df /devel/py-cython
parente33d7dcb07445f6c8463a12c5a40ad49e4d5d3ff (diff)
downloadpkgsrc-73c69fb082c3e07d03846bf75897ffa7537f1c73.tar.gz
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 (limited to 'devel/py-cython')
-rw-r--r--devel/py-cython/Makefile7
-rw-r--r--devel/py-cython/PLIST21
-rw-r--r--devel/py-cython/distinfo12
-rw-r--r--devel/py-cython/log141
-rw-r--r--devel/py-cython/patches/patch-ac8
-rw-r--r--devel/py-cython/patches/patch-runtests.py (renamed from devel/py-cython/patches/patch-ab)8
6 files changed, 179 insertions, 18 deletions
diff --git a/devel/py-cython/Makefile b/devel/py-cython/Makefile
index 3a818f49991..a7dd14c6b56 100644
--- a/devel/py-cython/Makefile
+++ b/devel/py-cython/Makefile
@@ -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/Debugger/libpython.py
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 --git a/devel/py-cython/PLIST b/devel/py-cython/PLIST
index 2abf5b0a4f1..7454e2f1fc6 100644
--- a/devel/py-cython/PLIST
+++ b/devel/py-cython/PLIST
@@ -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/Dependencies.pyo
${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/stdio.pxd
${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/openmp.pxd
${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/TestUtils.pyo
${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 --git a/devel/py-cython/distinfo b/devel/py-cython/distinfo
index a7c70ac7f81..f2754cd50e2 100644
--- a/devel/py-cython/distinfo
+++ b/devel/py-cython/distinfo
@@ -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 --git a/devel/py-cython/log b/devel/py-cython/log
new file mode 100644
index 00000000000..f011e189660
--- /dev/null
+++ b/devel/py-cython/log
@@ -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 --git a/devel/py-cython/patches/patch-ac b/devel/py-cython/patches/patch-ac
index e7d52bf190c..9592274b6ca 100644
--- a/devel/py-cython/patches/patch-ac
+++ b/devel/py-cython/patches/patch-ac
@@ -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
+ SYSLIBS := $(shell $(PYTHON) -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SYSLIBS'))")
embedded: embedded.o
- $(LINKCC) -o $@ $^ -L$(LIBDIR1) -L$(LIBDIR2) -l$(PYLIB) $(LIBS) $(SYSLIBS) $(LINKFORSHARED)
diff --git a/devel/py-cython/patches/patch-ab b/devel/py-cython/patches/patch-runtests.py
index 32a89cb77d4..46d49949168 100644
--- a/devel/py-cython/patches/patch-ab
+++ b/devel/py-cython/patches/patch-runtests.py
@@ -1,10 +1,10 @@
-$NetBSD: patch-ab,v 1.3 2012/08/12 21:08:46 wiz Exp $
+$NetBSD: patch-runtests.py,v 1.1 2014/09/14 17:44:49 wiz Exp $
Use correct make for pkgsrc.
---- runtests.py.orig 2012-04-21 11:34:22.000000000 +0000
+--- runtests.py.orig 2014-09-10 15:49:05.000000000 +0000
+++ runtests.py
-@@ -1100,12 +1100,12 @@ class EmbedTest(unittest.TestCase):
+@@ -1450,12 +1450,12 @@ class EmbedTest(unittest.TestCase):
self.old_dir = os.getcwd()
os.chdir(self.working_dir)
os.system(
@@ -19,7 +19,7 @@ Use correct make for pkgsrc.
except:
pass
os.chdir(self.old_dir)
-@@ -1126,7 +1126,7 @@ class EmbedTest(unittest.TestCase):
+@@ -1476,7 +1476,7 @@ class EmbedTest(unittest.TestCase):
cython = os.path.join(CY3_DIR, cython)
cython = os.path.abspath(os.path.join('..', '..', cython))
self.assert_(os.system(