From 75999fc747f01835e1aaf4cbea972f3464d3fd85 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Thu, 27 Feb 2025 11:46:46 +0800 Subject: [PATCH] update Signed-off-by: Future-Outlier --- flytekit/clis/sdk_in_container/serve.py | 6 +++++- pyproject.toml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/flytekit/clis/sdk_in_container/serve.py b/flytekit/clis/sdk_in_container/serve.py index c0e16a78ef..da9bddbf4c 100644 --- a/flytekit/clis/sdk_in_container/serve.py +++ b/flytekit/clis/sdk_in_container/serve.py @@ -68,7 +68,11 @@ def agent(_: click.Context, port, prometheus_port, worker, timeout, modules): """ import asyncio - from flytekit.extras.webhook import WebhookTask # noqa: F401 + try: + from flytekit.extras.webhook import WebhookTask # noqa: F401 + except ImportError: + from flytekit import logger + logger.debug("Webhook is not installed. Please install it using `pip install flytekit[agent]`") working_dir = os.getcwd() if all(os.path.realpath(path) != working_dir for path in sys.path): diff --git a/pyproject.toml b/pyproject.toml index 55184c1c36..30440885cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,3 +147,8 @@ extend-exclude = ["tests/", "**/tests/**"] [tool.codespell] ignore-words-list = "ot,te,raison,fo,lits,assertIn" skip = "./docs/build,./.git,*.txt" + +[project.optional-dependencies] +agent = [ + "httpx", +]