-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
128 lines (115 loc) · 4.21 KB
/
Copy pathpyproject.toml
File metadata and controls
128 lines (115 loc) · 4.21 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
# CodeRook 项目配置(PEP 621 + Hatch 构建 + 常用工具链)
# ---- PEP 517:声明如何构建 wheel/sdist ----
[build-system]
requires = ["hatchling"] # 构建时需要的后端包
build-backend = "hatchling.build" # 使用 Hatchling 作为构建后端
# ---- 项目元数据与运行时依赖(PEP 621)----
[project]
name = "CodeRook"
version = "0.2.0b1"
description = "Local-first, durable and auditable multi-agent coding runtime"
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "CodeRook contributors" }]
keywords = [
"ai-agent",
"coding-agent",
"developer-tools",
"mcp",
"multi-agent",
"terminal-ui",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
"Typing :: Typed",
]
requires-python = ">=3.12,<3.13" # 仅支持 3.12 小版本范围,与 CI/类型检查一致
dependencies = [
"Pillow>=11.0", # 原生图片缩放和 EXIF 方向处理
"pydantic>=2.0", # 数据校验与序列化(含 JSON 模型等)
"python-dotenv>=1.0", # .env 文件解析
"anthropic>=0.25", # Anthropic LLM SDK(流式 + prompt caching)
"textual>=0.75", # 终端 UI 框架(coderook-tui)
"httpx[socks]>=0.28.1",
"keyring>=25.0",
"pathspec>=0.12",
"unidiff>=0.7,<0.8",
"PyYAML>=6.0,<7", # 提示词模板 YAML 元数据,与正文参数替换分离
]
[project.urls]
Homepage = "https://github.com/kyletser/coderook"
Documentation = "https://github.com/kyletser/coderook/blob/main/docs/README.md"
Repository = "https://github.com/kyletser/coderook.git"
Issues = "https://github.com/kyletser/coderook/issues"
Changelog = "https://github.com/kyletser/coderook/blob/main/CHANGELOG.md"
# 安装后可在 PATH 中执行的入口:`coderook` / `coderook-core` / `coderook-tui`
[project.scripts]
coderook = "code_rook.cli.main:main"
coderook-core = "code_rook.core.app:run"
coderook-tui = "code_rook.tui.__main__:main"
# ---- Hatch:打 wheel 时从 src 布局收录包 ----
[tool.hatch.build]
exclude = [
"/.coderook",
"/.mypy_cache",
"/.pytest_cache",
"/.ruff_cache",
"/.venv",
"/.workbuddy",
"/build",
"/dist",
"/dist-*",
"/editors/vscode/dist",
"/editors/vscode/node_modules",
"/editors/vscode/out",
"/web/node_modules",
"/web/*.tsbuildinfo",
"/reports",
"/vendor/pi/node_modules",
]
[tool.hatch.build.targets.wheel]
packages = ["src/code_rook"] # 源码在 src/code_rook
[tool.hatch.build.targets.wheel.force-include]
"vendor/pi/LICENSE" = "code_rook/licenses/pi-MIT.txt"
# ---- 开发期依赖(PEP 735)----
[dependency-groups]
dev = [
"ruff>=0.4", # 快速 linter + import 排序等
"mypy>=1.10", # 静态类型检查
"types-PyYAML>=6.0",
"pytest>=8.0", # 单元测试
"pytest-asyncio>=0.23", # 异步测试支持
]
# ---- Ruff:统一代码风格 ----
[tool.ruff]
src = ["src"] # 分析路径,便于识别第一方代码
line-length = 100 # 行长上限
target-version = "py312" # 语法/规则按 Python 3.12
[tool.ruff.lint]
select = ["E", "F", "I", "UP"] # pycodestyle 错误、Pyflakes、isort、pyupgrade
ignore = []
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["E501"] # 测试文件的中文注释允许超过行宽限制
"scripts/**/*.py" = ["E501"] # 脚本文件的文档字符串允许超过行宽限制
# ---- Mypy:严格类型检查 ----
[tool.mypy]
python_version = "3.12"
strict = true # 启用严格模式
mypy_path = "src" # 将 src 加入模块搜索路径
explicit_package_bases = true # 明确包根,减少隐式命名空间误判
# ---- Pytest:默认发现 tests/,异步用例自动管理 event loop ----
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
markers = [
"integration: marks tests that call the real Anthropic API (require ANTHROPIC_API_KEY)",
]