Skip to content

Commit 05d7d1d

Browse files
author
Release Manager
committed
gh-36110: Update Cython to 3.0.2 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> This PR builds on #36109 and contains the rest of changes needed to update Cython to 3.0.0. The actual changes needed for building Sage are a632238 for the code, 67ad2e4 for the build system, and 7195b8f for the doctests. The rest of commits are either from #36109 or for patching dependencies. Closes #29863. Ideally we should wait until numpy and scipy are upgraded to 1.25 and 1.11 respectively before merging this, so we can drop the patches for them. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> - Depends on #36109 - Depends on #36112 (merged here) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36110 Reported by: Yutao Yuan Reviewer(s): Gonzalo Tornaría, Kwankyu Lee, Matthias Köppe, Tobias Diez
2 parents 5cef467 + cb78fd9 commit 05d7d1d

32 files changed

+211
-581
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
commit 8ef356a4eb936c37f55a5c501f3a955e6740c0c5
2+
Author: Gonzalo Tornaría <[email protected]>
3+
Date: Wed Jul 19 19:45:23 2023 -0300
4+
5+
cython3 support using legacy directives
6+
7+
diff --git a/cypari2/gen.pyx b/cypari2/gen.pyx
8+
index 247b1ad..75050a0 100644
9+
--- a/cypari2/gen.pyx
10+
+++ b/cypari2/gen.pyx
11+
@@ -329,7 +329,7 @@ cdef class Gen(Gen_base):
12+
>>> pari = Pari()
13+
>>> L = pari("vector(10,i,i^2)")
14+
>>> L.__iter__()
15+
- <generator object at ...>
16+
+ <...generator object at ...>
17+
>>> [x for x in L]
18+
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
19+
>>> list(L)
20+
diff --git a/setup.py b/setup.py
21+
index 2188711..455337f 100755
22+
--- a/setup.py
23+
+++ b/setup.py
24+
@@ -36,6 +36,8 @@ class build_ext(_build_ext):
25+
"binding": True,
26+
"cdivision": True,
27+
"language_level": 2,
28+
+ "legacy_implicit_noexcept": True,
29+
+ "c_api_binop_methods": True,
30+
}
31+
32+
_build_ext.finalize_options(self)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/cysignals/signals.pxd.in b/src/cysignals/signals.pxd.in
2+
index c86e085..a98c8d1 100644
3+
--- a/src/cysignals/signals.pxd.in
4+
+++ b/src/cysignals/signals.pxd.in
5+
@@ -54,7 +54,7 @@ cdef extern from "macros.h" nogil:
6+
# can be used to make Cython check whether there is a pending exception
7+
# (PyErr_Occurred() is non-NULL). To Cython, it will look like
8+
# cython_check_exception() actually raised the exception.
9+
-cdef inline void cython_check_exception() nogil except *:
10+
+cdef inline void cython_check_exception() except * nogil:
11+
pass
12+
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
commit 9996a4028ddc7f9a5ffda3df65d5b7d3b7df8aa5
2+
Author: Gonzalo Tornaría <[email protected]>
3+
Date: Wed Jul 19 18:34:57 2023 -0300
4+
5+
cython3 support using legacy directives
6+
7+
diff --git a/setup.py b/setup.py
8+
index 37acdfc..f68270b 100755
9+
--- a/setup.py
10+
+++ b/setup.py
11+
@@ -157,13 +157,17 @@ class build_ext(_build_ext):
12+
# Run Cython with -Werror on continuous integration services
13+
# with Python 3.6 or later
14+
from Cython.Compiler import Options
15+
- Options.warning_errors = True
16+
+ Options.warning_errors = False
17+
18+
from Cython.Build.Dependencies import cythonize
19+
return cythonize(extensions,
20+
build_dir=cythonize_dir,
21+
include_path=["src", os.path.join(cythonize_dir, "src")],
22+
- compiler_directives=dict(binding=True, language_level=2))
23+
+ compiler_directives=dict(
24+
+ binding=True,
25+
+ language_level=2,
26+
+ legacy_implicit_noexcept=True,
27+
+ ))
28+
29+
30+
class build_py(_build_py):

build/pkgs/cython/checksums.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tarball=Cython-VERSION.tar.gz
2-
sha1=762987c737acfe7532cb3da38b450fb6e0cf1d7b
3-
md5=a4d0f9fbc9c137f1a88937cd40e8c5ee
4-
cksum=2260471737
2+
sha1=08eb99f7c95b7ca667b1547575e7369d8064b4b3
3+
md5=00def3f2b96c393098e01eb2f1f169ad
4+
cksum=2321746451
55
upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz

build/pkgs/cython/dependencies

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| $(PYTHON_TOOLCHAIN) $(PYTHON)
1+
| $(PYTHON_TOOLCHAIN) $(PYTHON) pythran
22

33
----------
44
All lines of this file are ignored except the first.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cython >=0.29.21, <1.0
1+
cython >=3.0, <4.0

build/pkgs/cython/package-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.29.36
1+
3.0.2

0 commit comments

Comments
 (0)