-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathpyproject.toml
More file actions
174 lines (159 loc) · 5.15 KB
/
Copy pathpyproject.toml
File metadata and controls
174 lines (159 loc) · 5.15 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "knowledge-rag"
version = "4.8.5"
description = "Local RAG System for Claude Code — Hybrid search + Cross-encoder Reranking + 13 MCP Tools + 20 Format Parsers. Zero external servers."
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.11"
authors = [
{name = "Lyon.", email = "lyonzin@users.noreply.github.com"},
]
keywords = [
"rag", "mcp", "claude-code", "semantic-search", "embeddings",
"chromadb", "bm25", "reranking", "knowledge-base", "local-ai",
"fastembed", "retrieval-augmented-generation", "hybrid-search",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Text Processing :: Indexing",
]
dependencies = [
"chromadb>=1.4.0",
"pymupdf>=1.23.0",
"fastembed[reranking]>=0.4.0",
"mcp>=2.0.0,<3.0.0",
"numpy>=1.24.0",
"requests>=2.33.0",
"beautifulsoup4>=4.12.0",
"python-docx>=1.0.0",
"openpyxl>=3.1.0",
"python-pptx>=1.0.0",
"watchdog>=4.0.0",
"pyyaml>=6.0",
]
[project.optional-dependencies]
gpu = [
"onnxruntime-gpu>=1.14.0",
"nvidia-cublas-cu12",
"nvidia-cudnn-cu12",
"nvidia-cuda-runtime-cu12",
"nvidia-cufft-cu12",
"nvidia-cusparse-cu12",
"nvidia-cusolver-cu12",
"nvidia-curand-cu12",
"nvidia-nvjitlink-cu12",
]
server = ["uvicorn>=0.20.0"]
[project.urls]
Homepage = "https://github.com/lyonzin/knowledge-rag"
Repository = "https://github.com/lyonzin/knowledge-rag"
Issues = "https://github.com/lyonzin/knowledge-rag/issues"
Changelog = "https://github.com/lyonzin/knowledge-rag/releases"
[project.scripts]
knowledge-rag = "mcp_server.server:main"
knowledge-rag-guarded = "mcp_server.guarded:guarded_main"
[tool.hatch.build.targets.wheel]
packages = ["mcp_server"]
[tool.hatch.build.targets.wheel.force-include]
"config.example.yaml" = "mcp_server/data/config.example.yaml"
"presets/cybersecurity.yaml" = "mcp_server/data/cybersecurity.yaml"
"presets/developer.yaml" = "mcp_server/data/developer.yaml"
"presets/research.yaml" = "mcp_server/data/research.yaml"
"presets/general.yaml" = "mcp_server/data/general.yaml"
[tool.hatch.build.targets.sdist]
include = [
"mcp_server/",
"documents/examples/",
"config.example.yaml",
"presets/",
"README.md",
"LICENSE",
"pyproject.toml",
"requirements.txt",
]
exclude = [
"data/",
"documents/security/",
"documents/ctf/",
"documents/logscale/",
"documents/development/",
"documents/general/",
"documents/aar/",
"venv/",
"__pycache__/",
"*.pyc",
"scripts/",
".gitignore",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
# Limit retained tmp_path directories to avoid pytest's atexit cleanup race
# on Windows (cleanup_numbered_dir + pathlib.glob "garbage-*" can fail when
# many tmp dirs accumulate). Tests run isolated; we don't need history.
tmp_path_retention_count = 1
tmp_path_retention_policy = "failed"
markers = [
"chaos: failure-injection tests run in nightly workflow only",
]
# Default: skip chaos tests in regular pytest runs (PR + local).
# Nightly workflow opts in with `pytest -m chaos`.
addopts = "-m 'not chaos'"
[tool.ruff]
target-version = "py311"
line-length = 120
[tool.ruff.lint]
select = ["E", "F", "W", "I"]
ignore = ["E501"] # Line length handled by formatter
[tool.ruff.lint.per-file-ignores]
"mcp_server/server.py" = ["E402"] # stdout redirect must happen before imports
[tool.coverage.run]
source = ["mcp_server"]
[tool.coverage.report]
show_missing = true
fail_under = 35
# ── mypy: strict gradual rollout (Pillar 7) ─────────────────────────────────
# Strict mode is enabled GLOBALLY but with a per-module exclusion list while
# we incrementally annotate the legacy modules. The CI job runs strict on the
# allowlist below; new modules are added as they earn full annotations.
[tool.mypy]
# Pinned to 3.12 to match the CI runtime (Python 3.12) and to accept PEP 695
# ``type`` statements that recent third-party stubs (e.g. numpy/__init__.pyi)
# emit. The package itself still supports Python 3.11+ at runtime — this
# setting only governs the static-analysis target.
python_version = "3.12"
strict = true
show_error_codes = true
warn_unused_configs = true
warn_unreachable = true
ignore_missing_imports = true # third-party libs (chromadb, fastembed, etc.) often lack stubs
# ── interrogate: docstring coverage (Pillar 7) ──────────────────────────────
[tool.interrogate]
fail-under = 80
verbose = 1
quiet = false
exclude = [
"tests",
"bench",
"scripts",
"build",
"dist",
"venv",
".venv",
]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
ignore-property-decorators = true
ignore-private = true
ignore-semiprivate = true