Skip to content

Commit 5c38acd

Browse files
committed
src/sage/doctest/parsing.py: ignore a transient pythran warning
Some numpy.random signatures changed in numpy-1.25.x, and pythran normally wants to warn about those. It's not clear, however, whether or not the numpy changes will be reverted. Until we know, pythran-0.14.0 has a special case to ignore the warnings for numpy.random. Here we ignore those warnings in the doctest parser as well, allowing older versions of pythran to be used with numpy-1.25.x.
1 parent 4103129 commit 5c38acd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sage/doctest/parsing.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,17 @@ def do_fixup(self, want, got):
16311631
got = ld_pie_warning_regex.sub('', got)
16321632
did_fixup = True
16331633

1634+
if "Overriding pythran description" in got:
1635+
# Some signatures changed in numpy-1.25.x that may yet be
1636+
# reverted, but which pythran would otherwise warn about.
1637+
# Pythran has a special case for numpy.random that hides
1638+
# the warning -- I guess until we know if the changes will
1639+
# be reverted -- but only in v0.14.0 of pythran. Ignoring
1640+
# This warning allows us to support older pythran with e.g.
1641+
# numpy-1.25.2.
1642+
pythran_numpy_warning_regex = re.compile(r'WARNING: Overriding pythran description with argspec information for: numpy\.random\.[a-z_]+')
1643+
got = pythran_numpy_warning_regex.sub('', got)
1644+
did_fixup = True
16341645
return did_fixup, want, got
16351646

16361647
def output_difference(self, example, got, optionflags):

0 commit comments

Comments
 (0)