[WIP] Add an advertise_debugger option so kernel_info need not import debugpy - #1545
Draft
Carreau wants to merge 1 commit into
Draft
[WIP] Add an advertise_debugger option so kernel_info need not import debugpy#1545Carreau wants to merge 1 commit into
Carreau wants to merge 1 commit into
Conversation
Deferring the debugger construction does not on its own keep debugpy out of a kernel: `kernel_info` imports `.debugger` to fill in `supported_features`, and every frontend sends a kernel_info_request at startup -- jupyter_client's `wait_for_ready` re-sends it until it gets a reply, on start and on every restart. Left alone, the import is merely moved from initialisation into the first shell request. Add an `advertise_debugger` trait, auto|true|false, defaulting to auto so nothing changes by default. "auto" asks the debugger module as before; "true" and "false" answer kernel_info without importing anything, which lets a deployment that already knows whether debugpy is available keep it out of the process entirely. The option only controls what is advertised: setting it to "true" where debugpy is unavailable does not make debug requests work.
Member
Author
|
Alternative is caching on disk the environemnt, package version... etc, or just using find_spec to know wether debugpy is installed without actually loading it. I'm happy leaving on auto for most deployments and leaving this as a tunable value for large deployments even if i would like to have it fast for everybody. |
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.
Deferring the debugger construction does not on its own keep debugpy out of a kernel:
kernel_infoimports.debuggerto fill insupported_features, and every frontend sends a kernel_info_request at startup -- jupyter_client'swait_for_readyre-sends it until it gets a reply, on start and on every restart. Left alone, the import is merely moved from initialisation into the first shell request.Add an
advertise_debuggertrait, auto|true|false, defaulting to auto so nothing changes by default. "auto" asks the debugger module as before; "true" and "false" answer kernel_info without importing anything, which lets a deployment that already knows whether debugpy is available keep it out of the process entirely.The option only controls what is advertised: setting it to "true" where debugpy is unavailable does not make debug requests work.
We can also do Bool with allow_none=True, I don't care much, this look more explicit. Just for discussion for now.