-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Update Cython to 3.0.2 #36110
Conversation
1af038f
to
da994e1
Compare
Thanks. On a first attempt everything is looking great. I had this:
Are you getting this failure? This is just a warning coming from cysignals, which seems it could be fixed by
|
src/sage/arith/srange.pyx
Outdated
@@ -84,7 +84,7 @@ def xsrange(start, end=None, step=1, universe=None, *, coerce=True, bint include | |||
EXAMPLES:: | |||
|
|||
sage: xsrange(10) | |||
<generator object at 0x...> | |||
<_cython_3_0_0.generator object at 0x...> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<_cython_3_0_0.generator object at 0x...> | |
<_cython_3_....generator object at 0x...> |
or maybe just
<_cython_3_0_0.generator object at 0x...> | |
<...generator object at 0x...> |
since the original one is already failing with cython 3.0.2 (which I'm testing with right now).
Except the cysignals warning, everything passes (I didn't run --long yet):
This is looking very promising. More testing necessary. I hope #36109 is merged soon so it becomes much easier to play with this PR. |
BTW, I added the patch to cysignals that I suggested above; then the related doctest failure is gone. |
I ran all doctests (normal and
Everything passes. Not a serious benchmark yet, but it feels like doctests are taking a bit longer (maybe ~10%, but I'm not sure as the computer might have been loaded)... I will test more carefully later. |
About the cysignals failure, I got the same on my system, but I did not include the patch here since I consider it more appropriate to fix cysignals directly and publish a new version there. |
@@ -10,13 +10,17 @@ def compiler_directives(profile: bool): | |||
auto_pickle=False, | |||
# Do not create __test__ dictionary automatically from docstrings | |||
autotestdict=False, | |||
binding=False, | |||
c_api_binop_methods=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why binding=False
?
binding=True
is a present that we were expecting from cython3 for a long time. #26254
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the goal of this PR is to be able to build sagemath with cython 3. It seems enabling options to make cython 3 keep legacy behaviour is the minimal working step we can make. After sagemath is built with cython 3, it can be explored how to switch to the new behaviour. Same for legacy_implicit_noexcept
, which can be removed after all the implicit noexcept
are made explicit, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Please rebase to 10.2.beta1. Now that #36109 is merged, I think this is ready for review, in fact it works very well for me, I am almost ready to give positive review. Caveats:
For some reason @infmagic2047 PR is not getting tested by CI: "This workflow requires approval from a maintainer." maybe some maintainer can approve the workflow (and add them to whatever group is necessary so they can run workflows without approval). I don't have workflow approval powers myself. |
For cysignals fix I mentioned, here's the patch we are using: https://github.com/void-linux/void-packages/blob/master/srcpkgs/python3-cysignals/patches/cython3-fix-warning.patch |
6f26c85
to
5439175
Compare
I rebased on develop and added the cysignals patch. |
LGTM. In void-linux/void-packages#45887 I build and doctest sagemath with cython 3 on the following architectures:
|
Tobias says no but I've only tried it with the patched versions so far. |
Well, I see patches for all of them (except memory_allocator) plus pplpy that I had forgotten in the PR. Frankly all those should have new releases. Otherwise, all the packages have to patched individually. I guess I can do some release of all of them in sage-on-gentoo to test. |
So, I tried to insert all that stuff in my sage-on-gentoo development tree and stable cython (3.0.0) and pythran (0.13.1). I got the following failures when cythonizing sage
and similar messages for quite a lot of files. I'd say I missed a patch or a dependency needs to be raised. |
Use cython/cython#5690 or set |
OK, |
Well, sage-on-gentoo builds and doctest fine with the patches here for the dependencies and sage itself. I had to export |
There seems to be an issue with sagemath-meataxe
Feels like something waiting to happen. Edit: Replacing the offending line with |
The cited commit only changes 314 files... |
Indeed, and my guilty file is in there. Well done. But that's still "only 314". |
The good news is that out of the optional packages I ship, this is the only that had an issue. |
Then let's push this one change here on the branch. |
Documentation preview for this PR (built with commit cb78fd9; changes) is ready! 🎉 |
Does anyone have more concerns here, or can we merge it? Various package upgrade PRs are waiting for it |
LGTM |
do we want to update on the latest develop branch? |
<!-- ^^^^^ 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 sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> NumPy 1.26 provides Python 3.12 support and Cython 3 compatibility. 1.26.0 was released 2023-09-16. As NumPy has changed its build system from setuptools-pinned-to-an- ancient-version to meson_python, we get rid of our ancient version of `setuptools`. The SPKGs `setuptools` and `setuptools_wheel` now ship the same (current) version. - [x] Check portability run: https://github.com/mkoeppe/sage/actions/runs/5959239800 - [ ] Check SAGE_FAT_BINARY <!-- 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 sagemath#12345". --> Resolves sagemath#34816 <!-- 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. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies - Depends on sagemath#36112 (for the `meson_python` upgrades, merged here) - Depends on sagemath#35404 (merged here as part of above) - Depends on sagemath#35810 (merged here as part of above) - Depends on sagemath#36110 (merged here) - Depends on sagemath#36263 (merged here) - Depends on sagemath#36238 (merged here) - Depends on sagemath#36255 (merged here) <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36123 Reported by: Matthias Köppe Reviewer(s):
<!-- ^^^^^ 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 --> NumPy 1.26 provides Python 3.12 support and Cython 3 compatibility. 1.26.0 was released 2023-09-16. As NumPy has changed its build system from setuptools-pinned-to-an- ancient-version to meson_python, we get rid of our ancient version of `setuptools`. The SPKGs `setuptools` and `setuptools_wheel` now ship the same (current) version. - [x] Check portability run: https://github.com/mkoeppe/sage/actions/runs/5959239800 - [ ] Check SAGE_FAT_BINARY <!-- 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". --> Resolves #34816 <!-- 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. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies - Depends on #36112 (for the `meson_python` upgrades, merged here) - Depends on #35404 (merged here as part of above) - Depends on #35810 (merged here as part of above) - Depends on #36110 (merged here) - Depends on #36263 (merged here) - Depends on #36238 (merged here) - Depends on #36255 (merged here) <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36123 Reported by: Matthias Köppe Reviewer(s):
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.
📝 Checklist
⌛ Dependencies