Fix plugin dependency index resolution (#1271)

This commit is contained in:
Wu Clan
2026-10-11 10:31:18 +08:00
committed by GitHub
parent 8ea214c28e
commit e90b6f266c
+6 -2
View File
@@ -89,13 +89,17 @@ def install_requirements(plugin: str | None) -> None: # ruff:ignore[complex-str
if not _is_in_virtualenv():
pip_install.append('--system')
if settings.PLUGIN_PIP_CHINA:
# 将国内源作为优先索引,同时保留 PyPI 作为回退来源
# 使用 PyPI 作为优先索引,国内源作为回退来源
pip_install.extend([
'--index',
'--default-index',
settings.PLUGIN_PIP_INDEX_URL,
'--index',
'https://pypi.org/simple/',
'--index-strategy',
'unsafe-best-match',
])
else:
pip_install.extend(['--index', 'https://pypi.org/simple/'])
max_retries = settings.PLUGIN_PIP_MAX_RETRY
for attempt in range(max_retries):