mirror of
https://github.com/insistence/RuoYi-Vue3-FastAPI.git
synced 2026-10-14 13:06:46 +00:00
* refactor: 重构项目架构 * refactor: 重构ci和测试 * fix: 修复测试 * feat: 新增更多E2E测试 * fix: 修复E2E测试
24 lines
753 B
Python
24 lines
753 B
Python
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import yaml
|
|
|
|
|
|
def main() -> None:
|
|
"""
|
|
从 AI 插件清单安装测试依赖,避免 CI 维护第二份版本列表。
|
|
|
|
:return: None
|
|
"""
|
|
backend = Path(__file__).resolve().parents[2] / 'ruoyi-fastapi-backend'
|
|
manifest = yaml.safe_load((backend / 'plugins/ai/plugin.yaml').read_text(encoding='utf-8'))
|
|
requirements = manifest['dependencies']['python']
|
|
if not requirements or not all(isinstance(item, str) and not item.startswith('-') for item in requirements):
|
|
raise ValueError('AI 插件 Python 依赖清单无效')
|
|
subprocess.run([sys.executable, '-m', 'pip', 'install', *requirements], check=True, timeout=900)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|