Skip to content

Commit 663a243

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: move deferred Markdown import to top-level with other Rich imports
The `from rich.markdown import Markdown` import was deferred inside a nested closure in `_on_iteration_ended`, the only lazy module-level import in the file. All other Rich components are imported at the top. Moving it there makes the import surface consistent and predictable. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 472cf7c commit 663a243

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ralphify/_console_emitter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from rich.console import Console, ConsoleOptions, Group, RenderResult
2121
from rich.live import Live
2222
from rich.markup import escape as escape_markup
23+
from rich.markdown import Markdown
2324
from rich.panel import Panel
2425
from rich.rule import Rule
2526
from rich.spinner import Spinner
@@ -1539,8 +1540,6 @@ def do_print() -> None:
15391540
f" [dim]{_ICON_ARROW} {escape_markup(log_file)}[/]"
15401541
)
15411542
if result_text:
1542-
from rich.markdown import Markdown
1543-
15441543
self._console.print(Markdown(result_text))
15451544

15461545
self._print_or_defer_unlocked(do_print)

0 commit comments

Comments
 (0)