Skip to content

Commit 35c3c2d

Browse files
cursoragentfreider
authored andcommitted
Move RichOutputManager to separate module to avoid rich imports
This change: - Creates _rich_output.py with all rich-dependent code (RichOutputManager, ProgressHandler, get_app_logs_loop, etc.) - Keeps _output.py with just the interface, DisabledOutputManager, and StatusRow - Updates output.py to cache the output manager at module level instead of using a singleton on the class - Updates all imports to use _rich_output.py for make_console, ProgressHandler, and RichOutputManager - Adds _disable_output_manager() to allow PTY mode to disable output, ensuring "App completed" message is not printed after PTY mode ends This allows code to avoid importing rich when output is disabled, as the rich library is only imported when RichOutputManager is actually needed.
1 parent 25eacb7 commit 35c3c2d

23 files changed

Lines changed: 787 additions & 778 deletions

modal/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright Modal Labs 2022
22
import sys
33

4-
from ._output import make_console
4+
from ._rich_output import make_console
55
from ._traceback import reduce_traceback_to_user_code
66
from .cli._traceback import highlight_modal_warnings, setup_rich_traceback
77
from .cli.entry_point import entrypoint_cli

0 commit comments

Comments
 (0)