article-mcp 0.2.1__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- article_mcp-0.2.3/CHANGELOG.md +296 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/CLAUDE.md +37 -31
- {article_mcp-0.2.1/src/article_mcp.egg-info → article_mcp-0.2.3}/PKG-INFO +21 -21
- {article_mcp-0.2.1 → article_mcp-0.2.3}/README.md +4 -4
- {article_mcp-0.2.1 → article_mcp-0.2.3}/pyproject.toml +19 -56
- article_mcp-0.2.1/tests/test_complete_http_client.py → article_mcp-0.2.3/scripts/manual/http_client_check.py +356 -356
- article_mcp-0.2.1/tests/test_relation_tools.py → article_mcp-0.2.3/scripts/manual/relation_tools_check.py +5 -5
- {article_mcp-0.2.1 → article_mcp-0.2.3}/scripts/simulate_cherry_studio.py +3 -9
- {article_mcp-0.2.1 → article_mcp-0.2.3}/scripts/test_fastmcp_compliance.py +3 -4
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/__init__.py +1 -1
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/cli.py +25 -12
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/middleware/__init__.py +4 -8
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/resources/config_resources.py +4 -2
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/__init__.py +6 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/api_utils.py +2 -3
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/arxiv_search.py +613 -575
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/easyscholar_service.py +344 -344
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/europe_pmc.py +2 -2
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/html_to_markdown.py +1 -1
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/merged_results.py +1 -1
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/openalex_metrics_service.py +3 -2
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/pubmed_search.py +3 -3
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/reference_service.py +322 -322
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/core/article_tools.py +7 -7
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/core/quality_tools.py +27 -14
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/core/reference_tools.py +3 -6
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/core/relation_tools.py +4 -2
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/core/search_tools.py +3 -6
- {article_mcp-0.2.1 → article_mcp-0.2.3/src/article_mcp.egg-info}/PKG-INFO +21 -21
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp.egg-info/SOURCES.txt +7 -14
- article_mcp-0.2.3/src/article_mcp.egg-info/requires.txt +17 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/conftest.py +2 -1
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/services/test_arxiv_async.py +418 -402
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/services/test_async_api_client.py +2 -2
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/services/test_async_client_migration.py +1 -1
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/services/test_crossref_openalex_async.py +260 -263
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/services/test_pubmed_async.py +1 -1
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_cli.py +4 -2
- article_mcp-0.2.3/tests/unit/test_cli_quality_services.py +140 -0
- article_mcp-0.2.3/tests/unit/test_cli_show_info.py +173 -0
- article_mcp-0.2.3/tests/unit/test_fastmcp_api_fix.py +166 -0
- article_mcp-0.2.3/tests/unit/test_performance_timer_naming.py +116 -0
- article_mcp-0.2.3/tests/unit/test_runtime_warning_fix.py +66 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_tool_core.py +22 -8
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/utils/test_helpers.py +10 -4
- article_mcp-0.2.1/CHANGELOG.md +0 -191
- article_mcp-0.2.1/scripts/quick_test.py +0 -176
- article_mcp-0.2.1/scripts/run_all_tests.py +0 -108
- article_mcp-0.2.1/scripts/sync_version.py +0 -175
- article_mcp-0.2.1/scripts/test_architecture_fixes.py +0 -238
- article_mcp-0.2.1/scripts/test_complete_literature_analysis.py +0 -654
- article_mcp-0.2.1/scripts/test_fixed_api_integration.py +0 -509
- article_mcp-0.2.1/scripts/test_module_imports.py +0 -180
- article_mcp-0.2.1/scripts/test_performance.py +0 -443
- article_mcp-0.2.1/scripts/test_pytest_suite.py +0 -198
- article_mcp-0.2.1/scripts/test_search_performance.py +0 -367
- article_mcp-0.2.1/scripts/test_simple_imports.py +0 -194
- article_mcp-0.2.1/scripts/test_working_functions.py +0 -203
- article_mcp-0.2.1/src/article_mcp.egg-info/requires.txt +0 -17
- {article_mcp-0.2.1 → article_mcp-0.2.3}/LICENSE +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/MANIFEST.in +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/glama.json +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/scripts/clean_pytest_cache.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/setup.cfg +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/__main__.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/middleware/logging.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/resources/__init__.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/resources/journal_resources.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/crossref_service.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/error_utils.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/mcp_config.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/openalex_service.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/services/similar_articles.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/__init__.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp/tools/core/__init__.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp.egg-info/dependency_links.txt +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp.egg-info/entry_points.txt +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/src/article_mcp.egg-info/top_level.txt +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/__init__.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/integration/test_mcp_integration.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/integration/test_real_api.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/integration/test_six_tools_integration.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/services/test_pmc_fulltext_conversion.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_crossref_service.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_easyscholar_service.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_merged_results.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_openalex_metrics_service.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_openalex_service.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_quality_tools_sorting.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_search_tools_improvements.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_services.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/test_six_tools.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_article_tools_format_param.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_article_tools_pmcid_normalization.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_article_tools_pmcid_only.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_cache_concurrency.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_closure_services.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_quality_async_pure.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_reference_tools_async.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_relation_tools_async.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_relation_uses_reference.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/unit/tools/test_search_tools_async_integration.py +0 -0
- {article_mcp-0.2.1 → article_mcp-0.2.3}/tests/verification/test_fastmcp_async.py +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
# 版本更新说明
|
|
2
|
+
|
|
3
|
+
## v0.2.3 (2026-11-21) - 依赖全面升级 + MCP SDK 2.x 适配
|
|
4
|
+
|
|
5
|
+
### 核心修复 🔧
|
|
6
|
+
- **MCPError 导入兼容**: `from mcp import McpError` → `from fastmcp.exceptions import McpError`
|
|
7
|
+
- MCP SDK 2.x 将 `McpError` 更名为 `MCPError` 并移除顶层导出,直接从 `mcp` 导入会在启动时抛
|
|
8
|
+
`ImportError: cannot import name 'McpError' from 'mcp'`,导致 MCP server 进程直接退出
|
|
9
|
+
- fastmcp 2.13.0 与 4.2.4 均通过 `fastmcp.exceptions` 提供该名字,一处改动兼容两代
|
|
10
|
+
- **MCPError 构造方式适配**: MCP SDK 2.x 的签名为 `MCPError(code, message, data)`,不再是
|
|
11
|
+
`McpError(ErrorData(...))`;中间件与工具层的 5 处抛出点已同步更新(否则错误路径会抛 TypeError)
|
|
12
|
+
- **ToolAnnotations 字段改名**: `readOnlyHint`/`openWorldHint` → `read_only_hint`/`open_world_hint`
|
|
13
|
+
- 旧写法在 pydantic 下被静默丢弃,工具的只读/开放世界标注实际未生效
|
|
14
|
+
- **版本号漂移**: `cli.py` 硬编码的 `version="0.2.2"` 改为读取包内 `__version__`;
|
|
15
|
+
`tests/unit/test_cli.py` 的断言不再写死版本号
|
|
16
|
+
|
|
17
|
+
### 依赖升级 📦
|
|
18
|
+
- `fastmcp` 2.13.0 → **4.2.4**(配套 `mcp` 1.19.0 → **2.3.0**)
|
|
19
|
+
- `requests` → 2.34.2、`aiohttp` → 3.14.5、`urllib3` → 2.8.0、`markdownify` → 1.2.4、
|
|
20
|
+
`filelock` → 4.2.12、`python-dateutil` → 4.0.0
|
|
21
|
+
- 开发依赖:`pytest` → 9.2.0、`pytest-asyncio` → 1.5.0、`pytest-cov` → 7.1.0、
|
|
22
|
+
`ruff` → 0.17.6、`mypy` → 2.4.1、`pre-commit` → 4.7.0、`psutil` → 7.2.2
|
|
23
|
+
- `requires-python` 从 `>=3.10` 提升到 `>=3.11`(fastmcp 4.x 的下限),ruff/mypy 目标版本同步为 py311
|
|
24
|
+
- 依赖下界统一抬到"已验证通过的版本",避免再出现"包版本被 pin、依赖却浮动"导致的启动崩溃
|
|
25
|
+
|
|
26
|
+
### 测试与工具链 🧪
|
|
27
|
+
- FastMCP 4.x 将 `get_tools()` 更名为 `list_tools()`(返回列表而非字典),相关测试已同步
|
|
28
|
+
- 移除已过时的 `asyncio.TimeoutError` 别名用法(Python 3.11+ 已是内置 `TimeoutError`)
|
|
29
|
+
- `pre-commit` 的 ruff hook 升到 v0.17.6;CI action 升到 checkout@v6.0.1 / setup-python@v6.1.0
|
|
30
|
+
- 新增一次真实的 MCP 握手与工具调用验证(initialize / tools/list / tools/call,含错误路径)
|
|
31
|
+
|
|
32
|
+
### 功能缺陷修复 🐛
|
|
33
|
+
- **arXiv 日期过滤失效**: 关键词未整体加引号时,arXiv 的 search_query 解析器会把
|
|
34
|
+
`submittedDate:[... TO ...]` 约束丢掉,静默返回最新文献。同步与异步两条检索路径都改为
|
|
35
|
+
`all:"关键词"`,并替换掉关键词里自带的双引号
|
|
36
|
+
- **include_metrics 传字符串时的语义错误**: 单个指标名此前会被当作字符串做子串匹配,
|
|
37
|
+
现在统一规范化为列表
|
|
38
|
+
- **异常被 Mock 吞掉**: 测试里 `__aexit__ = AsyncMock()` 返回真值,会把 `async with`
|
|
39
|
+
内的异常整个抑制掉,导致"网络错误"用例走成了成功路径。已改为 `return_value=False`
|
|
40
|
+
|
|
41
|
+
### 补齐缺失的异步能力 ⚡
|
|
42
|
+
- 新增模块级 `search_async()`(arXiv),此前只有 `search_arxiv_async()` 与类方法,
|
|
43
|
+
测试因找不到入口而长期 skip
|
|
44
|
+
- 14 个长期 skip 的用例全部恢复执行(398 passed / 14 skipped → 412 passed / 0 skipped),
|
|
45
|
+
打真实 API 的用例统一标 `@pytest.mark.network`,CI 用 `-m "not network"` 排除
|
|
46
|
+
|
|
47
|
+
### 工程基建 🏗️
|
|
48
|
+
- **新增 CI**(`.github/workflows/ci.yml`):lint(ruff + mypy)、test(Python 3.11/3.12 矩阵)、
|
|
49
|
+
smoke(FastMCP 合规性,得分低于 80 失败)三个作业;原先只有 publish 与合规性两个 workflow,
|
|
50
|
+
测试与 lint 完全没有 CI 兜底
|
|
51
|
+
- **mypy 打通**: 清理 13 个类型错误(`mypy src` 现为 Success),并把 mypy 挂进 pre-commit 与 CI
|
|
52
|
+
- **配置单一来源**: 删掉 `pyproject.toml` 里与 `pytest.ini` / `mypy.ini` 重复的
|
|
53
|
+
`[tool.pytest.ini_options]` 与 `[tool.mypy]`,避免两处配置不一致
|
|
54
|
+
|
|
55
|
+
### 仓库清理 🧹
|
|
56
|
+
- `scripts/` 下 12 个一次性验证脚本删除(功能已被 pytest 套件覆盖),
|
|
57
|
+
保留合规性检查、客户端兼容性模拟与清理工具;需要本地服务/真实 API 的两个脚本移到
|
|
58
|
+
`scripts/manual/`
|
|
59
|
+
- 两个伪装成测试的手工脚本(HTTP 客户端、关系工具)从 `tests/` 移到 `scripts/manual/`
|
|
60
|
+
- 过程性文档 `API_Integration_Fix_Report.md`、`search_tools_integration_analysis.md` 归档到
|
|
61
|
+
`docs/archive/`
|
|
62
|
+
- `config://version` / `config://status` 资源改为读 `__version__`,消除版本号漂移;
|
|
63
|
+
配套的 `scripts/sync_version.py` 删除
|
|
64
|
+
- 文档同步:安装命令补 `filelock`/`urllib3` 与 Python 3.11+ 要求、
|
|
65
|
+
CLAUDE.md 的"6 个工具/兼容性 main.py"过时描述、PROJECT_STRUCTURE 目录树、测试命令
|
|
66
|
+
|
|
67
|
+
### 兼容性说明 ⚠️
|
|
68
|
+
- 本版本**要求 MCP SDK 2.x**(由 `fastmcp>=4.2.4` 约束),不再兼容 fastmcp 2.x
|
|
69
|
+
- `uv.lock` 已按新依赖重新生成,`uv sync` 即可得到一致环境
|
|
70
|
+
|
|
71
|
+
## v0.2.2 (2025-01-04) - 文档修正与代码质量提升
|
|
72
|
+
|
|
73
|
+
### 文档修正 📚
|
|
74
|
+
- **CLAUDE.md**: 更正核心工具数量从 6 个改为 5 个
|
|
75
|
+
- 移除不存在的 `export_batch_results` (batch_tools.py)
|
|
76
|
+
- 添加 `test_six_tools.py` 命名遗留问题的说明
|
|
77
|
+
- **README.md**: 更新 FastMCP 版本描述为 v2.13+
|
|
78
|
+
|
|
79
|
+
### 代码质量改进 🔧
|
|
80
|
+
- **FastMCP API 适配**: 修复 `.settings` 废弃警告,使用新的 API
|
|
81
|
+
- **性能计时器重构**: 重命名 `PerformanceTimer` 为 `PerfTimer`,提升代码一致性
|
|
82
|
+
- **服务依赖注入**: 修复 `quality_tools` 服务依赖注入问题
|
|
83
|
+
- **工具参数描述**: 修正 `show_info()` 工具参数描述(TDD 完成)
|
|
84
|
+
|
|
85
|
+
### 测试改进 ✅
|
|
86
|
+
- 添加 `PerfTimer` 类命名问题的测试
|
|
87
|
+
- 添加 `RuntimeWarning` 协程未等待问题的测试
|
|
88
|
+
- 修复 `test_relation_tools.py` 中的导入路径问题
|
|
89
|
+
- 更新测试文件中的 `quality_services` Mock 定义以保持一致性
|
|
90
|
+
- 添加 `quality_tools` 服务依赖注入的失败测试
|
|
91
|
+
|
|
92
|
+
### 提交记录
|
|
93
|
+
```
|
|
94
|
+
0b80ad2 docs: 修正文档与代码一致性
|
|
95
|
+
e44f44a refactor: 修复 FastMCP .settings 废弃警告
|
|
96
|
+
4520411 refactor: 重命名 PerformanceTimer 为 PerfTimer
|
|
97
|
+
dc752c5 test: 添加 PerformanceTimer 类命名问题的测试
|
|
98
|
+
c3e6af1 fix: 修复 test_relation_tools.py 中的导入路径问题
|
|
99
|
+
77412e2 test: 添加 RuntimeWarning 协程未等待问题的测试
|
|
100
|
+
4986a03 test: 更新测试文件中的 quality_services Mock 定义以保持一致性
|
|
101
|
+
286ee93 feat: 修复 quality_tools 服务依赖注入问题
|
|
102
|
+
0c875f0 test: 添加 quality_tools 服务依赖注入的失败测试
|
|
103
|
+
461998a feat: 修正 show_info() 工具参数描述(TDD 完成)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## v0.2.0 (2024-12-27) - 异步架构重大升级 🚀
|
|
109
|
+
|
|
110
|
+
### 重大变更 - 纯异步架构迁移
|
|
111
|
+
|
|
112
|
+
本次更新完成了从同步到纯异步架构的全面迁移,实现了显著的性能提升和更好的并发处理能力。
|
|
113
|
+
|
|
114
|
+
#### 性能提升 ⚡
|
|
115
|
+
- **并发性能**: 支持真正的并发API调用,不再受同步阻塞限制
|
|
116
|
+
- **吞吐量提升**: 多源搜索性能提升 3-5 倍(取决于并发数量)
|
|
117
|
+
- **响应速度**: 单个请求响应时间减少 20-30%
|
|
118
|
+
- **资源利用**: 更高效的连接池复用,降低内存占用
|
|
119
|
+
|
|
120
|
+
#### 架构改进 🏗️
|
|
121
|
+
- **统一异步模式**: 所有服务层 API 采用 async/await 模式
|
|
122
|
+
- **AsyncAPIClient**: 新增统一异步HTTP客户端,支持连接池、重试、超时
|
|
123
|
+
- **FastMCP v2**: 升级到 FastMCP v2,更好的异步支持
|
|
124
|
+
- **闭包依赖注入**: 彻底移除全局变量,使用闭包捕获服务依赖
|
|
125
|
+
|
|
126
|
+
#### 服务层变更
|
|
127
|
+
所有服务的核心方法已迁移到异步版本:
|
|
128
|
+
|
|
129
|
+
| 服务 | 同步方法(已废弃) | 异步方法(推荐) |
|
|
130
|
+
|------|-------------------|------------------|
|
|
131
|
+
| Europe PMC | - | `search_async()`, `get_article_details_async()` |
|
|
132
|
+
| PubMed | `search()` | `search_async()`, `get_citing_articles_async()` |
|
|
133
|
+
| CrossRef | - | `search_works_async()`, `get_work_by_doi_async()` |
|
|
134
|
+
| OpenAlex | - | `search_works_async()`, `get_work_by_doi_async()` |
|
|
135
|
+
| ArXiv | `search_arxiv()` | `search_async()` |
|
|
136
|
+
| Reference | - | `get_references_by_doi_async()` |
|
|
137
|
+
|
|
138
|
+
#### 工具层变更
|
|
139
|
+
- 所有 6 个核心工具完全异步化
|
|
140
|
+
- 工具函数签名更新为 `async def`
|
|
141
|
+
- 支持并行处理多个数据源
|
|
142
|
+
|
|
143
|
+
#### 向后兼容性 ♻️
|
|
144
|
+
- 同步方法标记为已废弃,但保留可用
|
|
145
|
+
- 同步版本内部调用异步版本,通过 `asyncio.run()` 转换
|
|
146
|
+
- 建议用户迁移到异步版本以获得最佳性能
|
|
147
|
+
|
|
148
|
+
#### 测试覆盖 ✅
|
|
149
|
+
- **344 个测试通过** (93% 通过率)
|
|
150
|
+
- 新增异步测试套件
|
|
151
|
+
- 集成测试覆盖并发场景
|
|
152
|
+
- 性能测试验证异步优势
|
|
153
|
+
|
|
154
|
+
#### 技术债务清理
|
|
155
|
+
- 移除全局变量,使用依赖注入
|
|
156
|
+
- 统一错误处理模式
|
|
157
|
+
- 代码质量提升(无未使用导入、无 TODO 注释)
|
|
158
|
+
|
|
159
|
+
#### 迁移指南
|
|
160
|
+
|
|
161
|
+
对于使用此项目的用户:
|
|
162
|
+
|
|
163
|
+
**无需更改** - MCP 工具接口保持兼容
|
|
164
|
+
|
|
165
|
+
对于开发者:
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
# 旧方式(同步)
|
|
169
|
+
result = service.search("keyword")
|
|
170
|
+
|
|
171
|
+
# 新方式(异步)
|
|
172
|
+
result = await service.search_async("keyword")
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### 已知问题
|
|
176
|
+
- PMC 全文转换的同步测试已跳过(14个测试),待更新为异步版本
|
|
177
|
+
- 推荐使用 `get_pmc_fulltext_html_async()` 替代同步版本
|
|
178
|
+
|
|
179
|
+
### 修复问题
|
|
180
|
+
- 修复 FastMCP v2 兼容性问题
|
|
181
|
+
- 修复测试套件中的异步 mock 问题
|
|
182
|
+
- 修复 Europe PMC 服务缺少 `total_count` 字段
|
|
183
|
+
|
|
184
|
+
### 文档更新
|
|
185
|
+
- 代码注释更新异步签名
|
|
186
|
+
- 测试文件添加异步模式说明
|
|
187
|
+
|
|
188
|
+
### 测试统计
|
|
189
|
+
```
|
|
190
|
+
344 passed, 30 skipped, 0 failed
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## v0.1.9
|
|
196
|
+
|
|
197
|
+
### 修复问题
|
|
198
|
+
- **Cherry Studio等客户端emoji编码兼容性问题修复** (closes #4)
|
|
199
|
+
- 添加PYTHONIOENCODING=utf-8环境变量设置,确保Unicode字符正确处理
|
|
200
|
+
- 实现safe_print函数处理编码异常,提供编码安全的输出机制
|
|
201
|
+
- 将CLI启动信息中的emoji替换为文本标识符,避免编码冲突
|
|
202
|
+
- 修复在Cherry Studio中mcp:list-tools调用失败的问题
|
|
203
|
+
|
|
204
|
+
### 新增功能
|
|
205
|
+
- **Glama MCP服务器目录徽章**
|
|
206
|
+
- 添加来自PR #3的MCP服务器徽章,提升项目在MCP生态系统中的可见性
|
|
207
|
+
- 徽章链接到Glama MCP服务器目录,提供额外的质量认证和服务器特性展示
|
|
208
|
+
|
|
209
|
+
### 改进
|
|
210
|
+
- **项目许可证文件添加**
|
|
211
|
+
- 添加标准MIT许可证文件,确保符合GitHub开源项目要求
|
|
212
|
+
- 提供清晰的法律条款和使用权限
|
|
213
|
+
- 符合开源社区最佳实践
|
|
214
|
+
|
|
215
|
+
### 测试验证
|
|
216
|
+
- HTTP模式服务器成功启动并响应MCP协议调用
|
|
217
|
+
- 文献搜索功能正常工作(测试了"泛基因组"和"pan-genome"搜索)
|
|
218
|
+
- 与Cherry Studio等AI客户端完全兼容
|
|
219
|
+
|
|
220
|
+
### 文档更新
|
|
221
|
+
- 为所有客户端配置示例添加PYTHONIOENCODING=utf-8环境变量说明
|
|
222
|
+
- 添加Cherry Studio专用的重要提示和编码兼容性说明
|
|
223
|
+
|
|
224
|
+
## v0.1.1
|
|
225
|
+
|
|
226
|
+
## v0.1.1
|
|
227
|
+
|
|
228
|
+
### 新增功能
|
|
229
|
+
|
|
230
|
+
#### MCP 配置集成
|
|
231
|
+
- 新增从 MCP 客户端配置文件中读取 EasyScholar API 密钥的功能
|
|
232
|
+
- 支持配置优先级:MCP配置文件 > 函数参数 > 环境变量
|
|
233
|
+
- 支持多个配置文件路径自动查找
|
|
234
|
+
|
|
235
|
+
#### 支持的配置文件路径
|
|
236
|
+
- `~/.config/claude-desktop/config.json`
|
|
237
|
+
- `~/.config/claude/config.json`
|
|
238
|
+
- `~/.claude/config.json`
|
|
239
|
+
- `CLAUDE_CONFIG_PATH` 环境变量指定的路径
|
|
240
|
+
|
|
241
|
+
#### 配置示例
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"mcpServers": {
|
|
245
|
+
"article-mcp": {
|
|
246
|
+
"command": "uvx",
|
|
247
|
+
"args": ["article-mcp", "server"],
|
|
248
|
+
"env": {
|
|
249
|
+
"PYTHONUNBUFFERED": "1",
|
|
250
|
+
"EASYSCHOLAR_SECRET_KEY": "your_easyscholar_api_key_here"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### 支持的工具
|
|
258
|
+
- `get_journal_quality` - 获取期刊质量评估信息
|
|
259
|
+
- `evaluate_articles_quality` - 批量评估文献的期刊质量
|
|
260
|
+
|
|
261
|
+
### 向后兼容性
|
|
262
|
+
- 完全兼容原有的环境变量配置方式
|
|
263
|
+
- 完全兼容原有的函数参数传递方式
|
|
264
|
+
- 保持了所有原有功能不变
|
|
265
|
+
|
|
266
|
+
### 技术改进
|
|
267
|
+
- 新增 `src/mcp_config.py` 配置管理模块
|
|
268
|
+
- 更新了质量评估工具的密钥获取逻辑
|
|
269
|
+
- 优化了配置读取性能和缓存机制
|
|
270
|
+
|
|
271
|
+
### 文档更新
|
|
272
|
+
- 更新了 README.md,添加了 MCP 配置集成说明
|
|
273
|
+
- 更新了 CLAUDE.md,添加了配置管理说明
|
|
274
|
+
- 新增了 `docs/MCP_CONFIG_INTEGRATION.md` 详细使用指南
|
|
275
|
+
|
|
276
|
+
### 测试
|
|
277
|
+
- 新增了完整的配置集成测试
|
|
278
|
+
- 测试覆盖了配置加载、优先级、工具集成等功能
|
|
279
|
+
- 所有测试通过,功能稳定可靠
|
|
280
|
+
|
|
281
|
+
## 发布说明
|
|
282
|
+
|
|
283
|
+
### 标签格式
|
|
284
|
+
- 使用语义化版本控制:`v0.1.1`
|
|
285
|
+
- 推送标签后自动触发 GitHub Actions 发布流程
|
|
286
|
+
|
|
287
|
+
### 发布流程
|
|
288
|
+
1. 代码合并到 main 分支
|
|
289
|
+
2. 创建并推送版本标签:`git tag v0.1.1 && git push origin v0.1.1`
|
|
290
|
+
3. GitHub Actions 自动构建并发布到 PyPI
|
|
291
|
+
4. 用户可以通过 `uvx article-mcp` 使用最新版本
|
|
292
|
+
|
|
293
|
+
### 注意事项
|
|
294
|
+
- 确保 `PYPI_API_TOKEN` 密钥已正确配置
|
|
295
|
+
- 发布前请运行完整测试确保功能正常
|
|
296
|
+
- 发布后请通知用户更新并说明新功能
|
|
@@ -11,13 +11,13 @@ Article MCP is a high-performance literature search server based on FastMCP fram
|
|
|
11
11
|
The project follows a standard Python src layout with layered architecture:
|
|
12
12
|
|
|
13
13
|
- **CLI Layer** (`cli.py`): Main CLI entry point and MCP server creation via `create_mcp_server()`
|
|
14
|
-
- **Tool Layer** (`tools/core/`):
|
|
14
|
+
- **Tool Layer** (`tools/core/`): 5 core MCP tool registrations
|
|
15
15
|
- **Service Layer** (`services/`): API integrations using dependency injection pattern
|
|
16
16
|
- **Middleware Layer** (`middleware/`): Error handling, logging, and performance monitoring
|
|
17
17
|
- **Resource Layer** (`resources/`): MCP resources for config and journal data
|
|
18
|
-
- **
|
|
18
|
+
- **Entry Points** (`__main__.py`): `python -m article_mcp` 入口,转发到 `cli.py`
|
|
19
19
|
|
|
20
|
-
### The
|
|
20
|
+
### The 5 Core Tools
|
|
21
21
|
|
|
22
22
|
All tools are registered in `cli.py:create_mcp_server()` with their respective service dependencies:
|
|
23
23
|
|
|
@@ -26,7 +26,8 @@ All tools are registered in `cli.py:create_mcp_server()` with their respective s
|
|
|
26
26
|
3. **get_references** (`tools/core/reference_tools.py`): Reference list retrieval
|
|
27
27
|
4. **get_literature_relations** (`tools/core/relation_tools.py`): Citation relationship analysis
|
|
28
28
|
5. **get_journal_quality** (`tools/core/quality_tools.py`): Journal quality assessment
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
Note: The test file `test_six_tools.py` is a legacy name - it tests these 5 core tools.
|
|
30
31
|
|
|
31
32
|
### Service Injection Pattern
|
|
32
33
|
|
|
@@ -52,11 +53,11 @@ Access global performance stats via `middleware.get_global_performance_stats()`.
|
|
|
52
53
|
|
|
53
54
|
### Environment Setup
|
|
54
55
|
```bash
|
|
55
|
-
# Install dependencies
|
|
56
|
-
uv sync
|
|
56
|
+
# Install dependencies (Python 3.11+)
|
|
57
|
+
uv sync --extra dev
|
|
57
58
|
|
|
58
59
|
# Or using pip
|
|
59
|
-
pip install fastmcp requests python-dateutil aiohttp markdownify
|
|
60
|
+
pip install "fastmcp>=4.2.4" requests python-dateutil urllib3 aiohttp markdownify filelock
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
### Running the Server
|
|
@@ -67,9 +68,6 @@ uvx article-mcp server
|
|
|
67
68
|
# Local development - using new CLI
|
|
68
69
|
uv run python -m article_mcp server
|
|
69
70
|
|
|
70
|
-
# Compatibility through main.py (still works)
|
|
71
|
-
uv run main.py server
|
|
72
|
-
|
|
73
71
|
# Alternative transport modes
|
|
74
72
|
uv run python -m article_mcp server --transport stdio
|
|
75
73
|
uv run python -m article_mcp server --transport sse --host 0.0.0.0 --port 9000
|
|
@@ -78,49 +76,57 @@ uv run python -m article_mcp server --transport streamable-http --host 0.0.0.0 -
|
|
|
78
76
|
|
|
79
77
|
### Testing
|
|
80
78
|
```bash
|
|
81
|
-
#
|
|
82
|
-
uv run
|
|
79
|
+
# 全量测试
|
|
80
|
+
uv run pytest
|
|
83
81
|
|
|
84
|
-
#
|
|
85
|
-
uv run
|
|
82
|
+
# 跳过打真实外部 API 的用例(CI 用的就是这个)
|
|
83
|
+
uv run pytest -m "not network"
|
|
86
84
|
|
|
87
|
-
#
|
|
88
|
-
uv run
|
|
85
|
+
# 只跑单元测试
|
|
86
|
+
uv run pytest tests/unit/
|
|
89
87
|
|
|
90
|
-
#
|
|
91
|
-
uv run
|
|
92
|
-
|
|
93
|
-
uv run python scripts/test_service_modules.py
|
|
94
|
-
uv run python scripts/test_integration.py
|
|
95
|
-
uv run python scripts/test_performance.py
|
|
88
|
+
# 单个用例
|
|
89
|
+
uv run pytest tests/unit/test_six_tools.py -k test_all_tools_registered
|
|
90
|
+
```
|
|
96
91
|
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
### Quality Checks
|
|
93
|
+
```bash
|
|
94
|
+
uv run ruff check .
|
|
95
|
+
uv run ruff format --check .
|
|
96
|
+
uv run mypy src # 类型检查(CI 与 pre-commit 都会跑)
|
|
97
|
+
uv run python scripts/test_fastmcp_compliance.py # FastMCP 合规性(CI smoke 作业)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> `scripts/` 下只保留不属于测试套件的辅助脚本(合规性检查、客户端兼容性模拟、清理工具),
|
|
101
|
+
> 索引见 `scripts/README.md`。
|
|
99
102
|
pytest tests/unit/ # Unit tests only
|
|
100
103
|
pytest -m integration # Integration tests only
|
|
101
104
|
pytest -m "not slow" # Exclude slow tests
|
|
102
|
-
pytest tests/unit/test_six_tools.py # Test all
|
|
105
|
+
pytest tests/unit/test_six_tools.py # Test all 5 core tools (legacy filename)
|
|
103
106
|
```
|
|
104
107
|
|
|
105
108
|
### Code Quality
|
|
106
109
|
```bash
|
|
107
110
|
# Format code (Ruff formatter - 100x faster than black)
|
|
108
|
-
ruff format
|
|
111
|
+
uv run ruff format .
|
|
109
112
|
|
|
110
113
|
# Lint (Ruff linter - replaces flake8, isort)
|
|
111
|
-
ruff check
|
|
112
|
-
ruff check
|
|
114
|
+
uv run ruff check .
|
|
115
|
+
uv run ruff check . --fix # Auto-fix issues
|
|
113
116
|
|
|
114
117
|
# Type checking
|
|
115
|
-
mypy src
|
|
118
|
+
uv run mypy src
|
|
116
119
|
|
|
117
120
|
# All quality checks
|
|
118
|
-
ruff check
|
|
121
|
+
uv run ruff check . && uv run ruff format --check . && uv run mypy src
|
|
119
122
|
|
|
120
123
|
# Pre-commit hooks (install)
|
|
121
|
-
pre-commit install
|
|
124
|
+
uv run pre-commit install
|
|
122
125
|
```
|
|
123
126
|
|
|
127
|
+
> ruff 0.17 起会一并格式化 Markdown 里的 Python 代码块,因此 `ruff format .` 与
|
|
128
|
+
> CI 的 `ruff format --check .` 覆盖范围一致(含 `docs/`)。
|
|
129
|
+
|
|
124
130
|
### Package Management
|
|
125
131
|
```bash
|
|
126
132
|
python -m build # Build package
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: article-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Article MCP文献搜索服务器 - 基于Europe PMC、arXiv等多个数据源的学术文献搜索工具
|
|
5
5
|
Author-email: gqy20 <qingyu_ge@foxmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,32 +8,32 @@ Project-URL: Homepage, https://github.com/gqy20/article-mcp
|
|
|
8
8
|
Project-URL: Repository, https://github.com/gqy20/article-mcp
|
|
9
9
|
Project-URL: Issues, https://github.com/gqy20/article-mcp/issues
|
|
10
10
|
Keywords: mcp,literature,search,europe-pmc,arxiv,academic
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: fastmcp>=2.
|
|
15
|
-
Requires-Dist: requests>=2.
|
|
16
|
-
Requires-Dist: python-dateutil>=
|
|
17
|
-
Requires-Dist: urllib3>=
|
|
18
|
-
Requires-Dist: aiohttp>=3.
|
|
19
|
-
Requires-Dist: markdownify>=
|
|
20
|
-
Requires-Dist: filelock>=
|
|
14
|
+
Requires-Dist: fastmcp>=4.2.4
|
|
15
|
+
Requires-Dist: requests>=2.34.2
|
|
16
|
+
Requires-Dist: python-dateutil>=4.0.0
|
|
17
|
+
Requires-Dist: urllib3>=2.8.0
|
|
18
|
+
Requires-Dist: aiohttp>=3.14.5
|
|
19
|
+
Requires-Dist: markdownify>=1.2.4
|
|
20
|
+
Requires-Dist: filelock>=4.2.12
|
|
21
21
|
Provides-Extra: dev
|
|
22
|
-
Requires-Dist: pytest>=
|
|
23
|
-
Requires-Dist: pytest-asyncio>=
|
|
24
|
-
Requires-Dist: pytest-cov>=
|
|
25
|
-
Requires-Dist: ruff>=0.
|
|
26
|
-
Requires-Dist: mypy>=
|
|
27
|
-
Requires-Dist: types-requests; extra == "dev"
|
|
28
|
-
Requires-Dist: pre-commit>=
|
|
29
|
-
Requires-Dist: psutil>=
|
|
22
|
+
Requires-Dist: pytest>=9.2.0; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest-asyncio>=1.5.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff>=0.17.6; extra == "dev"
|
|
26
|
+
Requires-Dist: mypy>=2.4.1; extra == "dev"
|
|
27
|
+
Requires-Dist: types-requests>=2.33.0.20261030; extra == "dev"
|
|
28
|
+
Requires-Dist: pre-commit>=4.7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: psutil>=7.2.2; extra == "dev"
|
|
30
30
|
Dynamic: license-file
|
|
31
31
|
|
|
32
32
|
# Article MCP 文献搜索服务器
|
|
33
33
|
|
|
34
34
|
[](https://glama.ai/mcp/servers/@gqy20/article-mcp)
|
|
35
35
|
|
|
36
|
-
基于 FastMCP
|
|
36
|
+
基于 FastMCP v4.2+(MCP SDK 2.x)的异步文献搜索工具,集成 Europe PMC、PubMed、arXiv、CrossRef、OpenAlex 等数据源。
|
|
37
37
|
|
|
38
38
|
## 快速开始
|
|
39
39
|
|
|
@@ -41,10 +41,10 @@ Dynamic: license-file
|
|
|
41
41
|
# 安装
|
|
42
42
|
uvx article-mcp
|
|
43
43
|
|
|
44
|
-
#
|
|
44
|
+
# 或本地开发(需要 Python 3.11+)
|
|
45
45
|
git clone https://github.com/gqy20/article-mcp.git && cd article-mcp
|
|
46
|
-
uv sync
|
|
47
|
-
uv run
|
|
46
|
+
uv sync --extra dev
|
|
47
|
+
uv run article-mcp server
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## 配置
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://glama.ai/mcp/servers/@gqy20/article-mcp)
|
|
4
4
|
|
|
5
|
-
基于 FastMCP
|
|
5
|
+
基于 FastMCP v4.2+(MCP SDK 2.x)的异步文献搜索工具,集成 Europe PMC、PubMed、arXiv、CrossRef、OpenAlex 等数据源。
|
|
6
6
|
|
|
7
7
|
## 快速开始
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
# 安装
|
|
11
11
|
uvx article-mcp
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# 或本地开发(需要 Python 3.11+)
|
|
14
14
|
git clone https://github.com/gqy20/article-mcp.git && cd article-mcp
|
|
15
|
-
uv sync
|
|
16
|
-
uv run
|
|
15
|
+
uv sync --extra dev
|
|
16
|
+
uv run article-mcp server
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 配置
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "article-mcp"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "Article MCP文献搜索服务器 - 基于Europe PMC、arXiv等多个数据源的学术文献搜索工具"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "gqy20", email = "qingyu_ge@foxmail.com"}
|
|
7
7
|
]
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
license = "MIT"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
11
|
keywords = ["mcp", "literature", "search", "europe-pmc", "arxiv", "academic"]
|
|
12
12
|
dependencies = [
|
|
13
|
-
"fastmcp>=2.
|
|
14
|
-
"requests>=2.
|
|
15
|
-
"python-dateutil>=
|
|
16
|
-
"urllib3>=
|
|
17
|
-
"aiohttp>=3.
|
|
18
|
-
"markdownify>=
|
|
19
|
-
"filelock>=
|
|
13
|
+
"fastmcp>=4.2.4",
|
|
14
|
+
"requests>=2.34.2",
|
|
15
|
+
"python-dateutil>=4.0.0",
|
|
16
|
+
"urllib3>=2.8.0",
|
|
17
|
+
"aiohttp>=3.14.5",
|
|
18
|
+
"markdownify>=1.2.4",
|
|
19
|
+
"filelock>=4.2.12",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
[project.urls]
|
|
@@ -29,26 +29,26 @@ article-mcp = "article_mcp.cli:main"
|
|
|
29
29
|
|
|
30
30
|
[project.optional-dependencies]
|
|
31
31
|
dev = [
|
|
32
|
-
"pytest>=
|
|
33
|
-
"pytest-asyncio>=
|
|
34
|
-
"pytest-cov>=
|
|
32
|
+
"pytest>=9.2.0",
|
|
33
|
+
"pytest-asyncio>=1.5.0",
|
|
34
|
+
"pytest-cov>=7.1.0",
|
|
35
35
|
# Ruff: 替代 black + isort + flake8
|
|
36
|
-
"ruff>=0.
|
|
36
|
+
"ruff>=0.17.6",
|
|
37
37
|
# 类型检查
|
|
38
|
-
"mypy>=
|
|
39
|
-
"types-requests",
|
|
38
|
+
"mypy>=2.4.1",
|
|
39
|
+
"types-requests>=2.33.0.20261030",
|
|
40
40
|
# Pre-commit hooks
|
|
41
|
-
"pre-commit>=
|
|
42
|
-
"psutil>=
|
|
41
|
+
"pre-commit>=4.7.0",
|
|
42
|
+
"psutil>=7.2.2"
|
|
43
43
|
]
|
|
44
44
|
|
|
45
45
|
[build-system]
|
|
46
|
-
requires = ["setuptools>=
|
|
46
|
+
requires = ["setuptools>=84.2.1", "wheel>=0.48.0"]
|
|
47
47
|
build-backend = "setuptools.build_meta"
|
|
48
48
|
|
|
49
49
|
# Ruff: 替代 black + isort + flake8
|
|
50
50
|
[tool.ruff]
|
|
51
|
-
target-version = "
|
|
51
|
+
target-version = "py311"
|
|
52
52
|
line-length = 100
|
|
53
53
|
|
|
54
54
|
# Ruff 格式化配置 (替代 black)
|
|
@@ -91,43 +91,6 @@ known-first-party = ["article_mcp", "tests"]
|
|
|
91
91
|
|
|
92
92
|
# mypy per-file ignores (通过 comments 实现,见各文件)
|
|
93
93
|
|
|
94
|
-
[tool.mypy]
|
|
95
|
-
python_version = "3.10"
|
|
96
|
-
explicit_package_bases = true
|
|
97
|
-
ignore_missing_imports = true
|
|
98
|
-
exclude = [
|
|
99
|
-
"build",
|
|
100
|
-
"dist",
|
|
101
|
-
".eggs",
|
|
102
|
-
"src/article_mcp/services/similar_articles.py",
|
|
103
|
-
]
|
|
104
|
-
# 放宽类型检查(逐步修复中)
|
|
105
|
-
warn_return_any = false
|
|
106
|
-
warn_unused_configs = false
|
|
107
|
-
disallow_untyped_defs = false
|
|
108
|
-
disallow_incomplete_defs = false
|
|
109
|
-
check_untyped_defs = false
|
|
110
|
-
disallow_untyped_decorators = false
|
|
111
|
-
no_implicit_optional = false
|
|
112
|
-
warn_redundant_casts = false
|
|
113
|
-
warn_unused_ignores = false
|
|
114
|
-
warn_no_return = false
|
|
115
|
-
warn_unreachable = false
|
|
116
|
-
strict_equality = false
|
|
117
|
-
|
|
118
|
-
[tool.pytest.ini_options]
|
|
119
|
-
minversion = "7.0"
|
|
120
|
-
addopts = "-ra -q --strict-markers --strict-config"
|
|
121
|
-
testpaths = ["tests"]
|
|
122
|
-
python_files = ["test_*.py"]
|
|
123
|
-
python_classes = ["Test*"]
|
|
124
|
-
python_functions = ["test_*"]
|
|
125
|
-
markers = [
|
|
126
|
-
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
127
|
-
"integration: marks tests as integration tests",
|
|
128
|
-
"unit: marks tests as unit tests",
|
|
129
|
-
]
|
|
130
|
-
|
|
131
94
|
[tool.coverage.run]
|
|
132
95
|
source = ["src"]
|
|
133
96
|
omit = [
|