Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix PyPy wheels and tests #20848

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

Merged
merged 8 commits into from
Aug 19, 2021
Merged

Fix PyPy wheels and tests #20848

merged 8 commits into from
Aug 19, 2021

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 17, 2021

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
Copy link
Contributor

mattip commented Aug 17, 2021

Note, it is quite a bit slower for me

Unfortunately that is to be expected. Test suites are typically 2x slower on PyPy since the JIT does not really kick in on small code samples, and the base interpreter is about 2x slower than CPython

@mattip
Copy link
Contributor

mattip commented Aug 17, 2021

Thanks!

@QuLogic
Copy link
Member Author

QuLogic commented Aug 18, 2021

This now works around the last failures; if we want to enable PyPy testing (maybe scheduled instead of on every build?), we can.

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.
lib/matplotlib/patches.py Outdated Show resolved Hide resolved
Copy link
Contributor

@anntzer anntzer left a comment

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.