diff --git a/pyproject.toml b/pyproject.toml index d42f6be9..1c56edaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ "uvicorn[standard] >= 0.17.6", "rignore >= 0.5.1", "httpx >= 0.27.0", - "rich-toolkit >= 0.19.4", + "rich-toolkit >= 0.19.6", "pydantic[email] >= 2.7.4; python_version < '3.13'", "pydantic[email] >= 2.8.0; python_version == '3.13'", "pydantic[email] >= 2.12.0; python_version >= '3.14'", diff --git a/src/fastapi_cloud_cli/commands/deploy.py b/src/fastapi_cloud_cli/commands/deploy.py index 9cec7e82..3265d2c4 100644 --- a/src/fastapi_cloud_cli/commands/deploy.py +++ b/src/fastapi_cloud_cli/commands/deploy.py @@ -464,7 +464,10 @@ def _wait_for_deployment( with ( toolkit.progress( - next(messages), inline_logs=True, lines_to_show=20 + next(messages), + inline_logs=True, + lines_to_show=20, + done_emoji="🚀", ) as progress, APIClient() as client, ): @@ -476,6 +479,7 @@ def _wait_for_deployment( progress.log(Text.from_ansi(log.message.rstrip())) if log.type == "complete": + progress.title = "Build complete!" progress.log("") progress.log( f"You can also check the app logs at [link={deployment.dashboard_url}]{deployment.dashboard_url}[/link]" @@ -753,7 +757,9 @@ def deploy( archive(path or Path.cwd(), archive_path) with ( - toolkit.progress(title="Creating deployment") as progress, + toolkit.progress( + title="Creating deployment", done_emoji="📦" + ) as progress, handle_http_errors(progress), ): logger.debug("Creating deployment for app: %s", app.id) diff --git a/src/fastapi_cloud_cli/utils/cli.py b/src/fastapi_cloud_cli/utils/cli.py index 68e45182..06e5b82b 100644 --- a/src/fastapi_cloud_cli/utils/cli.py +++ b/src/fastapi_cloud_cli/utils/cli.py @@ -40,7 +40,7 @@ def _get_tag_segments( tag = emojis[self.animation_counter % len(emojis)] if done: - tag = emojis[-1] + tag = metadata.get("done_emoji", emojis[-1]) left_padding = self.tag_width - 1 left_padding = max(0, left_padding) diff --git a/tests/test_cli_deploy.py b/tests/test_cli_deploy.py index 79121d1c..bd58370b 100644 --- a/tests/test_cli_deploy.py +++ b/tests/test_cli_deploy.py @@ -2,7 +2,7 @@ import string from datetime import timedelta from pathlib import Path -from typing import Optional, TypedDict +from typing import TypedDict from unittest.mock import patch import httpx @@ -37,14 +37,14 @@ class RandomApp(TypedDict): slug: str id: str team_id: str - directory: Optional[str] + directory: str | None def _get_random_app( *, - slug: Optional[str] = None, - team_id: Optional[str] = None, - directory: Optional[str] = None, + slug: str | None = None, + team_id: str | None = None, + directory: str | None = None, ) -> RandomApp: name = "".join(random.choices(string.ascii_lowercase, k=10)) slug = slug or "".join(random.choices(string.ascii_lowercase, k=10)) @@ -62,7 +62,7 @@ def _get_random_app( def _get_random_deployment( *, - app_id: Optional[str] = None, + app_id: str | None = None, status: str = "waiting_upload", ) -> dict[str, str]: id = "".join(random.choices(string.digits, k=10)) @@ -1314,7 +1314,7 @@ def build_logs_handler(request: httpx.Request, route: respx.Route) -> Response: with changing_dir(tmp_path), patch("time.sleep"): result = runner.invoke(app, ["deploy"]) - assert "short wait message" in result.output + assert "Build complete!" in result.output @pytest.mark.respx @@ -1382,7 +1382,7 @@ def build_logs_handler(request: httpx.Request, route: respx.Route) -> Response: with changing_dir(tmp_path), patch("time.sleep"): result = runner.invoke(app, ["deploy"]) - assert "long wait message" in result.output + assert "Build complete!" in result.output @pytest.mark.respx diff --git a/uv.lock b/uv.lock index ac3f1dfd..054e14d1 100644 --- a/uv.lock +++ b/uv.lock @@ -258,7 +258,7 @@ requires-dist = [ { name = "pydantic", extras = ["email"], marker = "python_full_version < '3.13'", specifier = ">=2.7.4" }, { name = "pydantic", extras = ["email"], marker = "python_full_version == '3.13.*'", specifier = ">=2.8.0" }, { name = "pydantic", extras = ["email"], marker = "python_full_version >= '3.14'", specifier = ">=2.12.0" }, - { name = "rich-toolkit", specifier = ">=0.19.4" }, + { name = "rich-toolkit", specifier = ">=0.19.6" }, { name = "rignore", specifier = ">=0.5.1" }, { name = "sentry-sdk", specifier = ">=2.20.0" }, { name = "typer", specifier = ">=0.16.0" }, @@ -884,16 +884,16 @@ wheels = [ [[package]] name = "rich-toolkit" -version = "0.19.4" +version = "0.19.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, { name = "rich" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/d0/c9/4bbf4bfee195ed1b7d7a6733cc523ca61dbfb4a3e3c12ea090aaffd97597/rich_toolkit-0.19.4.tar.gz", hash = "sha256:52e23d56f9dc30d1343eb3b3f6f18764c313fbfea24e52e6a1d6069bec9c18eb", size = 193951, upload-time = "2026-02-12T10:08:15.814Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/1a/57df3ff9967d8d009e928b4b2136fdd0aed70b68f5e5467b8d61e0d5cff2/rich_toolkit-0.19.6.tar.gz", hash = "sha256:b730f02d6f319ababadb8dd6b89ff2a1dec8f5511fb7d5c23eae64d4cb5ee99d", size = 194589, upload-time = "2026-02-24T12:13:31.254Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/28/31/97d39719def09c134385bfcfbedfed255168b571e7beb3ad7765aae660ca/rich_toolkit-0.19.4-py3-none-any.whl", hash = "sha256:34ac344de8862801644be8b703e26becf44b047e687f208d7829e8f7cfc311d6", size = 32757, upload-time = "2026-02-12T10:08:15.037Z" }, + { url = "https://files.pythonhosted.org/packages/5a/78/369699f9bdbe0c1ee7b53b7673273d295666ea673b49897a28cc828c7d53/rich_toolkit-0.19.6-py3-none-any.whl", hash = "sha256:cff77090c0b28ff4f6e0178a59d57cf5615283593b96dc999ee7d8614b499201", size = 32753, upload-time = "2026-02-24T12:13:32.045Z" }, ] [[package]]