Skip to content

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

Merged
blink1073 merged 9 commits into
ipython:mainfrom
ccordoba12:dont-raise-error-in-qt-loop
Jan 9, 2023
Merged

blink1073 merged 9 commits into
ipython:mainfrom
ccordoba12:dont-raise-error-in-qt-loop

Conversation

@ccordoba12

@ccordoba12 ccordoba12 commented Jan 3, 2023 •

Copy link
Copy Markdown
Member
  • 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
@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
ccordoba12 force-pushed the dont-raise-error-in-qt-loop branch from b77bf3e to 9bc06be Compare January 7, 2023 18:21
@ccordoba12

ccordoba12 commented Jan 7, 2023 •

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Contributor

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

blink1073 commented Jan 8, 2023 •

Copy link
Copy Markdown
Contributor

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

@ccordoba12

ccordoba12 commented Jan 8, 2023 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Contributor

Ugh, sorry about that.

@ccordoba12
ccordoba12 force-pushed the dont-raise-error-in-qt-loop branch from ec39463 to bf0aae3 Compare January 8, 2023 23:08
@ccordoba12

Copy link
Copy Markdown
Member Author

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

@ccordoba12
ccordoba12 force-pushed the dont-raise-error-in-qt-loop branch from bf0aae3 to 0f8e1bb Compare January 8, 2023 23:43
@ccordoba12

Copy link
Copy Markdown
Member Author

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

@blink1073

Copy link
Copy Markdown
Contributor

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

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Contributor

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

shaperilio commented Jan 9, 2023 •

Copy link
Copy Markdown
Contributor

Should we also remove Qt4 from ipython?

@ccordoba12

Copy link
Copy Markdown
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.

3 participants