From 7f992490b1d112bb638e46c5d7d35cfe3d591443 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Fri, 22 May 2026 17:44:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dmigrate=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iticli/cli.py | 2 +- tests/test_cli.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/iticli/cli.py b/iticli/cli.py index 6505a53..9729369 100644 --- a/iticli/cli.py +++ b/iticli/cli.py @@ -478,7 +478,7 @@ def extract_message(rest: list[str]) -> str | None: def alembic_base_cmd(ctx: ProjectContext) -> list[str]: - cmd = ["uv", "run", "alembic"] + cmd = ["uv", "run", "python", "-m", "alembic"] if ctx.kind == "business": cmd.extend(["-c", "migrations/alembic.ini"]) return cmd diff --git a/tests/test_cli.py b/tests/test_cli.py index fabfe05..61a3138 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -124,13 +124,21 @@ def test_find_optional_extra_prefers_project_extra_name() -> None: def test_business_alembic_uses_template_config(tmp_path: Path) -> None: ctx = ProjectContext(tmp_path, "business", {}, False) - assert alembic_base_cmd(ctx) == ["uv", "run", "alembic", "-c", "migrations/alembic.ini"] + assert alembic_base_cmd(ctx) == [ + "uv", + "run", + "python", + "-m", + "alembic", + "-c", + "migrations/alembic.ini", + ] def test_framework_alembic_uses_default_config(tmp_path: Path) -> None: ctx = ProjectContext(tmp_path, "framework", {}, False) - assert alembic_base_cmd(ctx) == ["uv", "run", "alembic"] + assert alembic_base_cmd(ctx) == ["uv", "run", "python", "-m", "alembic"] def test_parse_run_args_accepts_env_and_port() -> None: