fix(migrations): follow torrent capability owner

This commit is contained in:
jxxghp
2026-08-29 21:39:36 +08:00
parent 93a8dca5e9
commit 387fd953df
2 changed files with 14 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ Create Date: 2025-02-14 19:02:24.989349
"""
from app.adapters.cache.backends import configure_platform_cache
from app.application.torrent import clear_torrent_cache
from app.application.torrent.download import clear_torrent_cache
# revision identifiers, used by Alembic.
revision = '279a949d81b6'

View File

@@ -381,12 +381,16 @@ def test_application_torrent_uses_same_named_single_word_package() -> None:
assert len(init_tree.body) == 1
root_imports: list[str] = []
for path in APP_ROOT.rglob("*.py"):
for root in (APP_ROOT, PROJECT_ROOT / "database"):
for path in root.rglob("*.py"):
if path.is_relative_to(APP_ROOT / "plugins"):
continue
tree = ast.parse(path.read_text(encoding="utf-8-sig"), filename=str(path))
for node in ast.walk(tree):
if isinstance(node, ast.ImportFrom) and node.module == "app.application.torrent":
if (
isinstance(node, ast.ImportFrom)
and node.module == "app.application.torrent"
):
root_imports.append(
f"{path.relative_to(PROJECT_ROOT).as_posix()}:{node.lineno}"
)