mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-10-13 20:51:07 +00:00
Fix plugin dependency index resolution (#1271)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user