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

Don't raise error when trying to create another Qt app for Qt eventloop #1071

Merged
merged 9 commits into from
Jan 9, 2023

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Jan 3, 2023

  • This is a follow-up PR that fixes the %matplotlib qt magic in Spyder.

  • Avoid raising RuntimeError('Kernel already running a Qt event loop.') in make_qt_app_for_kernel. This was the cause of the mentioned failure and it also generated an unnecessary traceback when trying to set another backend:

    imagen

    Instead, replace that raise with a return.

  • Remove the Qt4 eventloop because it's ancient and not supported anymore.

  • Restore loop_qt5 function (and make it equal to loop_qt) because it's been public API for years and we're using it in Spyder-kernels.

  • Avoid raising errors when calling set_qt_api_env_from_gui because they are not displayed to clients and instead use prints. Now you get this, for instance:

    imagen

  • Do some cleanup after PR ENH: add %gui support for Qt6 #1054.

ccordoba12 and others added 6 commits January 2, 2023 19:10
- This was making the `%matplotlib qt` fail in Spyder.
- It was also generating a long traceback when trying to set another
interactive backend (e.g. tk).
Use prints instead because these errors are not displayed to users but
contain valuable information for them.
@ccordoba12 ccordoba12 changed the title Don't raise error when trying to create another Qt app Don't raise error when trying to create another Qt app for Qt eventloop Jan 3, 2023
@blink1073 blink1073 added the bug label Jan 3, 2023
This avoids making that function run beyond the point where a certain
message is printed.
@ccordoba12
Copy link
Member Author

ccordoba12 commented Jan 7, 2023

@shaperilio,, this should be ready for review.

@blink1073, I think the failure in the ipyparallel test suite is unrelated to this. Also, please wait until I can run the Spyder tests with this PR before merging it (I'll give you a ping when I have the chance to do that).

@blink1073
Copy link
Member

I agree the ipyparallel failure is unrelated. I'll fix the check release failure separately, and will wait to hear from you before merging this one. Cheers!

@blink1073
Copy link
Member

blink1073 commented Jan 8, 2023

@ccordoba12, fyi I added a commit to fix merge conflicts picked up from #1073

@ccordoba12
Copy link
Member Author

ccordoba12 commented Jan 8, 2023

Thanks but your merge reverted some of the changes I made that fix the mentioned Spyder bug and improve other things. So, I need to drop it and do a merge that preserves what I did before.

@blink1073
Copy link
Member

Ugh, sorry about that.

@ccordoba12
Copy link
Member Author

No worries, I understand you wanted to check if everything was green here too after PR #1073.

@ccordoba12
Copy link
Member Author

@blink1073, I still don't understand the failure in IPyparallel, but the rest seems ok now.

@blink1073
Copy link
Member

I got the same ipyparallel error in #1073, I'm not sure what is going on there.

Copy link
Member

@blink1073 blink1073 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!

@blink1073 blink1073 merged commit a192ced into ipython:main Jan 9, 2023
@ccordoba12 ccordoba12 deleted the dont-raise-error-in-qt-loop branch January 9, 2023 15:15
@shaperilio
Copy link
Contributor

shaperilio commented Jan 9, 2023

Should we also remove Qt4 from ipython?

@ccordoba12
Copy link
Member Author

Yeah, I think that's a good idea. PyQt4 is really outdated and it doesn't have wheels for the most recent Python versions.

shaperilio added a commit to shaperilio/ipython that referenced this pull request Jan 9, 2023
See ipython/ipykernel#1071

Note that it's still there if coming from `matplotlib`
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.

None yet

3 participants