diff --git a/airbyte-lib/airbyte_lib/progress.py b/airbyte-lib/airbyte_lib/progress.py index d1b7c5355fe1..14e1044801a0 100644 --- a/airbyte-lib/airbyte_lib/progress.py +++ b/airbyte-lib/airbyte_lib/progress.py @@ -5,6 +5,7 @@ import datetime import math +import sys import time from contextlib import suppress from typing import cast @@ -14,6 +15,8 @@ from rich.markdown import Markdown as RichMarkdown +IS_REPL = hasattr(sys, "ps1") # True if we're in a Python REPL, in which case we can use Rich. + try: IS_NOTEBOOK = True from IPython import display as ipy_display @@ -93,7 +96,7 @@ def __init__(self) -> None: self.last_update_time: float | None = None self.rich_view: RichLive | None = None - if not IS_NOTEBOOK: + if not IS_NOTEBOOK and not IS_REPL: # If we're in a terminal, use a Rich view to display the progress updates. self.rich_view = RichLive() try: