refactor: 重新梳理 DEPENDENCIES 版本和 python 版本
- default.python 全部改为 None(使用默认 python) - 所有依赖都指定版本号(截止 2026-03-17 最新版) - 为 unstructured[...]、domscribe 等未指定版本的依赖添加版本 - 更新 markdownify、pypandoc-binary、tabulate、trafilatura、html2text、chardet、xlrd 等依赖版本 - html 的 selenium 降级到 4.25.0 解决 urllib3 冲突 - 为 pdf/docx/xlsx/pptx/html/xls/ppt 添加 Darwin-x86_64 配置(python 3.12 + docling 2.40.0 + docling-parse 4.0.0 + numpy<2) - 更新测试期望 python_ver 为 None
This commit is contained in:
105
docs/upgrade-deps-prompt.md
Normal file
105
docs/upgrade-deps-prompt.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# 依赖版本优化流程提示词
|
||||
|
||||
## 任务概述
|
||||
|
||||
重新梳理 `scripts/config.py` 中 `DEPENDENCIES` 的版本号和 python 版本。
|
||||
|
||||
## 核心原则
|
||||
|
||||
1. **default 的 python 版本始终使用 None**,即默认 python 版本
|
||||
2. **实在需要指定 python 版本时**,才在具体的系统依赖(如 Darwin-x86_64)中指定 python 版本,而不是改 default 中的 python 版本
|
||||
3. **dependencies 中的依赖都需要指定版本**
|
||||
- 以当前时间点的最新版本指定
|
||||
- 如果最新版本无法满足,才在指定系统依赖中探索能运行的最新依赖版本号
|
||||
|
||||
## 推荐流程
|
||||
|
||||
### 阶段 1:规范梳理
|
||||
|
||||
1. 确定需要检查的依赖列表
|
||||
2. 确定版本查询方法(如 PyPI JSON API)
|
||||
3. 确定测试验证流程
|
||||
|
||||
### 阶段 2:版本探索(实现阶段)
|
||||
|
||||
1. **先移除所有特定当前平台配置**,只保留 default
|
||||
2. **default 配置使用最新版本作为标杆**
|
||||
3. **逐个文件类型测试**
|
||||
- 先测试 default 配置
|
||||
- 若 default 失败,再添加特定平台配置并探索可运行的最新版本
|
||||
4. **所有依赖(无论之前是否指定版本)都重新探索**
|
||||
|
||||
### 阶段 3:配置更新
|
||||
|
||||
1. 修改 `default.python = None`
|
||||
2. 更新所有依赖到指定版本
|
||||
3. 保留/调整特定平台的特殊配置
|
||||
|
||||
## 关键文件
|
||||
|
||||
- `scripts/config.py` - DEPENDENCIES 配置
|
||||
- `run_tests.py` - 测试运行器(包含 TEST_FIXTURE_DEPENDENCIES)
|
||||
- `openspec/changes/` - OpenSpec 变更目录
|
||||
|
||||
## 常用 PyPI 版本查询
|
||||
|
||||
使用 Python 查询 PyPI 最新版本:
|
||||
|
||||
```python
|
||||
import json
|
||||
import urllib.request
|
||||
|
||||
def get_latest_version(package):
|
||||
try:
|
||||
url = f'https://pypi.org/pypi/{package}/json'
|
||||
with urllib.request.urlopen(url, timeout=15) as f:
|
||||
data = json.load(f)
|
||||
return data['info']['version']
|
||||
except Exception as e:
|
||||
return f'error: {e}'
|
||||
```
|
||||
|
||||
## 本次(2026-03-17)的经验总结
|
||||
|
||||
### Darwin-x86_64 平台的已知问题
|
||||
|
||||
1. **torch 无 Darwin-x86_64 wheel**(docling 2.80.0 依赖 torch)
|
||||
- 解决:使用 docling 2.40.0 + docling-parse 4.0.0 + numpy<2
|
||||
2. **onnxruntime 无 Darwin-x86_64 + Python 3.14 wheel**(markitdown 依赖)
|
||||
- 解决:指定 python 3.12
|
||||
3. **pyppeteer 2.0.0 与 selenium 4.41.0 的 urllib3 版本冲突**
|
||||
- 解决:selenium 降级到 4.25.0
|
||||
4. **pandas 3.0.1 与 fixtures 依赖 pandas<3.0.0 冲突**
|
||||
- 解决:特定平台使用 pandas<3.0.0
|
||||
|
||||
### 本次更新的依赖版本(截止 2026-03-17)
|
||||
|
||||
| 依赖 | 版本 |
|
||||
|------|------|
|
||||
| docling | 2.80.0 (default) / 2.40.0 (Darwin-x86_64) |
|
||||
| docling-parse | 5.5.0 (default) / 4.0.0 (Darwin-x86_64) |
|
||||
| unstructured[...] | 0.21.5 |
|
||||
| markitdown[...] | 0.1.5 |
|
||||
| pypdf | 6.9.0 |
|
||||
| markdownify | 1.2.2 |
|
||||
| pypandoc-binary | 1.17 |
|
||||
| python-docx | 1.2.0 |
|
||||
| pandas | 3.0.1 (default) / <3.0.0 (Darwin-x86_64) |
|
||||
| tabulate | 0.10.0 |
|
||||
| openpyxl | 3.1.5 |
|
||||
| python-pptx | 1.0.2 |
|
||||
| trafilatura | 2.0.0 |
|
||||
| domscribe | 0.1.3 |
|
||||
| html2text | 2025.4.15 |
|
||||
| beautifulsoup4 | 4.14.3 |
|
||||
| httpx | 0.28.1 |
|
||||
| chardet | 7.1.0 |
|
||||
| pyppeteer | 2.0.0 |
|
||||
| selenium | 4.25.0 (Darwin-x86_64) |
|
||||
| xlrd | 2.0.2 |
|
||||
| olefile | 0.47 |
|
||||
| numpy | <2 (Darwin-x86_64) |
|
||||
|
||||
## 创建 OpenSpec 变更
|
||||
|
||||
使用 `/opsx:new` 或 `/opsx:ff` 创建变更,使用 spec-driven 工作流。
|
||||
Reference in New Issue
Block a user