优化依赖管理配置,移除不必要的allowed_auto_install选项,更新文档以更清晰地描述自动安装功能的主开关。调整相关代码以简化逻辑,确保自动安装行为通过单一配置控制。

This commit is contained in:
minecraft1024a
2025-08-13 12:35:41 +08:00
parent 97351ce1ae
commit d78bf618f9
5 changed files with 7 additions and 24 deletions

View File

@@ -38,7 +38,6 @@ class DependencyManager:
self.proxy_url = config.proxy_url if proxy_url is None else proxy_url
self.install_timeout = config.install_timeout
self.pip_options = config.pip_options.copy()
self.allowed_auto_install = config.allowed_auto_install
except Exception as e:
logger.warning(f"无法加载依赖配置,使用默认设置: {e}")
@@ -47,7 +46,6 @@ class DependencyManager:
self.proxy_url = proxy_url
self.install_timeout = 300
self.pip_options = ["--no-warn-script-location", "--disable-pip-version-check"]
self.allowed_auto_install = True
def check_dependencies(self, dependencies: Any, plugin_name: str = "") -> Tuple[bool, List[str], List[str]]:
"""检查依赖包是否满足要求
@@ -98,7 +96,7 @@ class DependencyManager:
if not packages:
return True, []
if not self.auto_install or not self.allowed_auto_install:
if not self.auto_install:
logger.info(f"[Plugin:{plugin_name}] 自动安装已禁用,跳过安装: {packages}")
return False, packages