-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
pypy failures #19160
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
Comments
I don't have an easy way to check, but I guess the animation failures can be fixed by just adding a call to |
I don't know how to fix these animation warning tests, because adding
Clearly, the warning is happening, because it is printed out to stderr:
but it does not seem to get captures by Otherwise, I've managed to fixed all the other failures (except maybe Qt, since I couldn't install the deps). |
I think you need to call gc.collect() at least 3 times in a loop. NumPy has a
|
Thanks, that's even public too. However, it doesn't work, even calling it twice (so |
Or maybe the |
So I added a def test_animation_repr_html(writer, html, want, anim):
if (writer == 'imagemagick' and html == 'html5'
# ImageMagick delegates to ffmpeg for this format.
and not animation.FFMpegWriter.isAvailable()):
pytest.skip('Requires FFMpeg')
# create here rather than in the fixture otherwise we get __del__ warnings
# about producing no output
anim = animation.FuncAnimation(**anim)
with plt.rc_context({'animation.writer': writer,
'animation.html': html}):
html = anim._repr_html_()
if want is None:
assert html is None
import warnings
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
wranim = weakref.ref(anim)
del anim # Animation was never run, so will warn on cleanup.
print(wranim())
np.testing.break_cycles()
print(wranim())
assert len(w) == 1
assert issubclass(w[0], UserWarning)
else:
assert want in html and still no warnings are recorded, but are printed to stderr as an 'ignored Exception'. It seems that PyPy does not support capturing warnings emitted in |
The closest I can get is to mark the test with |
It might be best just to skip this test on PyPy so you don't spend too much time with it. As I understand it, the warning is meant to inform the user that the animation has never been run, which could be considered a bit of an edge case. PyPy does catch warnings in other cases. Just yesterday I added a single |
Too late; I spent yesterday whittling it down from tests, fixtures, and Matplotlib code to a small script: https://foss.heptapod.net/pypy/pypy/-/issues/3536 |
Going through the logs from @mattip 's logs in #19154 I think the failures we are seeing can be classified as below.
finalizer / weakrefs different in pypy
We probably should just detect and skip pypy on these.
pypy does not implement a working
sys.getsizeof
Skip this test on pypy, we are only using it to make sure that the output of rendering makes sense.
stack walking different?
The failures due to raising an unexpected warning are a bit more concerning. We are doing some frame walking / inspection to sort out if we should warn or not in
matplotlib/lib/matplotlib/backend_bases.py
Lines 1624 to 1665 in 09ab2c2
If someone who understands pypy can fix that to work on both that would be best, but if not we should detect if we are on pypy and fall back to never warning. It is operating in a slightly degraded mode (users may not get warnings they should see), but the status quo is going to warn for things the user can not do anything about (I think every time we use tightlayout of
bbox_inches='tight'
).This is probably the only failures I would hold 3.4 over.
segfaults in tk
We should either track this down or just skip the tests.
subprocess hung
We should either track this down or just skip the tests.
not matching numpy?
These both look like they are upstream bugs in pypy? We should probably just skip these.
checking refcounts
These tests do not make sense for pypy, we should skip them.
sockets not working
The comments around this suggest we never got this working on azure (which I assume is what is hosting GH actions) so we should sort out why the code to not run these tests in that case is not being triggered here.
The text was updated successfully, but these errors were encountered: