-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
155 lines (142 loc) · 3.96 KB
/
pyproject.toml
File metadata and controls
155 lines (142 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
[project]
name = "med-paper-assistant"
version = "0.5.1"
description = "A medical paper writing assistant using MCP support"
readme = "README.md"
requires-python = ">=3.12"
license = "Apache-2.0"
authors = [{ name = "Eric", email = "medpaper@example.com" }]
keywords = ["medical", "paper", "assistant", "mcp", "pubmed"]
# ============================================
# 核心依賴 (最小化 - 純 MCP 架構)
# ============================================
dependencies = [
"mcp>=1.0.0",
"pydantic>=2.0.0",
"pandas>=2.0.0",
"tabulate>=0.9.0",
"python-docx>=1.0.0",
"requests>=2.28.0",
"pyyaml>=6.0.0",
"structlog>=25.5.0",
"scipy>=1.17.0",
"pypandoc>=1.16.2",
"citeproc-py>=0.6.0",
]
# ============================================
# 可選依賴 (功能擴展)
# ============================================
[project.optional-dependencies]
# 開發模式:直接使用 submodule
pubmed = [
"biopython>=1.80",
"pubmed-search-mcp",
]
creativity = [
"creativity-generation-unit",
]
analysis = [
"matplotlib>=3.7.0",
"scipy>=1.10.0",
"seaborn>=0.12.0",
"pypdf>=3.0.0",
]
# 學術出版工具鏈(CSL 引用 + Pandoc 匯出)
publishing = [
"pypandoc>=1.13",
"lxml>=4.9.0",
]
# 完整安裝(開發用)
all = [
"med-paper-assistant[pubmed,creativity,analysis,publishing]",
]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-asyncio>=0.21.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
]
[project.scripts]
med-paper-assistant = "med_paper_assistant:run_server"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/med_paper_assistant"]
# ============================================
# 依賴群組 (uv 推薦格式)
# ============================================
[dependency-groups]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-asyncio>=0.21.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
"bandit>=1.9.2",
"vulture>=2.14",
"pre-commit>=4.5.1",
"pytest-timeout>=2.0.0",
"types-requests>=2.28.0",
"types-tabulate>=0.9.0",
"types-pyyaml>=6.0.12.20250915",
]
# ============================================
# uv 工具配置:Submodule 可編輯安裝
# ============================================
[tool.uv.sources]
pubmed-search-mcp = { path = "integrations/pubmed-search-mcp", editable = true }
creativity-generation-unit = { path = "integrations/cgu", editable = true }
# ============================================
# Ruff 程式碼品質工具
# ============================================
[tool.ruff]
line-length = 100
target-version = "py312"
extend-exclude = ["vscode-extension/bundled"]
[tool.ruff.lint]
select = ["E", "F", "I", "W"]
ignore = ["E501"]
# ============================================
# Pytest 配置
# ============================================
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
asyncio_mode = "auto"
addopts = "-m 'not integration and not slow'"
timeout = 60
markers = [
"slow: marks tests as slow (deselect with '-m not slow')",
"integration: marks tests requiring external services",
]
# ============================================
# MyPy 類型檢查
# ============================================
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
warn_unreachable = true
ignore_missing_imports = true
# Disable checks that conflict with python-docx / loosely-typed JSON APIs
disable_error_code = [
"no-any-return", # JSON/dict returns often Any
"attr-defined", # python-docx types not fully annotated
"valid-type", # python-docx Document type issues
]
[[tool.mypy.overrides]]
module = [
"docx.*",
"pandas.*",
"scipy.*",
"matplotlib.*",
]
ignore_errors = true
# ============================================
# Bandit 安全性掃描
# ============================================
[tool.bandit]
targets = ["src"]
skips = ["B101"] # assert is fine in non-production code