-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
243 lines (217 loc) · 5.56 KB
/
pyproject.toml
File metadata and controls
243 lines (217 loc) · 5.56 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
[project]
name = "agon-python"
dynamic = ["version"]
description = "Adaptive Guarded Object Notation - A schema-driven, token-efficient data interchange format for LLMs"
authors = [
{ name = "Harvey Tseng", email = "harveytseng2@gmail.com" },
]
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.11,<4.0"
keywords = [
"llm",
"json",
"compression",
"tokens",
"schema",
"encoding",
"ai",
"machine-learning",
"data-interchange",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"orjson>=3.11.5",
]
[project.urls]
Repository = "https://github.com/Verdenroz/agon-python"
Issues = "https://github.com/Verdenroz/agon-python/issues"
Documentation = "https://github.com/Verdenroz/agon-python#readme"
Changelog = "https://github.com/Verdenroz/agon-python/releases"
[dependency-groups]
dev = [
# Testing
"pytest>=8.3.5",
"pytest-cov>=4.0.0",
"pytest-sugar>=1.0.0",
"pytest-xdist>=3.8.0",
"tiktoken>=0.5.0", # For benchmark token counting
# Code quality
"ruff>=0.11.9",
"basedpyright>=1.29.1",
"codespell>=2.4.1",
# Development utilities
"pre-commit>=3.6.0",
"nox>=2025.5.1",
"funlog>=0.2.1",
"rich>=14.2.0",
# Documentation
"mkdocs>=1.6.1",
"mkdocs-material>=9.5.0",
# Build
"maturin>=1.10.2",
]
[build-system]
requires = ["maturin>=1.8,<2.0"]
build-backend = "maturin"
[tool.maturin]
# Build from workspace member
manifest-path = "crates/agon-core/Cargo.toml"
# Python source location
python-source = "python"
# Rust module installed as agon.agon_core (hard dependency, cleaner than agon._agon)
module-name = "agon.agon_core"
features = ["pyo3/extension-module"]
# Include LICENSE in source distribution
include = ["LICENSE"]
[tool.ruff]
line-length = 100
target-version = "py311"
src = ["python", "tests"]
[tool.ruff.lint]
select = [
# Pyflakes
"F",
# pycodestyle
"E", "W",
# isort
"I",
# pydocstyle
"D",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# flake8-comprehensions
"C4",
# flake8-implicit-str-concat
"ISC",
# flake8-pytest-style
"PT",
# flake8-return
"RET",
# flake8-self
"SLF",
# flake8-type-checking
"TCH",
# tryceratops
"TRY",
# Ruff-specific rules
"RUF",
]
ignore = [
# Line length handled by formatter
"E501",
# Module import not at top of file (sometimes needed for conditional imports)
"E402",
# Disable some overly strict docstring rules
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D107", # Missing docstring in __init__
# Allow implicit string concatenation for readability
"ISC001",
# Allow raising vanilla exceptions in some cases
"TRY003",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"D", # Don't require docstrings in tests
"SLF001", # Allow private member access in tests
"PT011", # Allow broad pytest.raises
]
[tool.ruff.lint.isort]
known-first-party = ["agon"]
force-sort-within-sections = true
[tool.basedpyright]
include = ["python", "tests"]
executionEnvironments = [
{ root = "tests", reportPrivateUsage = false, reportUnknownParameterType = false },
{ root = "python" },
]
pythonVersion = "3.11"
pythonPlatform = "All"
# Core type checking settings
typeCheckingMode = "strict"
reportMissingTypeStubs = false
reportUnknownVariableType = false
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportMissingParameterType = false
reportUnnecessaryTypeIgnoreComment = true
reportUnusedCallResult = false
# External library adjustments
reportAttributeAccessIssue = false
reportOptionalMemberAccess = false
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-n=auto",
"--strict-markers",
"--strict-config",
"--cov=agon",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-report=xml",
"--cov-fail-under=85",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning:pkg_resources.*",
]
[tool.coverage.run]
source = ["python"]
branch = true
relative_files = true
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
]
[tool.coverage.paths]
source = [
"python/",
".nox/*/lib/python*/site-packages/",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.codespell]
skip = "*.git,*.lock,*.json,__pycache__,*.pyc,*.egg-info,htmlcov,.coverage,coverage.xml,target"