Skip to content

Many doctest failures on cython 3.0.9 #37560

@tornaria

Description

@tornaria
----------------------------------------------------------------------
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/misc/cachefunc.pyx  # 2 doctests failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/structure/element.pyx  # 7 doctests failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/graphs/connectivity.pyx  # 2 doctests failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/arith/long.pxd  # 1 doctest failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/cpython/wrapperdescr.pxd  # 1 doctest failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/cpython/string.pyx  # 1 doctest failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/misc/cython.py  # 5 doctests failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/misc/lazy_attribute.pyx  # 1 doctest failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/rings/integer_fake.pxd  # 1 doctest failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/rings/polynomial/ore_polynomial_element.pyx  # 2 doctests failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/rings/tate_algebra_ideal.pyx  # 2 doctests failed
sage -t --long --warn-long 30.0 --random-seed=7454820187505788292272581090812315571 sage/symbolic/pynac.pxi  # 1 doctest failed
----------------------------------------------------------------------

They all seem to be caused by

* Using ``noexcept`` on a function returning Python objects now issues a warning.
  (Github issue :issue:`5661`)

cython/cython#5661

Here's a standalone reproducer:

sage: cython('from sage.structure.parent cimport Parent')
warning: /usr/lib/python3.12/site-packages/sage/structure/category_object.pxd:13:28: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/category_object.pxd:24:30: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/category_object.pxd:26:21: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/coerce_dict.pxd:22:12: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/coerce_dict.pxd:48:12: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:26:27: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:27:25: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:28:29: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:29:28: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:40:25: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:41:35: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:42:27: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:45:26: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:46:36: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:47:28: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:48:27: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:52:20: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:53:22: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:56:16: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:58:20: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:62:30: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:63:29: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:64:33: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:65:34: noexcept clause is ignored for function returning Python object
warning: /usr/lib/python3.12/site-packages/sage/structure/parent.pxd:66:24: noexcept clause is ignored for function returning Python object

I will take a more careful look and make a PR. It might take me a few days.

@vbraun Can we block 10.3 until this is fixed?

@mkoeppe presumably the fix is to remove all the incorrect noexcept clauses, which should be easy and very low-risk. But if you want/can fix this with a one liner that just hides the warning, that also seems ok for the release (in the long term better to fix it since they are talking of turning it into an error in 3.1).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions