Conversation
- Introduced a decorator `register_magic` to facilitate the registration of magic classes. - Implemented a magic class registry to manage registered magic commands. - Enhanced `CodeExecutor` to automatically discover and register magic commands from modules in the `magics` package. - Updated existing magic classes (e.g., DebugMagic, HandleMagic, HelpMagic, etc.) to use the new registration mechanism. - Improved error handling during module import and registration processes. - Added fallback behavior in `DebugConsole` for cases where `CodeExecutor` initialization fails.
- Refactored DebugMagic to consolidate remote debugging and tracing functionalities under a unified command structure. - Introduced subcommands for debugging: `remote`, `status`, and `help`, along with detailed usage instructions. - Added trace commands with subcommands for starting, stopping, and showing currently traced functions. - Implemented argument parsing for commands and improved error handling. - Removed deprecated HandleMagic and TraceMagic modules to streamline the codebase.
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.
This pull request introduces a registry system and auto-discovery for IPython magic commands, refactors the
DebugMagicclass to provide unified and user-friendly magic commands for debugging and function tracing, and improves error handling and robustness in the console and magic command registration. The most significant changes are the introduction of a magic class registry, automatic registration of magic commands, and a major overhaul of theDebugMagiccommand interface.Magic command registry and auto-discovery:
register_magic) and utility functions for registering, listing, and unregistering magics inpython/probing/magics/__init__.py. This allows magic commands to be auto-discovered and registered without manual imports.DebugMagic command refactor and enhancements:
DebugMagicto use unified%debugand%tracecommands with subcommands (e.g.,%debug remote,%trace start), improved help messages, argument parsing, and added a cell magic%%probefor code execution with tracing. This makes the interface more consistent and easier to use.Robustness and error handling improvements:
DebugConsoleclass to allow fallback operation if the code executor fails to initialize, and added fallback execution logic in thepushmethod. [1] [2]Remote debugging utilities:
DebugMagic, including improved status reporting, installation, and activation ofdebugpy, with clearer output and error messages. [1] [2] [3] [4]These changes significantly improve the extensibility, usability, and reliability of the magic command system for probing and debugging in the project.