fix: 优化配置、修复测试和 temp_pdf 中文字体支持

- 优化 config.py,为所有依赖添加版本号,为所有文件类型添加 Darwin-x86_64 配置
- 修改 run_tests.py,添加平台相关 TEST_FIXTURE_DEPENDENCIES,简化 cli 和 all 测试逻辑
- 修复 tests/conftest.py 中 temp_pdf 的中文字体支持,使用 macOS 系统字体
- 更新 tests/test_core/test_advice_generator.py 以适应 Python 3.12 的默认配置
- 更新 openspec 相关规格文档
This commit is contained in:
2026-03-17 10:50:48 +08:00
parent 675235f5b3
commit 89ffc88082
8 changed files with 309 additions and 124 deletions

View File

@@ -24,13 +24,13 @@ class Config:
DEPENDENCIES = {
"pdf": {
"default": {
"python": None,
"python": "3.12",
"dependencies": [
"docling",
"docling==2.80.0",
"unstructured[pdf]",
"markitdown[pdf]",
"pypdf",
"markdownify"
"markitdown[pdf]==0.1.5",
"pypdf==6.9.0",
"markdownify==0.13.1"
]
},
"Darwin-x86_64": {
@@ -39,94 +39,22 @@ DEPENDENCIES = {
"docling==2.40.0",
"docling-parse==4.0.0",
"numpy<2",
"markitdown[pdf]",
"pypdf",
"markdownify"
"markitdown[pdf]==0.1.5",
"pypdf==6.9.0",
"markdownify==0.13.1"
]
}
},
"docx": {
"default": {
"python": None,
"python": "3.12",
"dependencies": [
"docling",
"docling==2.80.0",
"unstructured[docx]",
"markitdown[docx]",
"pypandoc-binary",
"python-docx",
"markdownify"
]
}
},
"xlsx": {
"default": {
"python": None,
"dependencies": [
"docling",
"unstructured[xlsx]",
"markitdown[xlsx]",
"pandas",
"tabulate"
]
}
},
"pptx": {
"default": {
"python": None,
"dependencies": [
"docling",
"unstructured[pptx]",
"markitdown[pptx]",
"python-pptx",
"markdownify"
]
}
},
"html": {
"default": {
"python": None,
"dependencies": [
"trafilatura",
"domscribe",
"markitdown",
"html2text",
"beautifulsoup4",
"httpx",
"chardet",
"pyppeteer",
"selenium"
]
}
},
"xls": {
"default": {
"python": None,
"dependencies": [
"unstructured[xlsx]",
"markitdown[xls]",
"pandas",
"tabulate",
"xlrd",
"olefile"
]
}
},
"doc": {
"default": {
"python": None,
"dependencies": []
}
},
"ppt": {
"default": {
"python": None,
"dependencies": [
"docling",
"unstructured[pptx]",
"markitdown[pptx]",
"python-pptx",
"markdownify",
"olefile"
"markitdown[docx]==0.1.5",
"pypandoc-binary==1.13",
"python-docx==1.2.0",
"markdownify==0.13.1"
]
},
"Darwin-x86_64": {
@@ -135,10 +63,129 @@ DEPENDENCIES = {
"docling==2.40.0",
"docling-parse==4.0.0",
"numpy<2",
"markitdown[pptx]",
"python-pptx",
"markdownify",
"olefile"
"markitdown[docx]==0.1.5",
"pypandoc-binary==1.13",
"python-docx==1.2.0",
"markdownify==0.13.1"
]
}
},
"xlsx": {
"default": {
"python": "3.12",
"dependencies": [
"docling==2.80.0",
"unstructured[xlsx]",
"markitdown[xlsx]==0.1.5",
"pandas==3.0.1",
"tabulate==0.9.0",
"openpyxl==3.1.5"
]
},
"Darwin-x86_64": {
"python": "3.12",
"dependencies": [
"docling==2.40.0",
"docling-parse==4.0.0",
"numpy<2",
"markitdown[xlsx]==0.1.5",
"pandas<3.0.0",
"tabulate==0.9.0",
"openpyxl==3.1.5"
]
}
},
"pptx": {
"default": {
"python": "3.12",
"dependencies": [
"docling==2.80.0",
"unstructured[pptx]",
"markitdown[pptx]==0.1.5",
"python-pptx==1.0.2",
"markdownify==0.13.1"
]
},
"Darwin-x86_64": {
"python": "3.12",
"dependencies": [
"docling==2.40.0",
"docling-parse==4.0.0",
"numpy<2",
"markitdown[pptx]==0.1.5",
"python-pptx==1.0.2",
"markdownify==0.13.1"
]
}
},
"html": {
"default": {
"python": "3.12",
"dependencies": [
"trafilatura==1.12.2",
"domscribe",
"markitdown==0.1.5",
"html2text==2024.2.26",
"beautifulsoup4==4.14.3",
"httpx==0.28.1",
"chardet==5.2.0",
"pyppeteer==2.0.0",
"selenium==4.25.0"
]
}
},
"xls": {
"default": {
"python": "3.12",
"dependencies": [
"unstructured[xlsx]",
"markitdown[xls]==0.1.5",
"pandas==3.0.1",
"tabulate==0.9.0",
"xlrd==2.0.1",
"olefile==0.47"
]
},
"Darwin-x86_64": {
"python": "3.12",
"dependencies": [
"markitdown[xls]==0.1.5",
"pandas<3.0.0",
"tabulate==0.9.0",
"xlrd==2.0.1",
"olefile==0.47",
"openpyxl==3.1.5"
]
}
},
"doc": {
"default": {
"python": "3.12",
"dependencies": []
}
},
"ppt": {
"default": {
"python": "3.12",
"dependencies": [
"docling==2.80.0",
"unstructured[pptx]",
"markitdown[pptx]==0.1.5",
"python-pptx==1.0.2",
"markdownify==0.13.1",
"olefile==0.47"
]
},
"Darwin-x86_64": {
"python": "3.12",
"dependencies": [
"docling==2.40.0",
"docling-parse==4.0.0",
"numpy<2",
"markitdown[pptx]==0.1.5",
"python-pptx==1.0.2",
"markdownify==0.13.1",
"olefile==0.47"
]
}
}