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

Add option for enable gui event loop when not using matplotlib #787

Closed

Conversation

chubei-oppen
Copy link
Contributor

Closes #782

@ghost
Copy link

ghost commented Nov 18, 2021

CLA assistant check
All CLA requirements met.

@int19h int19h requested a review from fabioz November 18, 2021 21:54
@@ -61,6 +63,9 @@ def update_fom_debug_options(self, debug_options):

# Note: _max_exception_stack_frames cannot be set by debug options.

if 'ENABLE_GUI_EVENT_LOOP' in debug_options:
self.enable_gui_event_loop = debug_options.get('ENABLE_GUI_EVENT_LOOP')

Copy link
Contributor

Choose a reason for hiding this comment

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

This bit shouldn't be necessary - debugOptions is a legacy property for boolean flags in debug config that we had before deciding to just use separate boolean properties; it is really only kept for backwards compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was wondering what those optoins are for... Removed in f07013d

@fabioz
Copy link
Collaborator

fabioz commented Nov 19, 2021

@chubei-oppen I was thinking that in the current way, to get it to work users would need to do additional work (to call something as: pydevd_ipython.inputhook.enable_gui('qt5') or pydevd_ipython.inputhook.set_inputhook(callback)) and if matplotlib is indeed imported afterwards it'd override that value...

So, what do you think about making guiEventLoop a string and if it matches matplotlib (default), nothing would change, otherwise one of the gui constants in pydevd_ipython.inputhook would be expected, then it'd call pydevd_ipython.inputhook.enable_gui with that constant, but if it still doesn't match it'd be expected to map to a callable which could be then be imported/set in pydevd_ipython.inputhook.set_inputhook.

Does that make sense?

Also, note that if that setting is not matplotlib, init_matplotlib_support should be a no-op (so that we don't have the override issue).

@chubei-oppen
Copy link
Contributor Author

@fabioz Sounds good. I'll find time later for the implementaion.

@chubei-oppen
Copy link
Contributor Author

@fabioz I force pushed the new implementation.

@sonarcloud
Copy link

sonarcloud bot commented Nov 23, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@fabioz
Copy link
Collaborator

fabioz commented Nov 27, 2021

It seems good to me, but I want to do some additional manual testing before merging (I'm finishing another issue related to gevent and as soon as I finish that I'll do the final checks/integrate this pull request, sorry for the delay here...)

@fabioz
Copy link
Collaborator

fabioz commented Dec 3, 2021

Closing in favor of #800 (which includes the changes here and has some additional fixes/tests on top of it).

@fabioz fabioz closed this Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable gui event loop to run when a breakpoint is hit even if not using matplotlib
3 participants