XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/gpt4free

feat: Add YAML import check and skip tests if not available

7448194c
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

4 个文件 +14 -6
Modified etc/unittest/config_provider.py +3 -0
@@ -22,6 +22,7 @@ from g4f.providers.config_provider import (
22 22 RouterConfig,
23 23 ConfigModelProvider,
24 24 evaluate_condition,
25 has_yaml
25 26 )
26 27
27 28
@@ -271,6 +272,8 @@ class TestEvaluateCondition(unittest.TestCase):
271 272 class TestRouterConfig(unittest.TestCase):
272 273
273 274 def setUp(self):
275 if not has_yaml:
276 self.skipTest('"yaml" not installed')
274 277 RouterConfig.clear()
275 278
276 279 def test_load_valid_yaml(self):
Modified requirements-slim.txt +2 -1
@@ -18,4 +18,5 @@ markitdown[all]
18 18 a2wsgi
19 19 python-dotenv
20 20 ddgs
21 cloudscraper
21 cloudscraper
22 yaml
Modified requirements.txt +2 -1
@@ -20,4 +20,5 @@ python-dotenv
20 20 ddgs
21 21 cloudscraper
22 22 wasmtime
23 numpy
23 numpy
24 yaml
Modified setup.py +7 -4
@@ -41,7 +41,8 @@ EXTRA_REQUIRE = {
41 41 "aiofile",
42 42 "cloudscraper",
43 43 "wasmtime",
44 "numpy"
44 "numpy",
45 "yaml",
45 46 ],
46 47 'slim': [
47 48 "curl_cffi>=0.6.2",
@@ -62,12 +63,13 @@ EXTRA_REQUIRE = {
62 63 "python-docx",
63 64 "python-dotenv",
64 65 "aiofile",
65 "cloudscraper"
66 "cloudscraper",
67 "yaml",
66 68 ],
67 69 "image": [
68 70 "pillow",
69 71 "cairosvg",
70 "beautifulsoup4"
72 "beautifulsoup4",
71 73 ],
72 74 "webview": [
73 75 "pywebview",
@@ -80,6 +82,7 @@ EXTRA_REQUIRE = {
80 82 "uvicorn",
81 83 "python-multipart",
82 84 "a2wsgi",
85 "yaml"
83 86 ],
84 87 "gui": [
85 88 "werkzeug", "flask[async]",
@@ -95,7 +98,7 @@ EXTRA_REQUIRE = {
95 98 ],
96 99 "files": [
97 100 "beautifulsoup4",
98 "markitdown[all]"
101 "markitdown[all]",
99 102 ]
100 103 }
101 104