From 0cfc62005a8b85f1c308d39cd666a2a5c4f161e1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 31 Aug 2026 17:07:16 +0800 Subject: [PATCH] fix(ci): silence pylint false positives for lazy facades --- tests/test_agent_api_gateway.py | 1 + tests/test_agent_data_ports.py | 1 + tests/test_agent_task_runs.py | 1 + tests/test_agent_tool_policy.py | 1 + tests/test_agent_tool_result_policy.py | 1 + tests/test_rule_group_media.py | 1 + tests/test_web_agent_stream.py | 1 + 7 files changed, 7 insertions(+) diff --git a/tests/test_agent_api_gateway.py b/tests/test_agent_api_gateway.py index 308d20dbe..e281aa386 100644 --- a/tests/test_agent_api_gateway.py +++ b/tests/test_agent_api_gateway.py @@ -3,6 +3,7 @@ import json from types import SimpleNamespace from unittest.mock import AsyncMock, patch +# pylint: disable=no-name-in-module # 策略包根通过 __getattr__ 惰性导出,Pylint 无法静态解析。 from app.agent.policy import ( DEFAULT_TOOL_POLICY_REGISTRY, ActionEffect, diff --git a/tests/test_agent_data_ports.py b/tests/test_agent_data_ports.py index 439c48c6d..6629d3b3b 100644 --- a/tests/test_agent_data_ports.py +++ b/tests/test_agent_data_ports.py @@ -19,6 +19,7 @@ from app.application.agenttask import AgentTaskRepository, AgentTaskSnapshot from app.application.filtering import FilterRuleService from app.db.adapters.agent import TransactionalAgentTaskRepository from app.db.session import SessionFactory +# pylint: disable=no-name-in-module # Scheduler 由惰性稳定入口导出,Pylint 无法静态解析。 from app.scheduler import Scheduler from app.schemas.rule import CustomRule from app.schemas.system import FilterRuleGroup diff --git a/tests/test_agent_task_runs.py b/tests/test_agent_task_runs.py index d9a48daa1..9b3b5124b 100644 --- a/tests/test_agent_task_runs.py +++ b/tests/test_agent_task_runs.py @@ -8,6 +8,7 @@ import pytest from sqlalchemy import event from sqlalchemy.exc import IntegrityError +# pylint: disable=no-name-in-module # 旧公开入口由 runtime compat 惰性注入,Pylint 无法静态解析。 from app.agent.orchestrator import AgentManager from app.agent.tools.impl.agent_task import AgentTaskTool from app.db import base as db_base diff --git a/tests/test_agent_tool_policy.py b/tests/test_agent_tool_policy.py index 44cdd849d..6738ee952 100644 --- a/tests/test_agent_tool_policy.py +++ b/tests/test_agent_tool_policy.py @@ -12,6 +12,7 @@ from app.agent.middleware.activity import ActivityLogMiddleware from app.agent.middleware.memory import MemoryMiddleware from app.agent.middleware.policy import AgentPolicyMiddleware from app.agent.middleware.summarization import FinalRequestCompactionMiddleware +# pylint: disable=no-name-in-module # 策略包根通过 __getattr__ 惰性导出,Pylint 无法静态解析。 from app.agent.policy import ( DEFAULT_TOOL_POLICY_ORCHESTRATOR, DEFAULT_TOOL_POLICY_REGISTRY, diff --git a/tests/test_agent_tool_result_policy.py b/tests/test_agent_tool_result_policy.py index 6d64d0014..9a4eccc17 100644 --- a/tests/test_agent_tool_result_policy.py +++ b/tests/test_agent_tool_result_policy.py @@ -20,6 +20,7 @@ from pydantic.dataclasses import dataclass as pydantic_dataclass from pydantic_core import PydanticCustomError import app.agent.policy.sanitizer as sanitizer_module +# pylint: disable=no-name-in-module # 策略包根通过 __getattr__ 惰性导出,Pylint 无法静态解析。 from app.agent.policy import sanitize_for_host, summarize_error, summarize_input, summarize_result from app.agent.tools.base import MoviePilotTool, serialize_tool_result_for_agent from app.agent.tools.manager import MoviePilotToolsManager diff --git a/tests/test_rule_group_media.py b/tests/test_rule_group_media.py index 12ebc8f20..24271ddb7 100644 --- a/tests/test_rule_group_media.py +++ b/tests/test_rule_group_media.py @@ -3,6 +3,7 @@ from unittest.mock import MagicMock from app.application.filtering import normalize_media_type from app.application.rules import RuleHelper +# pylint: disable=no-name-in-module # SubscribeChain 由惰性稳定入口导出,Pylint 无法静态解析。 from app.chain.subscribe import SubscribeChain from app.domain.context import MediaInfo, MusicInfo, TorrentInfo from app.modules.filter import FilterModule diff --git a/tests/test_web_agent_stream.py b/tests/test_web_agent_stream.py index 9cd8e6ab5..d7d9c30ce 100644 --- a/tests/test_web_agent_stream.py +++ b/tests/test_web_agent_stream.py @@ -9,6 +9,7 @@ import pytest from app import schemas from app.agent.contracts import ReplyMode +# pylint: disable=no-name-in-module # 旧公开入口由 runtime compat 惰性注入,Pylint 无法静态解析。 from app.agent.orchestrator import agent_manager from app.agent.web import _get_web_agent_type from app.api.endpoints import agent as agent_endpoint