[Python-apps-team] Bug#833288: would FTBFS now with cython 0.24.1 MACS2/IO/PeakIO.pyx:632:49: Cannot assign type 'float' to 'int'

Gianfranco Costamagna locutusofborg at debian.org
Wed Nov 16 11:43:49 UTC 2016


control: tags -1 pending
Hi,

I'm currently going to test a build for the attached patch, will upload in deferred/5 in case everything is good.

Please let me know if I can speed it up, or you want to do a maintainer upload :)

thanks!

G.
-------------- next part --------------
diff -Nru cython-0.24.1/debian/changelog cython-0.24.1/debian/changelog
--- cython-0.24.1/debian/changelog	2016-08-11 19:50:15.000000000 +0200
+++ cython-0.24.1/debian/changelog	2016-11-16 11:55:53.000000000 +0100
@@ -1,3 +1,11 @@
+cython (0.24.1-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/patches/6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2.patch:
+    - fix macs build failure (Closes: #833288)
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Wed, 16 Nov 2016 10:09:01 +0100
+
 cython (0.24.1-2) unstable; urgency=medium
 
   * patches/deb_nopngmath
diff -Nru cython-0.24.1/debian/patches/6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2.patch cython-0.24.1/debian/patches/6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2.patch
--- cython-0.24.1/debian/patches/6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2.patch	1970-01-01 01:00:00.000000000 +0100
+++ cython-0.24.1/debian/patches/6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2.patch	2016-11-16 10:09:23.000000000 +0100
@@ -0,0 +1,57 @@
+From 6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2 Mon Sep 17 00:00:00 2001
+From: Robert Bradshaw <robertwb at gmail.com>
+Date: Tue, 15 Nov 2016 22:42:03 -0800
+Subject: [PATCH] Don't infer unbond function types for bound methods.
+
+This fixes #551.
+---
+ Cython/Compiler/ExprNodes.py |  4 ++++
+ tests/run/type_inference.pyx | 23 +++++++++++++++++++++++
+ 2 files changed, 27 insertions(+)
+
+diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
+index 8bfb538..85fc39a 100644
+--- a/Cython/Compiler/ExprNodes.py
++++ b/Cython/Compiler/ExprNodes.py
+@@ -6205,6 +6205,10 @@ def infer_type(self, env):
+             # builtin types cannot be inferred as C functions as
+             # that would prevent their use as bound methods
+             return py_object_type
++        elif self.entry and self.entry.is_cmethod:
++            # special case: bound methods should not be inferred
++            # as their unbound method types
++            return py_object_type
+         return self.type
+ 
+     def analyse_target_declaration(self, env):
+diff --git a/tests/run/type_inference.pyx b/tests/run/type_inference.pyx
+index ab74108..cf10eed 100644
+--- a/tests/run/type_inference.pyx
++++ b/tests/run/type_inference.pyx
+@@ -722,3 +722,26 @@ cdef class InferInProperties:
+             d = enum_y
+             c = d
+             return typeof(a), typeof(b), typeof(c), typeof(d)
++
++cdef class WithMethods:
++    cdef int offset
++    def __init__(self, offset):
++        self.offset = offset
++    cpdef int one_arg(self, int x):
++        return x + self.offset
++    cpdef int default_arg(self, int x, int y=0):
++        return x + y + self.offset
++
++def test_bound_methods():
++  """
++  >>> test_bound_methods()
++  """
++  o = WithMethods(10)
++  assert typeof(o) == 'WithMethods', typeof(o)
++
++  one_arg = o.one_arg
++  assert one_arg(2) == 12, one_arg(2)
++
++  default_arg = o.default_arg
++  assert default_arg(2) == 12, default_arg(2)
++  assert default_arg(2, 3) == 15, default_arg(2, 2)
diff -Nru cython-0.24.1/debian/patches/series cython-0.24.1/debian/patches/series
--- cython-0.24.1/debian/patches/series	2016-08-11 19:50:15.000000000 +0200
+++ cython-0.24.1/debian/patches/series	2016-11-16 10:09:01.000000000 +0100
@@ -1,3 +1,4 @@
 deb_nopngmath
 deb_disable_googleanalytics
 honour_SOURCE_DATE_EPOCH_for_copyright_year
+6dd263aa3d2d6d80f2d7b96a640a27538fdaa0b2.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20161116/5cf0c37a/attachment-0001.sig>


More information about the Python-apps-team mailing list