-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
205 lines (186 loc) · 7.76 KB
/
Copy pathpyproject.toml
File metadata and controls
205 lines (186 loc) · 7.76 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
[project]
name = "evolver"
version = "1.112.0"
description = "A GEP-powered self-evolution engine for AI agents (Python port of @evomap/evolver)"
readme = "README.md"
license = { text = "Apache-2.0" }
requires-python = ">=3.12"
authors = [
{ name = "EvoMap", email = "team@evomap.ai" },
]
keywords = ["evomap", "ai", "evolution", "gep", "meta-learning", "self-repair", "automation", "agent"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"pydantic>=2.9",
"python-dotenv>=1.0",
"httpx[http2]>=0.27",
"cryptography>=43.0",
"filelock>=3.16",
"psutil>=6.0",
"keyring>=25.4",
"mcp>=2.0.0",
"pyyaml>=6.0",
]
[project.optional-dependencies]
# Bedrock SSE relay only (lazy-imported in proxy/router/messages_route.py with
# a not-installed fallback); install with `evolver[bedrock]`.
bedrock = ["boto3>=1.35"]
# S30 dependency layering (系统评估报告「依赖偏重」): webui/proxy server stack
# split from the core evolution engine. fastapi is server-only; plain uvicorn
# already arrives transitively via mcp>=2.0 (stdio transport needs no extras).
# Install with `evolver[server]`.
server = [
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
]
# S25.4 dependency audit (docs/dependency-audit.md): click / pydantic-settings
# / GitPython removed — zero references across src/tests/scripts; boto3 moved
# to the optional `bedrock` extra (3 lazy imports in messages_route.py).
[project.scripts]
evolver = "evolver.cli:main"
[project.urls]
Homepage = "https://evomap.ai"
Repository = "https://github.com/EvoMap/evolver"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/evolver"]
[dependency-groups]
dev = [
# Server stack for proxy/webui tests (S30: also a project extra `server`).
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
# Bedrock SSE relay tests mock the client but need the module present.
"boto3>=1.35",
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-cov>=6.0",
"ruff>=0.7",
"mypy>=1.13",
"respx>=0.21",
"freezegun>=1.5",
"pytest-timeout>=2.4.0",
]
[tool.uv]
default-groups = ["dev"]
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.ruff.lint]
select = [
"E",
"F",
"W",
"I",
"N",
"UP",
"B",
"C4",
"SIM",
"ARG",
"PL",
"RUF",
]
ignore = [
"PLR2004", # magic value comparisons often useful in port
"PLR0913", # many arguments inherited from Node design
# Port-parity / design patterns (see AGENTS.md 坑阱篇 + 演进方案.md §11.4).
# These rules fire on the established Node-mirroring style across the whole
# tree; per-file-ignores below pre-date this global relaxation and remain as
# scoped documentation. Re-enabling any of these requires auditing every
# occurrence first.
"PLC0415", # lazy imports: deliberate — avoid .env-load-order / circular-import / heavy-dep costs
"ARG001", "ARG002", "ARG005", # unused args: Node API-parity signatures, fixtures, dispatch
"PLW0603", # `global` for module-level caches (node_identity._cache etc.)
"PLR0911", "PLR0912", "PLR0915", # many returns/branches/statements in Node-mirroring functions
"PLW2901", # loop-var reuse in port parsers (e.g. `for line in lines`)
"SIM102", "SIM117", # nested-if / multi-with refactors churn port readability
"RUF001", # ambiguous CJK fullwidth punctuation is intentional in regex/commentary
]
[tool.ruff.lint.per-file-ignores]
# Self-contained HTML / embedded hook scripts — line breaks harm readability
"src/evolver/webui/dashboard.py" = ["E501", "RUF001"]
"src/evolver/webui/client/bootstrap.py" = ["E501"]
"src/evolver/adapters/opencode.py" = ["E501"]
"src/evolver/adapters/setup_hooks.py" = ["E501"]
# Proxy route modules — lazy httpx import, nested async with, many error
# returns, and unused `request` param are the established pattern
# (matches messages_route.py).
"src/evolver/proxy/router/gemini_route.py" = ["E501", "PLC0415", "SIM117", "ARG001", "PLR0911"]
"src/evolver/proxy/router/vertex_route.py" = ["E501", "PLC0415", "SIM117", "ARG001", "PLR0911"]
"src/evolver/proxy/router/ollama_route.py" = ["E501", "PLC0415", "SIM117", "ARG001", "PLR0911"]
"src/evolver/proxy/router/responses_route.py" = ["E501", "PLC0415", "SIM117", "ARG001", "PLR0911"]
"src/evolver/proxy/router/messages_route.py" = ["PLC0415", "SIM117", "PLR0911", "ARG001"]
"src/evolver/proxy/router/model_router.py" = ["PLR0911"]
"src/evolver/proxy/router/models_route.py" = ["PLC0415"]
# Lifecycle manager — pre-established async patterns (lazy imports, task creation, ternary)
"src/evolver/proxy/lifecycle/manager.py" = ["B904", "SIM102", "RUF006", "PLC0415", "SIM108", "N817"]
# Observer modules — lazy path imports by design (must defer until .env loaded)
"src/evolver/webui/observer/assets.py" = ["PLC0415", "PLW2901"]
"src/evolver/webui/observer/interactions.py" = ["PLC0415"]
"src/evolver/webui/observer/runs.py" = ["PLC0415"]
"src/evolver/webui/observer/health.py" = ["PLC0415"]
"src/evolver/webui/observer/lifecycle_obs.py" = ["PLC0415"]
"src/evolver/webui/observer/narrative_obs.py" = ["PLW2901"]
"src/evolver/webui/observer/skills.py" = ["PLC0415"]
"src/evolver/webui/observer/commentary_obs.py" = ["PLC0415"]
"src/evolver/webui/server/routes.py" = ["PLC0415"]
# Commentary module — Chinese fullwidth punctuation is intentional
"src/evolver/ops/commentary.py" = ["RUF001", "PLC0415"]
# evolve/utils.py — lazy hashlib import, loop strip() pattern
"src/evolver/evolve/utils.py" = ["PLC0415", "PLW2901"]
# evolve/guards.py — lazy imports for env-var-sensitive paths, pre-existing patterns
"src/evolver/evolve/guards.py" = ["PLC0415", "ARG001", "PLR0911"]
# Observer pipeline_events — lazy path import pattern
"src/evolver/webui/observer/pipeline_events.py" = ["PLC0415"]
# Adapter scripts — lazy imports for env-var-sensitive paths + scope API compat
"src/evolver/adapters/scripts/session_start.py" = ["PLC0415"]
"src/evolver/adapters/scripts/session_end.py" = ["PLC0415", "F841"]
"src/evolver/adapters/scripts/memory_filtering.py" = ["ARG001", "PLR0912"]
# Governance template packet — long literal template lines are content
"tests/scripts/test_harness_governance_check.py" = ["E501"]
# Test-file idioms: fakes with mutable class attrs, generic-exception
# assertions, late fixture imports, regex match= patterns, JS-mirror method
# names (EventSource addEventListener), fire-and-forget create_task
"tests/**" = ["B017", "RUF012", "RUF006", "E402", "RUF043", "N802", "SIM108", "SIM115"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_ignores = true
ignore_missing_imports = true
# Frozen anchor probes / seed assets are standalone scripts (duplicate
# "probe" module names by design; correctness enforced by the anchor suite
# itself when they run), not package source — exclude from module-identity
# checking (round-16: `mypy src` choked on 8 same-named probe.py files).
exclude = "src/evolver/assets/"
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "-ra --strict-markers"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"llm: requires DEEPSEEK_API_KEY — live DeepSeek loop e2e (also marked slow)",
]
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
]