-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
107 lines (94 loc) · 3.19 KB
/
Copy pathpyproject.toml
File metadata and controls
107 lines (94 loc) · 3.19 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
[project]
name = "knowbase"
version = "0.8.0"
description = "Versioned, provenance-grounded knowledge layer over a codebase"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "AGPL-3.0-or-later" }
authors = [{ name = "Dmitry Voropaev" }]
dependencies = [
"tree-sitter>=0.25,<0.26",
"grimp>=3,<4",
"sqlalchemy>=2.0,<3",
"psycopg[binary]>=3.1,<4",
"alembic>=1.13",
"pygit2>=1.14",
"typer>=0.12",
"pydantic>=2.6,<3",
"tree-sitter-python>=0.25.0",
"sqlparse>=0.5.5",
"fastmcp>=3.3,<4",
"pgvector>=0.4,<0.5",
"pyyaml>=6",
]
[project.optional-dependencies]
dev = [
"pytest>=8",
"ruff>=0.6",
"mypy>=1.10",
# fastapi powers the eval oracle (kb introspect) and the Tier-1 API gate only; the serving
# extractor is tree-sitter-static and never imports it.
"fastapi>=0.110",
"pytest-asyncio>=0.23",
# griffe is the static, in-process independent oracle for the Tier-1 library-surface gate only;
# the serving extractor is tree-sitter-static and never imports it.
"griffe>=1.5,<3",
]
# Embedding backend for `kb embed` / search_knowledge / the RAG baseline. Heavy (torch) — kept out
# of the default install so `kb index` stays light; CI uses `uv sync --extra dev --extra embed`.
embed = [
"sentence-transformers>=3,<6",
]
# LLM backend for the optional, nightly, NON-gating LLM-judged A/B (kb.llm + tier3_llm_judge_test).
# Not needed for index/serve/embed; the nightly workflow uses `uv sync --extra dev --extra embed
# --extra llm`. Also makes the existing OpenAI embedding adapter installable.
llm = [
"anthropic>=0.40",
"openai>=1.40",
]
[project.scripts]
kb = "kb.daemon.cli:app"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/kb"]
# Pull torch from the CPU-only wheel index: the default Linux torch wheel bundles CUDA (~2GB+),
# which is useless here (embeddings run on CPU) and would bloat CI. macOS/linux CPU wheels both live
# here, so this keeps local and CI consistent.
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cpu" }
[tool.pytest.ini_options]
testpaths = ["src/kb/eval"]
python_files = ["*_test.py", "test_*.py"]
asyncio_mode = "auto"
[tool.ruff]
target-version = "py312"
line-length = 100
src = ["src"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "B", "C4", "RUF"]
[tool.mypy]
python_version = "3.12"
packages = ["kb"]
mypy_path = "src"
strict = true
# The eval package is tests + their harness; it is validated by running, not by strict typing.
[[tool.mypy.overrides]]
module = ["kb.eval.*"]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"pygit2.*", "grimp.*", "sqlparse.*", "fastapi.*", "starlette.*", "fastmcp.*", "mcp.*",
"sentence_transformers.*", "pgvector.*", "openai.*", "anthropic.*", "yaml.*",
]
ignore_missing_imports = true
# fastmcp's @mcp.tool decorator is untyped (the package is ignore_missing_imports above), so the
# strict disallow_untyped_decorators check can't see through it. The tool bodies stay fully typed.
[[tool.mypy.overrides]]
module = ["kb.mcp.server"]
disallow_untyped_decorators = false