Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix qt backend on mac big sur#19334

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 3 commits intomatplotlib:masterfromericpre:fix_mac_big_sur_qt
Jan 29, 2021

Conversation

ericpre
Copy link
Member

PR Summary

The qt backend is not working on mac big sur as reported in#18954.
It is fixed in qt 5.15.2 (https://codereview.qt-project.org/c/qt/qtbase/+/322228) and in the coming 5.12.11 (https://codereview.qt-project.org/c/qt/qtbase/+/322507) but setting this environment variable is necessary for qt <5.15.2.

Even if in a ideal wordmatplotlib shouldn't be setting this variable environment, this is pragmatic and very convenient fix!

PR Checklist

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping@matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@jklymak
Copy link
Member

Seems reasonable.@dstansby you mentioned having Big Sur? (ahem, I suppose I should upgrade one of my machines one of these days, but...)

@tacaswell
Copy link
Member

On one hand, this seem to have only moderate down side, but if it is fixed in newer versions of (py?)Qt it seems to be a moot point?

@dstansby
Copy link
Member

I'm struggling to reproduce the original bug - I think it's worth discussing at#18954 (comment) before going further with this.

@dstansby
Copy link
Member

I can reproduce the original issue, and confirm that setting this environment variable fixes it.

@dstansby
Copy link
Member

I was wondering if this would break older versions of OSX/macos, but#18134 says QT5 requires > 10.13, andhttps://bugreports.qt.io/browse/QTBUG-87014 seems to say that setting this should be fine going back to 10.13, so this looks good to me.

@dstansby
Copy link
Member

Does anyone have thoughts on backporting this to 3.3.x? Seems reasonable to me.

@ericpre
Copy link
MemberAuthor

I was wondering if this would break older versions of OSX/macos, but#18134 says QT5 requires > 10.13, andhttps://bugreports.qt.io/browse/QTBUG-87014 seems to say that setting this should be fine going back to 10.13, so this looks good to me.

76e8260 adds an additional conditionLooseVersion(platform.mac_ver()[0]) >= LooseVersion("10.16"), so this should be fine in any case!

dstansby reacted with thumbs up emoji

# Fixes issues with Big Sur
# https://bugreports.qt.io/browse/QTBUG-87014, fixed in qt 5.15.2
if (sys.platform == 'darwin' and
LooseVersion(platform.mac_ver()[0]) >= LooseVersion("10.16") and
Copy link
MemberAuthor

@ericpreericpreJan 24, 2021
edited
Loading

Choose a reason for hiding this comment

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

I don't know if this should be a>= or== and I don't know if we can even know how is it going to be with the next MacOS release...

@tacaswell
Copy link
Member

The choices are:

  • strict equality it may break on the next verssion of OSX if this ends up being a required flag and we have to go through this again.
  • = and it breaks on the next version of OSX because Qt / OSX change to make this aharmful env

Qt/pyqt is generally pretty good about back-compatibility / not breaking users so if we are going to do this, the version filtering seems right.

My main hang up about this is still that libraries should probably not be setting envs (as that is users / application concerns).

@ericpre
Copy link
MemberAuthor

My main hang up about this is still that libraries should probably not be setting envs (as that is users / application concerns).

I agree that we shouldn't be doing this but in practise this is the best and less intrusive solution I know or I can think of. If theQT_MAC_WANTS_LAYER environment variable is already set, it will not be changed.
Another alternative would be to simply document it and let users find it on their own. I think that there are a non negligible numbers of users who don't know how to set variable environment (and are most likely not interested to figure it out) and they shouldn't have to do that, because there is no point in wasting time on this.

tacaswell reacted with thumbs up emoji

@tacaswelltacaswell merged commit3515d25 intomatplotlib:masterJan 29, 2021
@tacaswell
Copy link
Member

This is compelling argument. Thanks@ericpre !

The UI is a bit unclear, but it looks like this is your first PR to Matplotlib 🎉 . Congratulations and hopefully we hear from you again!

@ericpre
Copy link
MemberAuthor

Thanks everyone for the review!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell left review comments

@anntzeranntzeranntzer left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

5 participants
@ericpre@jklymak@tacaswell@dstansby@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp