From f3c2dda9f21ebd0d15a368194c252b20d6f133ff Mon Sep 17 00:00:00 2001 From: Alpamys Date: Fri, 3 Apr 2026 13:02:20 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20Python=203.9=20compat=20=E2=80=94=20repl?= =?UTF-8?q?ace=20str=20|=20None=20with=20Optional[str]=20in=20serve.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `str | None` union syntax at module level requires Python 3.10+. serve.py cannot use `from __future__ import annotations` because it defines Pydantic models inside functions (FastAPI needs runtime types). --- soup_cli/commands/serve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soup_cli/commands/serve.py b/soup_cli/commands/serve.py index 85fcfbe..401a8f7 100644 --- a/soup_cli/commands/serve.py +++ b/soup_cli/commands/serve.py @@ -24,7 +24,7 @@ def _validate_adapter_name(name: str) -> bool: return bool(re.match(r'^[a-zA-Z0-9][a-zA-Z0-9\-]*$', name)) -def _validate_adapter_path(path: str, cwd: str | None = None) -> bool: +def _validate_adapter_path(path: str, cwd: Optional[str] = None) -> bool: """Validate adapter path: must exist and stay under cwd.""" if cwd is None: cwd = str(Path.cwd())