Fix PyPy wheels and tests by QuLogic · Pull Request #20848 · matplotlib/matplotlib · GitHub
Skip to content

Fix PyPy wheels and tests - #20848

Merged
tacaswell merged 8 commits into
matplotlib:masterfrom
QuLogic:pypy
Aug 19, 2021
Merged

Fix PyPy wheels and tests#20848
tacaswell merged 8 commits into
matplotlib:masterfrom
QuLogic:pypy

Conversation

@QuLogic

@QuLogic QuLogic commented Aug 17, 2021

Copy link
Copy Markdown
Member

PR Summary

Test build of wheels is here: https://github.com/QuLogic/matplotlib/actions/runs/1137857541
Fixes #20637.

This also fixes all tests except for the Animation cleanup ones, which may be a bug in PyPy.
Should we enable testing on PyPy in CI? Note, it is quite a bit slower for me, but I don't know how long it will take on CI.
Fixes #19160.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [n/a] Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@mattip

mattip commented Aug 17, 2021

Copy link
Copy Markdown
Contributor

@mattip

mattip commented Aug 17, 2021

Copy link
Copy Markdown
Contributor

Thanks!

@QuLogic

QuLogic commented Aug 18, 2021

Copy link
Copy Markdown
Member Author

PyPy does not correctly define `PyErr_SetFromWindowsErr`:
https://foss.heptapod.net/pypy/pypy/-/issues/3533
These tests look at reference counts of objects, which are meaningless
for PyPy (and also Jython).
PyPy adds an additional frame for `functools.wraps`, with `_functools`
as the name, which causes the code to decide we're no longer in
Matplotlib code too early, and not find `print_figure`. This causes
warnings about unexpected arguments.
Comment thread lib/matplotlib/patches.py Outdated

@anntzer anntzer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+/- comment on docstrings

In CPython, `inspect.getdoc` returns some default string for `__init__`,
but on PyPy, it returns None, when using `-OO`.

https://foss.heptapod.net/pypy/pypy/-/issues/3534
It does not support calls to Tkinter from different threads:
https://foss.heptapod.net/pypy/pypy/-/issues/1929
Some of these worked (by fluke?) in CPython, but didn't work in PyPy.
The NumPy function ensures GC is run enough times on PyPy to be really
cleared.
This is necessary to get the latest PyPy, which implements
`METH_FASTCALL`.
@tacaswell
tacaswell merged commit a4e81e7 into matplotlib:master Aug 19, 2021
@QuLogic
QuLogic deleted the pypy branch August 19, 2021 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyPy wheels are pinned to v3.3, so pypy-based wheels for latest versions are not available pypy failures

4 participants