diff --git a/CHANGELOG.D/1911.bugfix b/CHANGELOG.D/1911.bugfix new file mode 100644 index 000000000..06e81a172 --- /dev/null +++ b/CHANGELOG.D/1911.bugfix @@ -0,0 +1 @@ +Fix unstable imports of `rich` tool. diff --git a/neuro-cli/src/neuro_cli/log_formatter.py b/neuro-cli/src/neuro_cli/log_formatter.py index 82d48dd46..95b514914 100644 --- a/neuro-cli/src/neuro_cli/log_formatter.py +++ b/neuro-cli/src/neuro_cli/log_formatter.py @@ -1,13 +1,13 @@ import logging import sys -import rich +from rich.console import Console class ConsoleHandler(logging.Handler): def __init__(self, color: bool) -> None: logging.Handler.__init__(self) - self.console = rich.console.Console( + self.console = Console( file=sys.stderr, color_system="auto" if color else None, highlight=False, @@ -30,7 +30,7 @@ def emit(self, record: logging.LogRecord) -> None: except Exception: # pragma: no cover self.handleError(record) - def setConsole(self, console: rich.console.Console) -> None: + def setConsole(self, console: Console) -> None: if console is not self.console: self.acquire() try: