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: