Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cython to 3.0.2 #36110

Merged
merged 18 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions build/pkgs/cypari/patches/cython3-legacy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
commit 8ef356a4eb936c37f55a5c501f3a955e6740c0c5
Author: Gonzalo Tornaría <[email protected]>
Date: Wed Jul 19 19:45:23 2023 -0300

cython3 support using legacy directives

diff --git a/cypari2/gen.pyx b/cypari2/gen.pyx
index 247b1ad..75050a0 100644
--- a/cypari2/gen.pyx
+++ b/cypari2/gen.pyx
@@ -329,7 +329,7 @@ cdef class Gen(Gen_base):
>>> pari = Pari()
>>> L = pari("vector(10,i,i^2)")
>>> L.__iter__()
- <generator object at ...>
+ <...generator object at ...>
>>> [x for x in L]
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
>>> list(L)
diff --git a/setup.py b/setup.py
index 2188711..455337f 100755
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,8 @@ class build_ext(_build_ext):
"binding": True,
"cdivision": True,
"language_level": 2,
+ "legacy_implicit_noexcept": True,
+ "c_api_binop_methods": True,
}

_build_ext.finalize_options(self)
13 changes: 13 additions & 0 deletions build/pkgs/cysignals/patches/cython3-fix-warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/cysignals/signals.pxd.in b/src/cysignals/signals.pxd.in
index c86e085..a98c8d1 100644
--- a/src/cysignals/signals.pxd.in
+++ b/src/cysignals/signals.pxd.in
@@ -54,7 +54,7 @@ cdef extern from "macros.h" nogil:
# can be used to make Cython check whether there is a pending exception
# (PyErr_Occurred() is non-NULL). To Cython, it will look like
# cython_check_exception() actually raised the exception.
-cdef inline void cython_check_exception() nogil except *:
+cdef inline void cython_check_exception() except * nogil:
pass


30 changes: 30 additions & 0 deletions build/pkgs/cysignals/patches/cython3-legacy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
commit 9996a4028ddc7f9a5ffda3df65d5b7d3b7df8aa5
Author: Gonzalo Tornaría <[email protected]>
Date: Wed Jul 19 18:34:57 2023 -0300

cython3 support using legacy directives

diff --git a/setup.py b/setup.py
index 37acdfc..f68270b 100755
--- a/setup.py
+++ b/setup.py
@@ -157,13 +157,17 @@ class build_ext(_build_ext):
# Run Cython with -Werror on continuous integration services
# with Python 3.6 or later
from Cython.Compiler import Options
- Options.warning_errors = True
+ Options.warning_errors = False

from Cython.Build.Dependencies import cythonize
return cythonize(extensions,
build_dir=cythonize_dir,
include_path=["src", os.path.join(cythonize_dir, "src")],
- compiler_directives=dict(binding=True, language_level=2))
+ compiler_directives=dict(
+ binding=True,
+ language_level=2,
+ legacy_implicit_noexcept=True,
+ ))


class build_py(_build_py):
6 changes: 3 additions & 3 deletions build/pkgs/cython/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=Cython-VERSION.tar.gz
sha1=762987c737acfe7532cb3da38b450fb6e0cf1d7b
md5=a4d0f9fbc9c137f1a88937cd40e8c5ee
cksum=2260471737
sha1=08eb99f7c95b7ca667b1547575e7369d8064b4b3
md5=00def3f2b96c393098e01eb2f1f169ad
cksum=2321746451
upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cython/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| $(PYTHON_TOOLCHAIN) $(PYTHON) pythran

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/cython/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cython >=0.29.21, <1.0
cython >=3.0, <4.0
2 changes: 1 addition & 1 deletion build/pkgs/cython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.29.36
3.0.2
Loading
Loading