Skip to content
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

Add testing on PyPy #24944

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add testing on PyPy #24944

wants to merge 1 commit into from

Conversation

oscargus
Copy link
Contributor

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@oscargus oscargus added this to the v3.8.0 milestone Jan 11, 2023
@oscargus oscargus force-pushed the pypytests branch 3 times, most recently from 71ffb24 to fba4aeb Compare January 12, 2023 12:17
@oscargus
Copy link
Contributor Author

oscargus commented Jan 12, 2023

Disabling all pyqt/pyside-installs made the tests execute. This is the outcome:

FAILED lib/matplotlib/tests/test_mathtext.py::test_mathtext_rendering[pdf-mathtext-stixsans-62] - UserWarning: Glyph 19 (�) missing from current font.
FAILED lib/matplotlib/tests/test_image.py::test_large_image[png-col-16777216-2\\*\\*24 rows-upper] - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
The list of emitted warnings is: [].
FAILED lib/matplotlib/tests/test_image.py::test_large_image[png-col-16777216-2\\*\\*24 rows-lower] - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
The list of emitted warnings is: [].
FAILED lib/matplotlib/tests/test_pickle.py::test_simple - AssertionError
FAILED lib/matplotlib/tests/test_pickle.py::test_complete[png] - AssertionError
FAILED lib/matplotlib/tests/test_pickle.py::test_pickle_load_from_subprocess[png] - AssertionError
FAILED lib/matplotlib/tests/test_pickle.py::test_no_pyplot - AssertionError
FAILED lib/matplotlib/tests/test_tightlayout.py::test_tight_layout6[pdf] - UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
FAILED lib/matplotlib/tests/test_text.py::test_unsupported_script - AssertionError: assert [('Glyph 2534... natively.',)] == [('Glyph 2534... natively.',)]
  Left contains 2 more items, first extra item: ('Glyph 2534 (\\N{BENGALI DIGIT ZERO}) missing from current font.',)
  Full diff:
    [
     ('Glyph 2534 (\\N{BENGALI DIGIT ZERO}) missing from current font.',),
     ('Matplotlib currently does not support Bengali natively.',),
  +  ('Glyph 2534 (\\N{BENGALI DIGIT ZERO}) missing from current font.',),
  +  ('Matplotlib currently does not support Bengali natively.',),
    ]
FAILED lib/matplotlib/tests/test_widgets.py::test_check_radio_buttons_image[png] - matplotlib.testing.exceptions.ImageComparisonFailure: images not close (RMS 1.179):
	result_images/test_widgets/check_radio_buttons.png
	result_images/test_widgets/check_radio_buttons-expected.png
	result_images/test_widgets/check_radio_buttons-failed-diff.png
FAILED lib/matplotlib/tests/test_widgets.py::test_radio_buttons[png] - matplotlib.testing.exceptions.ImageComparisonFailure: images not close (RMS 0.610):
	result_images/test_widgets/test_radio_buttons[png].png
	result_images/test_widgets/test_radio_buttons[png]-expected.png
	result_images/test_widgets/test_radio_buttons[png]-failed-diff.png
FAILED lib/matplotlib/tests/test_widgets.py::test_check_buttons[png] - matplotlib.testing.exceptions.ImageComparisonFailure: images not close (RMS 0.573):
	result_images/test_widgets/test_check_buttons[png].png
	result_images/test_widgets/test_check_buttons[png]-expected.png
	result_images/test_widgets/test_check_buttons[png]-failed-diff.png
FAILED lib/matplotlib/tests/test_widgets.py::test_check_buttons_lines[png] - matplotlib.testing.exceptions.ImageComparisonFailure: images not close (RMS 2.085):
	result_images/test_widgets/test_check_buttons_lines[png].png
	result_images/test_widgets/test_check_buttons_lines[png]-expected.png
	result_images/test_widgets/test_check_buttons_lines[png]-failed-diff.png

I do not really know how to proceed, but can be worth keeping as a reference. (Adding a tolerance to the widget image tests is of course easy, but apart from that...)

Edit: as a reminder platform.python_implementation() == "PyPy" is the way to check for PyPy.

@oscargus
Copy link
Contributor Author

Oh, and it is really slow running the tests...

@tacaswell
Copy link
Member

Oh, and it is really slow running the tests...

We may not have enough hot loops and/or run enough code only once that we never "make back" the cost of jitting (or even trigger the jitting)?

@oscargus
Copy link
Contributor Author

That may indeed be the case. I guess that one, once the tests are passing, can move this to the infamous weekly tests with all the extras (that never seems to happen, I'm not really talking about the weekly nightly test, although it may be related) as it can be nice to know that mpl works correctly with PyPy (if nothing else as we provide wheels).

@oscargus oscargus marked this pull request as draft January 21, 2023 04:34
@ksunden ksunden modified the milestones: v3.8.0, v3.9.0 Aug 8, 2023
@oscargus oscargus modified the milestones: v3.9.0, v3.10.0 Apr 15, 2024
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.

None yet

3 participants