From 6e06866e8fca27ed8b3f37af424ef78eaf8d3effcc73f87e72a42b1576a6c68f Mon Sep 17 00:00:00 2001 From: Denisart Benjamin Date: Mon, 9 Feb 2015 16:07:30 +0000 Subject: [PATCH 1/5] Accepting request 284215 from home:frispete:python In case somebody cares.. - fix update-alternatives handling in a distribution backwards compatible way OBS-URL: https://build.opensuse.org/request/show/284215 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=55 --- python-Cython.changes | 5 +++++ python-Cython.spec | 34 ++++++++++++++-------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/python-Cython.changes b/python-Cython.changes index a79f23f..e6e5a6a 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 5 11:35:45 UTC 2015 - hpj@urpla.net + +- fix update-alternatives handling in a distribution backwards compatible way + ------------------------------------------------------------------- Fri Jan 9 15:20:31 UTC 2015 - dimstar@opensuse.org diff --git a/python-Cython.spec b/python-Cython.spec index 75406f3..776e51e 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -56,14 +56,10 @@ code. %prep %setup -q -n Cython-%{version} -sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py # Fix non-executable scripts -sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} Doc/primes.c # Fix EOL encoding -mv bin/cython bin/cython-%{py_ver} -mv bin/cythonize bin/cythonize-%{py_ver} -mv bin/cygdb bin/cygdb-%{py_ver} -sed -i "s|bin/cython|bin/cython-%{py_ver}|" setup.py -sed -i "s|bin/cythonize|bin/cythonize-%{py_ver}|" setup.py -sed -i "s|bin/cygdb|bin/cygdb-%{py_ver}|" setup.py +# Fix non-executable scripts +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 %build CFLAGS="%{optflags}" python setup.py build @@ -72,9 +68,11 @@ CFLAGS="%{optflags}" python setup.py build python setup.py install --prefix=%{_prefix} --root=%{buildroot} # Prepare for update-alternatives usage mkdir -p %{buildroot}%{_sysconfdir}/alternatives -ln -s -f %{_sysconfdir}/alternatives/cython %{buildroot}%{_bindir}/cython -ln -s -f %{_sysconfdir}/alternatives/cythonize %{buildroot}%{_bindir}/cythonize -ln -s -f %{_sysconfdir}/alternatives/cygdb %{buildroot}%{_bindir}/cygdb +for p in cython cythonize cygdb ; do + mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver} + ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_bindir}/$p + ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_sysconfdir}/alternatives/$p +done %fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir} rm -rf %{buildroot}%{python_sitearch}/__pycache__/ @@ -84,26 +82,22 @@ rm -rf %{buildroot}%{python_sitearch}/__pycache__/ python runtests.py %post -update-alternatives \ +%_sbindir/update-alternatives \ --install %{_bindir}/cython cython %{_bindir}/cython-%{py_ver} 30 \ --slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \ --slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver} %preun if [ $1 -eq 0 ] ; then - update-alternatives --remove cython %{_bindir}/cython-%{py_ver} + %_sbindir/update-alternatives --remove cython %{_bindir}/cython-%{py_ver} fi -# Disabled testsuite as it takes a long time: -#%%check -#python runtests.py - %files %defattr(-,root,root,-) %doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos -%{_bindir}/cygdb -%{_bindir}/cython -%{_bindir}/cythonize +%ghost %{_bindir}/cygdb +%ghost %{_bindir}/cython +%ghost %{_bindir}/cythonize %{_bindir}/cygdb-%{py_ver} %{_bindir}/cython-%{py_ver} %{_bindir}/cythonize-%{py_ver} From 4cbbcbaf4f4d08ec49a01af4905dbb69a69f097714f51b5b8e8cbef7a328d781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 22 Apr 2015 13:54:51 +0000 Subject: [PATCH 2/5] Accepting request 298594 from home:Nijel:branches:devel:languages:python - Add python-numpy as BuildRequires to have more complete test coverage - Fix doctests in 32-bit environment (fix-32bit.patch) - Update to 0.22: Features added * C functions can coerce to Python functions, which allows passing them around as callable objects. * C arrays can be assigned by value and auto-coerce from Python iterables and to Python lists (and tuples). * Extern C functions can now be declared as cpdef to export them to the module's Python namespace. Extern C functions in pxd files export their values to their own module, iff it exists. * Anonymous C tuple types can be declared as (ctype1, ctype2, ...). * PEP 479: turn accidental StopIteration exceptions that exit generators into a RuntimeError, activated with future import "generator_stop". See http://legacy.python.org/dev/peps/pep-0479/ * Looping over ``reversed(range())`` is optimised in the same way as ``range()``. Patch by Favian Contreras. Bugs fixed * Mismatching 'except' declarations on signatures in .pxd and .pyx files failed to produce a compile error. * Failure to find any files for the path pattern(s) passed into ``cythonize()`` is now an error to more easily detect accidental typos. * The ``logaddexp`` family of functions in ``numpy.math`` now has correct declarations. * In Py2.6/7 and Py3.2, simple Cython memory views could accidentally be interpreted as non-contiguous by CPython, which could trigger a CPython bug when copying data from them, thus leading to data corruption. See CPython issues 12834 and 23349. OBS-URL: https://build.opensuse.org/request/show/298594 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=56 --- Cython-0.21.1.tar.gz | 3 -- Cython-0.22.tar.gz | 3 ++ fix-32bit.patch | 122 ++++++++++++++++++++++++++++++++++++++++++ python-Cython.changes | 47 ++++++++++++++++ python-Cython.spec | 11 ++-- 5 files changed, 180 insertions(+), 6 deletions(-) delete mode 100644 Cython-0.21.1.tar.gz create mode 100644 Cython-0.22.tar.gz create mode 100644 fix-32bit.patch diff --git a/Cython-0.21.1.tar.gz b/Cython-0.21.1.tar.gz deleted file mode 100644 index 74094f9..0000000 --- a/Cython-0.21.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43f64d225186ec7601249ebd1e8f8a7c33767974b493de6783c5b3dd0415bf35 -size 2743480 diff --git a/Cython-0.22.tar.gz b/Cython-0.22.tar.gz new file mode 100644 index 0000000..0fad07b --- /dev/null +++ b/Cython-0.22.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14307e7a69af9a0d0e0024d446af7e51cc0e3e4d0dfb10d36ba837e5e5844015 +size 1584483 diff --git a/fix-32bit.patch b/fix-32bit.patch new file mode 100644 index 0000000..68c9a77 --- /dev/null +++ b/fix-32bit.patch @@ -0,0 +1,122 @@ +From 65408e6c70074c4fec128805888d18c7e933895a Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +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)] diff --git a/python-Cython.changes b/python-Cython.changes index e6e5a6a..82a563e 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -1,3 +1,50 @@ +------------------------------------------------------------------- +Wed Apr 22 11:52:03 UTC 2015 - mcihar@suse.cz + +- Add python-numpy as BuildRequires to have more complete test coverage + +------------------------------------------------------------------- +Wed Apr 22 11:01:47 UTC 2015 - mcihar@suse.cz + +- Fix doctests in 32-bit environment (fix-32bit.patch) + +------------------------------------------------------------------- +Wed Apr 22 09:10:30 UTC 2015 - mcihar@suse.cz + +- Update to 0.22: + Features added + * C functions can coerce to Python functions, which allows passing them + around as callable objects. + * C arrays can be assigned by value and auto-coerce from Python iterables + and to Python lists (and tuples). + * Extern C functions can now be declared as cpdef to export them to + the module's Python namespace. Extern C functions in pxd files export + their values to their own module, iff it exists. + * Anonymous C tuple types can be declared as (ctype1, ctype2, ...). + * PEP 479: turn accidental StopIteration exceptions that exit generators + into a RuntimeError, activated with future import "generator_stop". + See http://legacy.python.org/dev/peps/pep-0479/ + * Looping over ``reversed(range())`` is optimised in the same way as + ``range()``. Patch by Favian Contreras. + Bugs fixed + * Mismatching 'except' declarations on signatures in .pxd and .pyx files failed + to produce a compile error. + * Failure to find any files for the path pattern(s) passed into ``cythonize()`` + is now an error to more easily detect accidental typos. + * The ``logaddexp`` family of functions in ``numpy.math`` now has correct + declarations. + * In Py2.6/7 and Py3.2, simple Cython memory views could accidentally be + interpreted as non-contiguous by CPython, which could trigger a CPython + bug when copying data from them, thus leading to data corruption. + See CPython issues 12834 and 23349. + Other changes + * Preliminary support for defining the Cython language with a formal grammar. + To try parsing your files against this grammar, use the --formal_grammar directive. + Experimental. + * ``_`` is no longer considered a cacheable builtin as it could interfere with + gettext. + * Cythonize-computed metadata now cached in the generated C files. + ------------------------------------------------------------------- Thu Feb 5 11:35:45 UTC 2015 - hpj@urpla.net diff --git a/python-Cython.spec b/python-Cython.spec index 776e51e..860c5d5 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -1,7 +1,7 @@ # # spec file for package python-Cython # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-Cython -Version: 0.21.1 +Version: 0.22 Release: 0 Url: http://www.cython.org Summary: The Cython compiler for writing C extensions for the Python language @@ -25,10 +25,14 @@ License: Apache-2.0 Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/C/Cython/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++ BuildRequires: python-devel +BuildRequires: python-numpy +BuildRequires: python-numpy-devel BuildRequires: python-xml Provides: python-cython = %{version} Obsoletes: python-cython < %{version} @@ -60,6 +64,7 @@ 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 @@ -79,7 +84,7 @@ rm -rf %{buildroot}%{python_sitearch}/__pycache__/ # avoid conflicts with python 2 version %check -python runtests.py +python runtests.py -vv %post %_sbindir/update-alternatives \ From f2c4dec55e945adf4dee9b84aacb0cbcbcf83f3e3cf58bb6371a6beb2f7b9af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 22 Apr 2015 14:05:54 +0000 Subject: [PATCH 3/5] Accepting request 298611 from home:Nijel:branches:devel:languages:python - Use Source URL from cython.org OBS-URL: https://build.opensuse.org/request/show/298611 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=57 --- python-Cython.changes | 5 +++++ python-Cython.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python-Cython.changes b/python-Cython.changes index 82a563e..2a0bd42 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 22 14:05:18 UTC 2015 - mcihar@suse.cz + +- Use Source URL from cython.org + ------------------------------------------------------------------- Wed Apr 22 11:52:03 UTC 2015 - mcihar@suse.cz diff --git a/python-Cython.spec b/python-Cython.spec index 860c5d5..7384bde 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -23,7 +23,7 @@ Url: http://www.cython.org Summary: The Cython compiler for writing C extensions for the Python language License: Apache-2.0 Group: Development/Languages/Python -Source: http://pypi.python.org/packages/source/C/Cython/Cython-%{version}.tar.gz +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 From 23073e68900a70d3335e9e5d73b96f3935fce93d066d598a809c7cc17ca71fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 13 Jul 2015 11:00:08 +0000 Subject: [PATCH 4/5] 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 --- Cython-0.22.1.tar.gz | 3 ++ Cython-0.22.tar.gz | 3 -- fix-32bit.patch | 122 ------------------------------------------ python-Cython.changes | 29 ++++++++++ python-Cython.spec | 5 +- 5 files changed, 33 insertions(+), 129 deletions(-) create mode 100644 Cython-0.22.1.tar.gz delete mode 100644 Cython-0.22.tar.gz delete mode 100644 fix-32bit.patch diff --git a/Cython-0.22.1.tar.gz b/Cython-0.22.1.tar.gz new file mode 100644 index 0000000..fa45989 --- /dev/null +++ b/Cython-0.22.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fff120e65e7b66edb4a42823f5642bad3bc1e5601bf882d66aee50248cf0682 +size 1581021 diff --git a/Cython-0.22.tar.gz b/Cython-0.22.tar.gz deleted file mode 100644 index 0fad07b..0000000 --- a/Cython-0.22.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14307e7a69af9a0d0e0024d446af7e51cc0e3e4d0dfb10d36ba837e5e5844015 -size 1584483 diff --git a/fix-32bit.patch b/fix-32bit.patch deleted file mode 100644 index 68c9a77..0000000 --- a/fix-32bit.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 65408e6c70074c4fec128805888d18c7e933895a Mon Sep 17 00:00:00 2001 -From: Stefan Behnel -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)] diff --git a/python-Cython.changes b/python-Cython.changes index 2a0bd42..16d9396 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -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 diff --git a/python-Cython.spec b/python-Cython.spec index 7384bde..d9d23ca 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -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 From 888bd2a4a3c3fc34f98b0e2d16155baae8426c4fe8ee6d059fd1a32666b55817 Mon Sep 17 00:00:00 2001 From: Todd R Date: Wed, 29 Jul 2015 13:03:09 +0000 Subject: [PATCH 5/5] Accepting request 319398 from home:TheBlackCat:branches:devel:languages:python - Remove unneeded numpy dependency to avoid dependency loop. - create dummy alternative to avoid 13.1's post-build-check bug - fixing update_alternatives OBS-URL: https://build.opensuse.org/request/show/319398 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=59 --- python-Cython.changes | 8 ++++++++ python-Cython.spec | 29 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/python-Cython.changes b/python-Cython.changes index 16d9396..ea737d4 100644 --- a/python-Cython.changes +++ b/python-Cython.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jul 29 11:52:24 UTC 2015 - toddrme2178@gmail.com + +- Remove unneeded numpy dependency to avoid dependency loop. +- create dummy alternative to avoid 13.1's post-build-check bug +- specfile: + * fixing update_alternatives + ------------------------------------------------------------------- Fri Jul 10 21:59:38 UTC 2015 - termim@gmail.com diff --git a/python-Cython.spec b/python-Cython.spec index d9d23ca..e1bd289 100644 --- a/python-Cython.spec +++ b/python-Cython.spec @@ -29,14 +29,12 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-devel -BuildRequires: python-numpy -BuildRequires: python-numpy-devel BuildRequires: python-xml -Provides: python-cython = %{version} -Obsoletes: python-cython < %{version} Requires: python-xml Requires(post): update-alternatives Requires(postun): update-alternatives +Provides: python-cython = %{version} +Obsoletes: python-cython < %{version} %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %endif @@ -68,20 +66,18 @@ CFLAGS="%{optflags}" python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} + # Prepare for update-alternatives usage mkdir -p %{buildroot}%{_sysconfdir}/alternatives for p in cython cythonize cygdb ; do mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver} - ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_bindir}/$p - ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_sysconfdir}/alternatives/$p + ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p + # create a dummy target for /etc/alternatives/$p + touch %{buildroot}%{_sysconfdir}/alternatives/$p done %fdupes -s %{buildroot}%{python_sitearch} %{buildroot}%{_docdir} rm -rf %{buildroot}%{python_sitearch}/__pycache__/ -# avoid conflicts with python 2 version - -%check -python runtests.py -vv %post %_sbindir/update-alternatives \ @@ -89,17 +85,20 @@ python runtests.py -vv --slave %{_bindir}/cythonize cythonize %{_bindir}/cythonize-%{py_ver} \ --slave %{_bindir}/cygdb cygdb %{_bindir}/cygdb-%{py_ver} -%preun +%postun if [ $1 -eq 0 ] ; then %_sbindir/update-alternatives --remove cython %{_bindir}/cython-%{py_ver} fi +%check +python runtests.py -vv + %files %defattr(-,root,root,-) %doc COPYING.txt LICENSE.txt README.txt ToDo.txt USAGE.txt Doc Demos -%ghost %{_bindir}/cygdb -%ghost %{_bindir}/cython -%ghost %{_bindir}/cythonize +%{_bindir}/cygdb +%{_bindir}/cython +%{_bindir}/cythonize %{_bindir}/cygdb-%{py_ver} %{_bindir}/cython-%{py_ver} %{_bindir}/cythonize-%{py_ver} @@ -107,7 +106,7 @@ fi %ghost %{_sysconfdir}/alternatives/cython %ghost %{_sysconfdir}/alternatives/cythonize %{python_sitearch}/Cython/ -%{python_sitearch}/Cython-%{version}-py%{py_ver}.egg-info +%{python_sitearch}/Cython-%{version}-py*.egg-info %{python_sitearch}/cython.py* %{python_sitearch}/pyximport/