Skip to content

ci: Enable testing on Python 3.13 #28689

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 3 commits into from
Aug 15, 2024
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 9, 2024

PR summary

It works locally mostly, but let's see how things go on CI.

PR checklist

@QuLogic QuLogic added Maintenance CI: testing CI configuration and testing labels Aug 9, 2024
@QuLogic
Copy link
Member Author

QuLogic commented Aug 9, 2024

Surprised that the only failures are a couple minor RMS differences on one platform only. I wonder if the contour-related tests are because we end up building contourpy from source and use some slightly different options than the release wheels somehow. We also end up building numpy from source as well. I might trying pull those from nightly temporarily.

@QuLogic QuLogic force-pushed the py313-tests branch 2 times, most recently from ccc9896 to f96b4f3 Compare August 9, 2024 04:12
@QuLogic
Copy link
Member Author

QuLogic commented Aug 9, 2024

Ah, I should have checked which tests first; those all have some increased tolerance on aarch64, so just added arm64 as well to catch Apple Silicon.

@QuLogic QuLogic force-pushed the py313-tests branch 2 times, most recently from 4f59013 to 55363b6 Compare August 9, 2024 05:21
@QuLogic QuLogic marked this pull request as ready for review August 9, 2024 05:51
@neutrinoceros
Copy link
Contributor

Surprised that the only failures are a couple minor RMS differences on one platform only.

Looks suprising at first given the documentation explicitly states that matplotlib isn't thread safe https://matplotlib.org/stable/users/faq.html#work-with-threads
... but if there are no tests exercising multi-threading, it is maybe not so surprising.

From my downstream point of view, it is still desirable that matplotlib be tested on 3.13t, even with no specific tests, but it will take more work to properly define which use cases are to be supported (thread-safe) and which are not.

To anyone this may interest, I recommend reading through https://py-free-threading.github.io/

@QuLogic
Copy link
Member Author

QuLogic commented Aug 9, 2024

Surprised that the only failures are a couple minor RMS differences on one platform only.

Looks suprising at first given the documentation explicitly states that matplotlib isn't thread safe https://matplotlib.org/stable/users/faq.html#work-with-threads ... but if there are no tests exercising multi-threading, it is maybe not so surprising.

Those were failures on 3.13, not 3.13t, so threads are unrelated.

@neutrinoceros
Copy link
Contributor

Ow. My bad ! I don't know why I thought matplotlib was already testing (regular) 3.13. Don't mind me 😅

@tacaswell
Copy link
Member

tacaswell commented Aug 15, 2024

What is not thread safe is updating the same figure from multiple threads (e.g. updating data in one and drawing in another) because, even with the GIL the methods are not atomic and artists can be in invalid states before the methods return.

However, because we do already drop the GIL in a bunch of places in the extension code we already have low-level locks on the non-Python global state (which is the main thing that the GIL could have been protecting you from because threads can switch after any byte code) so I expect that already-thread-safe usage we will continue to be safe with free threading.

@timhoffm timhoffm merged commit 7a2ea1c into matplotlib:main Aug 15, 2024
43 checks passed
@QuLogic QuLogic deleted the py313-tests branch August 15, 2024 19:11
@QuLogic

This comment was marked as duplicate.

@QuLogic
Copy link
Member Author

QuLogic commented Oct 2, 2024

@meeseeksdev backport to v3.9.x

Copy link

lumberbot-app bot commented Oct 2, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.9.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 7a2ea1cf0bd238785eb40d2e4b1713db65b79ede
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #28689: ci: Enable testing on Python 3.13'
  1. Push to a named branch:
git push YOURFORK v3.9.x:auto-backport-of-pr-28689-on-v3.9.x
  1. Create a PR against branch v3.9.x, I would have named this PR:

"Backport PR #28689 on branch v3.9.x (ci: Enable testing on Python 3.13)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@QuLogic QuLogic added this to the v3.9.3 milestone Oct 2, 2024
QuLogic added a commit that referenced this pull request Oct 8, 2024
…3.9.x

Backport PR #28689 on branch v3.9.x (ci: Enable testing on Python 3.13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants