Accepting request 316028 from home:termim:branches:devel:languages:python

update to 0.22.1

OBS-URL: https://build.opensuse.org/request/show/316028
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=58
This commit is contained in:
Michal Čihař 2015-07-13 11:00:08 +00:00 committed by Git OBS Bridge
parent f2c4dec55e
commit 23073e6890
5 changed files with 33 additions and 129 deletions

3
Cython-0.22.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7fff120e65e7b66edb4a42823f5642bad3bc1e5601bf882d66aee50248cf0682
size 1581021

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:14307e7a69af9a0d0e0024d446af7e51cc0e3e4d0dfb10d36ba837e5e5844015
size 1584483

View File

@ -1,122 +0,0 @@
From 65408e6c70074c4fec128805888d18c7e933895a Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Fri, 13 Feb 2015 14:38:32 +0100
Subject: [PATCH] fix doctests in 32bit Py2.x
---
tests/run/carray_coercion.pyx | 23 +++++++++++++++++++----
tests/run/reversed_iteration.pyx | 35 +++++++++++++++++++++++------------
2 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/tests/run/carray_coercion.pyx b/tests/run/carray_coercion.pyx
index d73fcf4..f04f820 100644
--- a/tests/run/carray_coercion.pyx
+++ b/tests/run/carray_coercion.pyx
@@ -1,3 +1,18 @@
+# mode: run
+
+import sys
+IS_PY3 = sys.version_info[0] >= 3
+IS_32BIT_PY2 = not IS_PY3 and sys.maxint < 2**32
+
+
+def unlongify(v):
+ # on 32bit Py2.x platforms, 'unsigned int' coerces to a Python long => fix doctest output here.
+ s = repr(v)
+ if IS_32BIT_PY2:
+ assert s.count('L') == s.count(',') + 1, s
+ s = s.replace('L', '')
+ return s
+
def from_int_array():
"""
@@ -30,8 +45,8 @@ cdef extern from "stdint.h":
def from_typedef_int_array():
"""
- >>> from_typedef_int_array()
- [1, 2, 3]
+ >>> unlongify(from_typedef_int_array())
+ '[1, 2, 3]'
"""
cdef uint32_t[3] v
v[0] = 1
@@ -42,8 +57,8 @@ def from_typedef_int_array():
cpdef tuple tuple_from_typedef_int_array():
"""
- >>> tuple_from_typedef_int_array()
- (1, 2, 3)
+ >>> unlongify(tuple_from_typedef_int_array())
+ '(1, 2, 3)'
"""
cdef uint32_t[3] v
v[0] = 1
diff --git a/tests/run/reversed_iteration.pyx b/tests/run/reversed_iteration.pyx
index 585d0df..0f55060 100644
--- a/tests/run/reversed_iteration.pyx
+++ b/tests/run/reversed_iteration.pyx
@@ -5,6 +5,17 @@ cimport cython
import sys
IS_PY3 = sys.version_info[0] >= 3
+IS_32BIT_PY2 = not IS_PY3 and sys.maxint < 2**32
+
+
+def unlongify(v):
+ # on 32bit Py2.x platforms, 'unsigned int' coerces to a Python long => fix doctest output here.
+ s = repr(v)
+ if IS_32BIT_PY2:
+ assert s.count('L') == s.count(',') + 1, s
+ s = s.replace('L', '')
+ return s
+
def _reversed(it):
return list(it)[::-1]
@@ -764,10 +775,10 @@ def reversed_bytes_slice_step_only(bytes s):
@cython.test_assert_path_exists('//ForFromStatNode')
def reversed_unsigned(int a, int b):
"""
- >>> reversed_unsigned(0, 5)
- [4, 3, 2, 1, 0]
- >>> reversed_unsigned(1, 5)
- [4, 3, 2, 1]
+ >>> unlongify(reversed_unsigned(0, 5))
+ '[4, 3, 2, 1, 0]'
+ >>> unlongify(reversed_unsigned(1, 5))
+ '[4, 3, 2, 1]'
>>> reversed_unsigned(1, 1)
[]
"""
@@ -777,10 +788,10 @@ def reversed_unsigned(int a, int b):
@cython.test_assert_path_exists('//ForFromStatNode')
def reversed_unsigned_by_3(int a, int b):
"""
- >>> reversed_unsigned_by_3(0, 5)
- [3, 0]
- >>> reversed_unsigned_by_3(0, 7)
- [6, 3, 0]
+ >>> unlongify(reversed_unsigned_by_3(0, 5))
+ '[3, 0]'
+ >>> unlongify(reversed_unsigned_by_3(0, 7))
+ '[6, 3, 0]'
"""
cdef unsigned int i
return [i for i in reversed(range(a, b, 3))]
@@ -788,10 +799,10 @@ def reversed_unsigned_by_3(int a, int b):
@cython.test_assert_path_exists('//ForFromStatNode')
def range_unsigned_by_neg_3(int a, int b):
"""
- >>> range_unsigned_by_neg_3(-1, 6)
- [6, 3, 0]
- >>> range_unsigned_by_neg_3(0, 7)
- [7, 4, 1]
+ >>> unlongify(range_unsigned_by_neg_3(-1, 6))
+ '[6, 3, 0]'
+ >>> unlongify(range_unsigned_by_neg_3(0, 7))
+ '[7, 4, 1]'
"""
cdef unsigned int i
return [i for i in range(b, a, -3)]

View File

@ -1,3 +1,32 @@
-------------------------------------------------------------------
Fri Jul 10 21:59:38 UTC 2015 - termim@gmail.com
- Update to 0.22.1:
Bugs fixed
* Crash when returning values on generator termination.
* In some cases, exceptions raised during internal isinstance()
checks were not propagated.
* Runtime reported file paths of source files (e.g for profiling
and tracing) are now relative to the build root directory instead
of the main source file.
* Tracing exception handling code could enter the trace function with an
active exception set.
* The internal generator function type was not shared across modules.
* Comparisons of (inferred) ctuples failed to compile.
* Closures inside of cdef functions returning ``void`` failed to compile.
* Using ``const`` C++ references in intermediate parts of longer
expressions could fail to compile.
* C++ exception declarations with mapping functions could fail to compile
when pre-declared in .pxd files.
* C++ compilation could fail with an ambiguity error in recent MacOS-X
Xcode versions.
* C compilation could fail in pypy3.
* Fixed a memory leak in the compiler when compiling multiple modules.
* When compiling multiple modules, external library dependencies could
leak into later compiler runs. Fix by Jeroen Demeyer. This fixes
ticket 845.
- removed patch fix-32bit.patch as applied upstream
-------------------------------------------------------------------
Wed Apr 22 14:05:18 UTC 2015 - mcihar@suse.cz

View File

@ -17,7 +17,7 @@
Name: python-Cython
Version: 0.22
Version: 0.22.1
Release: 0
Url: http://www.cython.org
Summary: The Cython compiler for writing C extensions for the Python language
@ -25,8 +25,6 @@ License: Apache-2.0
Group: Development/Languages/Python
Source: http://cython.org/release/Cython-%{version}.tar.gz
Source1: python-Cython-rpmlintrc
# PATCH-FIX-UPSTREAM -- https://github.com/cython/cython/commit/65408e6c70074c4fec128805888d18c7e933895a
Patch0: fix-32bit.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -64,7 +62,6 @@ code.
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py
# Fix EOL encoding
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c
%patch0 -p1
%build
CFLAGS="%{optflags}" python setup.py build