Support for PyQt6/PySide6.#19255
Merged
QuLogic merged 11 commits intomatplotlib:masterfrom Aug 5, 2021
Merged
Conversation
46dbac2 to
ca3b175
Compare
25f5c9a to
f61c7d4
Compare
7 tasks
87c7795 to
237d660
Compare
Contributor
Author
|
Agreement was to switch to qtagg/qtcairo without version numbers (keeping qt5foo as aliases for backcompat). Will try to make it by next week to get it in 3.4 (but that's not urgent either). (GTK will be handled separately, may require a fully separate backend.) |
e04add6 to
e888368
Compare
Contributor
Author
|
This should be working now (although I'm not sure about how much needs to be done on IPython's side). Edit: hmm, CI is crashing but it's hard to see why :( |
7 tasks
Member
|
I'm working on this right now, this should be in mpl 3.5. |
Currently these must be selected via `QT_API=pyqt6`/`QT_API=pyside6`. Note that I didn't create a separate backend_qt6agg (and backend_qt6cairo, and mplcairo.qt6...) as it seems preferable to instead move towards a single backend_qtagg and allow selection of the actual qt binding via the orthogonal QT_API mechanism. Most of the work is just handling attributes that moved out of the Qt namespace.
Testing all qt bindings actually caught the fact that PySide makes the backend not thread-safe. Co-authored-by: Elliott Sales de Andrade <[email protected]>
Also, PyGObjects built on different Ubuntus are incompatible, so the cache should be keyed by matrix.os (which includes the version number), not runner.os (which doesn't).
We do not exercise all of the code paths that call _enum in the tests. At least PyQt5 5.8 does not support the enums by name so we still need the version gating.
Perfer to run with Qt6 if available
Just run with what ever version of PyQt we find.
Used to be parameterized, now just marked. There is no backend fixture.
Contributor
|
Thanks @tacaswell, that's really great! Do you have an estimate when 3.5 will be available? Edit: The milestone is due August 18, so I guess that's the plan. |
Member
|
@tacaswell: @anntzer's comment still needs fixing. |
If pyqt4 is imported the code just above will catch the problem and if pyqt4 is not imported we can rely on `plt.switch_backend` to handle the fallback between pyqt/pyside versions.
5 tasks
QuLogic
approved these changes
Aug 5, 2021
2 tasks
Closed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently these must be selected via
QT_API=pyqt6/QT_API=pyside6.Note that I didn't create a separate backend_qt6agg (and
backend_qt6cairo, and mplcairo.qt6...) as it seems preferable to instead
move towards a single backend_qtagg and allow selection of the actual qt
binding via the orthogonal QT_API mechanism.
Most of the work is just handling attributes that moved out of the Qt
namespace (but the new locations are also compatible with Qt5).
See https://www.riverbankcomputing.com/static/Docs/PyQt5/gotchas.html#enums
re: enum renames (sip 4.19.9 corresponds to PyQt5.13.1).
Just for those who want to play with this wrt #19226...
PR Summary
PR Checklist
pytestpasses).flake8on changed files to check).flake8-docstringsand runflake8 --docstring-convention=all).doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).