-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
285 lines (255 loc) · 7.9 KB
/
Copy pathpyproject.toml
File metadata and controls
285 lines (255 loc) · 7.9 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
[build-system]
requires = ["setuptools>=82.0.1"]
build-backend = "setuptools.build_meta"
[project]
name = "certamen-core"
dynamic = ["version"]
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE"]
authors = [
{ name="Nikolay Eremeev", email="nikolay.eremeev@outlook.com" },
]
maintainers = [
{ name="Nikolay Eremeev", email="nikolay.eremeev@outlook.com" },
]
description = "Certamen Core: Tournament-based LLM evaluation framework for decision synthesis."
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
keywords = ["llm", "ai", "tournament", "evaluation", "decision-making", "litellm"]
dependencies = [
"litellm>=1.91.1,<1.92.0",
"pyyaml~=6.0",
"colorama~=0.4.6",
"httpx~=0.28.1",
"tiktoken>=0.13.0",
"aiofiles>=24.1,<25.2",
"scikit-learn>=1.9.0,<1.10",
"markdown-it-py~=4.0",
"google-auth~=2.55",
"pydantic~=2.13",
"python-dotenv~=1.2",
]
[project.optional-dependencies]
dev = [
"pytest>=9.1.1,<10",
"pytest-asyncio~=1.4",
"pytest-cov~=7.0",
"pytest-xdist~=3.0",
"hypothesis~=6.156",
"coverage[toml]~=7.14",
"ruff>=0.15.21,<1.0",
"pyright>=1.1.411",
"pre-commit~=4.5",
"mutmut~=3.6",
"radon~=6.0",
"import-linter~=2.13",
"deptry>=0.23,<1.0",
]
gui = [
"aiohttp>=3.14.1,<4.0",
"bcrypt>=5.0.0,<6.0",
"PyJWT>=2.8,<3.0",
"psycopg2-binary>=2.9,<3.0",
]
[project.urls]
"Homepage" = "https://github.com/nikolay-e/certamen-core"
"Bug Tracker" = "https://github.com/nikolay-e/certamen-core/issues"
"Repository" = "https://github.com/nikolay-e/certamen-core"
"Documentation" = "https://github.com/nikolay-e/certamen-core#readme"
"Changelog" = "https://github.com/nikolay-e/certamen-core/blob/main/CHANGELOG.md"
[project.scripts]
certamen = "certamen.interfaces.cli.main:run_from_cli"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.dynamic]
version = {attr = "certamen.__about__.__version__"}
[tool.setuptools.package-data]
certamen = ["*.yml", "*.yaml", "py.typed"]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = [
"-ra",
"-q",
"--strict-markers",
"--strict-config",
"--tb=short",
]
testpaths = ["tests"]
pythonpath = ["src"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
norecursedirs = ["mutants", ".git", ".mypy_cache", ".pytest_cache", "__pycache__"]
# Evidence-based testing configuration
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"hypothesis: property-based tests using Hypothesis framework",
"mutation: tests specifically designed for mutation testing",
]
[tool.coverage.run]
# Evidence: Branch coverage better predicts defect exposure than line coverage
branch = true
source = ["src/certamen"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__init__.py",
"*/conftest.py",
"*/interfaces/web/*",
"*/shared/logging/*",
]
[tool.coverage.report]
# Baseline coverage threshold — execution layer and workflow nodes require real LLM
# calls (--run-real-llm) so they are 0% in CI. Core domain modules are >60% via Makefile.
fail_under = 30
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
# Hypothesis configuration (property-based testing)
# Evidence: Hypothesis finds edge cases that example-based tests miss
[tool.hypothesis]
max_examples = 100
derandomize = true
deadline = 2000 # 2 seconds per test case
[tool.ruff]
line-length = 79
target-version = "py311"
exclude = ["docs/", "site/", "build/", "dist/", "*.ipynb"]
[tool.ruff.lint]
# Comprehensive rule selection for quality and security
select = [
"F", # Pyflakes
"E9", # Runtime errors
"W6", # Deprecated features
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"I", # isort
"N", # pep8-naming
"PLE", # Pylint errors
"PLW", # Pylint warnings
"RUF", # Ruff-specific
"S", # flake8-bandit (security)
"UP", # pyupgrade
]
ignore = [
"E501", # Line too long (handled by ruff formatter)
"RUF012", # Mutable class attributes
"S101", # Assert in tests (expected)
"S311", # random.uniform() for jitter is fine (not crypto)
"S603", # subprocess call - we use it safely
"S607", # subprocess partial path - we use known commands
"N811", # Constant imported as non-constant (alias pattern)
]
[tool.ruff.lint.isort]
known-first-party = ["certamen"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "S108"] # Allow assert and /tmp usage in tests
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"
[tool.pyright]
include = ["src"]
exclude = ["**/__pycache__", "tests", "docs", "benchmarks", "build", "dist"]
pythonVersion = "3.11"
typeCheckingMode = "strict"
# Untyped third-party libs (litellm, sklearn, bcrypt, jwt, psycopg2) ship no
# stubs. The prior mypy config treated them as Any via ignore_missing_imports;
# silencing the Unknown-type reports keeps that stance so strict checking still
# applies fully to our own annotated code without drowning in external noise.
reportMissingTypeStubs = "none"
reportMissingModuleSource = "none"
reportUnknownMemberType = "none"
reportUnknownVariableType = "none"
reportUnknownArgumentType = "none"
reportUnknownLambdaType = "none"
[tool.deptry]
# `dev` extra holds tooling never imported from src; `gui` extra IS imported
# (interfaces/web) so it stays a runtime group deptry checks for usage.
optional_dependencies_dev_groups = ["dev"]
[tool.deptry.package_module_name_map]
PyJWT = ["jwt"]
psycopg2-binary = ["psycopg2"]
[tool.deptry.per_rule_ignores]
# Declared runtime deps that litellm needs but we never import directly —
# pinned defensively so a litellm transitive change can't silently drop them.
DEP002 = ["tiktoken", "aiofiles", "google-auth"]
# Mutation testing configuration
# Evidence: Mutation score correlates with real fault detection
# Note: mutmut 3.x creates mutants/ dir, needs editable install
[tool.mutmut]
paths_to_mutate = [
"src/certamen/domain/",
]
backup = false
# Import Linter - Enforce clean architecture layer boundaries
# Dependency direction: interfaces -> application -> infrastructure -> domain -> ports -> shared
[tool.importlinter]
root_package = "certamen"
include_external_packages = false
[[tool.importlinter.contracts]]
name = "Domain layer independence"
type = "forbidden"
source_modules = ["certamen.domain"]
forbidden_modules = [
"certamen.infrastructure",
"certamen.interfaces",
"certamen.application",
]
[[tool.importlinter.contracts]]
name = "Ports layer independence"
type = "forbidden"
source_modules = ["certamen.ports"]
forbidden_modules = [
"certamen.infrastructure",
"certamen.interfaces",
"certamen.application",
"certamen.domain",
]
[[tool.importlinter.contracts]]
name = "Shared layer independence"
type = "forbidden"
source_modules = ["certamen.shared"]
forbidden_modules = [
"certamen.infrastructure",
"certamen.interfaces",
"certamen.application",
"certamen.domain",
"certamen.ports",
]
[[tool.importlinter.contracts]]
name = "Clean Architecture layer boundaries"
type = "layers"
layers = [
"certamen.interfaces",
"certamen.application",
"certamen.infrastructure",
"certamen.domain",
"certamen.ports",
"certamen.shared",
]