[project]
name = "article-mcp"
version = "0.2.2"
description = "Article MCP文献搜索服务器 - 基于Europe PMC、arXiv等多个数据源的学术文献搜索工具"
authors = [
{name = "gqy20", email = "qingyu_ge@foxmail.com"}
]
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
keywords = ["mcp", "literature", "search", "europe-pmc", "arxiv", "academic"]
dependencies = [
"fastmcp>=2.13.0",
"requests>=2.25.0",
"python-dateutil>=2.8.0",
"urllib3>=1.26.0",
"aiohttp>=3.9.0",
"markdownify>=0.12.0",
"filelock>=3.20.0",
]
[project.urls]
Homepage = "https://github.com/gqy20/article-mcp"
Repository = "https://github.com/gqy20/article-mcp"
Issues = "https://github.com/gqy20/article-mcp/issues"
[project.scripts]
article-mcp = "article_mcp.cli:main"
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
# Ruff: 替代 black + isort + flake8
"ruff>=0.1.0",
# 类型检查
"mypy>=1.0.0",
"types-requests",
# Pre-commit hooks
"pre-commit>=3.0.0",
"psutil>=5.9.0"
]
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
# Ruff: 替代 black + isort + flake8
[tool.ruff]
target-version = "py310"
line-length = 100
# Ruff 格式化配置 (替代 black)
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# Ruff Lint 配置 (替代 flake8 + isort)
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import 排序)
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"N", # pep8-naming
# "D", # pydocstyle (禁用:中文文档不适用)
]
ignore = [
"E501", # line too long (ruff-format 会处理)
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"B904", # raise ... from err (中间件异常处理不适用)
"N806", # 变量名小写 (中文变量名不适用)
]
# Import 排序配置 (替代 isort)
[tool.ruff.lint.isort]
known-first-party = ["article_mcp", "tests"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused-import
"tests/**/*.py" = ["E402", "F841", "F401", "B904", "E722"] # 测试文件允许非顶部导入、未使用变量、裸except
"scripts/**/*.py" = ["E402", "F841", "F401", "B904"] # 脚本文件允许非顶部导入、未使用变量
"src/article_mcp/services/api_utils.py" = ["E402"] # 延迟导入 aiohttp
# mypy per-file ignores (通过 comments 实现,见各文件)
[tool.mypy]
python_version = "3.10"
explicit_package_bases = true
ignore_missing_imports = true
exclude = [
"build",
"dist",
".eggs",
"src/article_mcp/services/similar_articles.py",
]
# 放宽类型检查(逐步修复中)
warn_return_any = false
warn_unused_configs = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disallow_untyped_decorators = false
no_implicit_optional = false
warn_redundant_casts = false
warn_unused_ignores = false
warn_no_return = false
warn_unreachable = false
strict_equality = false
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/.*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.setuptools.packages.find]
where = ["src"]
include = ["article_mcp*"]
[dependency-groups]
dev = [
"psutil>=7.1.2",
]