mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-01 04:39:01 +02:00
feat(cli): add remote build support for langgraph deploy (#7234)
**Description:** - extend host_backend client with remote build support - refactored `cli.py` for better clarity - update tests
This commit is contained in:
@@ -18,6 +18,9 @@ class Progress:
|
||||
self._show_elapsed = elapsed
|
||||
# use this to make sure we don't kill thread when we set msg to ""
|
||||
self._stop = threading.Event()
|
||||
# signalled when the spinner has no text on screen
|
||||
self._line_clear = threading.Event()
|
||||
self._line_clear.set()
|
||||
self.spinner_generator = self.spinning_cursor()
|
||||
|
||||
def spinner_iteration(self):
|
||||
@@ -43,13 +46,16 @@ class Progress:
|
||||
start = time.monotonic()
|
||||
while not self._stop.is_set():
|
||||
if not self.message:
|
||||
self._line_clear.set()
|
||||
time.sleep(self.delay)
|
||||
continue
|
||||
if self._show_elapsed:
|
||||
self.message = self._format_elapsed(time.monotonic() - start)
|
||||
message = self.message
|
||||
if not message:
|
||||
self._line_clear.set()
|
||||
continue
|
||||
self._line_clear.clear()
|
||||
sys.stdout.write(next(self.spinner_generator) + " " + message)
|
||||
sys.stdout.flush()
|
||||
time.sleep(self.delay)
|
||||
@@ -60,6 +66,7 @@ class Progress:
|
||||
+ "\b" * (len(message) + 2)
|
||||
)
|
||||
sys.stdout.flush()
|
||||
self._line_clear.set()
|
||||
|
||||
def __enter__(self) -> Callable[[str], None]:
|
||||
if sys.stdout.isatty():
|
||||
@@ -69,6 +76,8 @@ class Progress:
|
||||
def set_message(message):
|
||||
self.message = message
|
||||
self._base_message = message or self._base_message
|
||||
if not message:
|
||||
self._line_clear.wait(timeout=0.5)
|
||||
|
||||
return set_message
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user