feat: support command python -m aerich (#417)

* feat: support command `python -m aerich`

* docs: update changelog
This commit is contained in:
Waket Zheng
2025-02-18 15:44:02 +08:00
committed by GitHub
parent 7f8c5dcddc
commit 557271c8e1
5 changed files with 23 additions and 12 deletions

View File

@@ -2,8 +2,6 @@ from __future__ import annotations
import os
import re
import shlex
import subprocess
import sys
from pathlib import Path
@@ -11,16 +9,7 @@ import pytest
from aerich.ddl.sqlite import SqliteDDL
from aerich.migrate import Migrate
from tests._utils import chdir, copy_files
def run_shell(command: str, capture_output=True, **kw) -> str:
r = subprocess.run(shlex.split(command), capture_output=capture_output)
if r.returncode != 0 and r.stderr:
return r.stderr.decode()
if not r.stdout:
return ""
return r.stdout.decode()
from tests._utils import chdir, copy_files, run_shell
@pytest.fixture