-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
247 lines (232 loc) · 8.6 KB
/
Copy pathpyproject.toml
File metadata and controls
247 lines (232 loc) · 8.6 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "arcllm-sdk"
version = "0.4.9"
description = "The arc connecting you to every LLM. Minimal dependencies, maximum performance."
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
authors = [
{ name = "Dynamiq AI" }
]
keywords = ["llm", "openai", "anthropic", "gemini", "claude", "gpt", "ai", "api", "gateway", "unified", "multi-provider"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
# Pinned-floor runtime dependencies. Adding a new one requires an issue + review.
dependencies = [
"httpx[http2]>=0.28.0", # Sync HTTP client with connection pooling + HTTP/2
"aiohttp>=3.13.0", # Async HTTP client (faster than httpx for async)
"msgspec>=0.21.0", # Fast Struct types + JSON
"orjson>=3.11.0", # Fast JSON for request bodies
]
[project.optional-dependencies]
# `arcllm[tokenize]` — tiktoken-backed token_counter for OpenAI-family
# models. Without it, token_counter falls back to a chars/4 heuristic with a
# one-time warning. Kept optional so the runtime tree stays at 4 deps.
tokenize = [
"tiktoken>=0.7.0",
]
dev = [
# Test runners
"pytest>=9.0.0",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.1.0",
"pytest-timeout>=2.4.0",
"coverage>=7.13.0",
# Lint / type-check
"ruff>=0.15.0",
"mypy>=1.20.0",
"pyright>=1.1.409",
# Optional perf event-loop (Unix only) — bundled into dev so contributors run benchmarks under it
"uvloop>=0.22.0; sys_platform != 'win32'",
# Pull tiktoken into the dev env so the test_tokens.py suite covers the
# accurate-counting path locally.
"tiktoken>=0.7.0",
]
[project.urls]
Homepage = "https://github.com/dynamiq-ai/arcllm"
Documentation = "https://github.com/dynamiq-ai/arcllm#readme"
Repository = "https://github.com/dynamiq-ai/arcllm"
Issues = "https://github.com/dynamiq-ai/arcllm/issues"
[tool.hatch.build.targets.wheel]
packages = ["arcllm"]
[tool.ruff]
target-version = "py310"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # ruff-specific rules
"ANN", # flake8-annotations - ENFORCE TYPE ANNOTATIONS
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"PL", # pylint
"PERF", # perflint - performance anti-patterns
"FURB", # refurb - modern Python
"LOG", # flake8-logging
"RET", # flake8-return
"SLF", # flake8-self
"SLOT", # flake8-slots - enforce __slots__ in classes
"T20", # flake8-print - no print statements in library code
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # function call in default argument
"ANN401", # dynamically typed expressions (Any) - needed for LLM APIs
"ARG001", # unused function argument - kept for API compatibility
"ARG002", # unused method argument - required for interface compatibility
"PERF203", # try/except in loop — only matters on 3.10 and our retry loops are unhappy-path
"PERF401", # use list comprehension - explicit loops can be clearer
"PLR0911", # too many returns - error mapping has many cases
"PLR0912", # too many branches - complex parsing logic is OK
"PLR0913", # too many arguments - LLM APIs have many params
"PLR0915", # too many statements - complex functions are OK
"PLR2004", # magic values - acceptable in tests
"PLW0603", # global statement - needed for connection pooling singletons
"PLC0415", # import not at top - we use lazy imports for performance
"RET504", # unnecessary variable before return - can improve readability
"SLF001", # private member access - needed for testing
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ANN", # Don't require annotations in tests
"ARG", # Unused args OK in tests (fixtures)
"PLR", # Don't care about complexity in tests
"T20", # Print OK in tests
"SLF001", # Private access OK in tests
]
"benchmarks/*" = [
"ANN", # Don't require annotations in benchmarks
"T20", # Print OK in benchmarks
"PLR", # Complexity OK in benchmarks
"PLW1510", # subprocess.run without check= — benchmarks inspect returncode manually
"PTH", # open() vs Path.open() — minor stylistic, not worth churn here
]
"scripts/*" = [
"ANN", # Don't require annotations in scripts
"T20", # Print OK in CLI scripts
"PLR", # Complexity OK in code-gen scripts
"SIM108", # Ternary not always clearer in generators
]
"examples/*" = [
"ANN", # Examples don't need full type annotations
"T20", # Print OK in examples — they exist to be run interactively
"PLR", # Don't enforce complexity caps on examples
"SIM108", # Ternary readability is reader-dependent
"S101", # Bare assert OK
"INP001", # Implicit namespace package OK
]
[tool.ruff.lint.isort]
known-first-party = ["arcllm"]
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
# Optional runtime deps that don't ship PEP 561 type information.
# tiktoken: optional via the ``arcllm[tokenize]`` extra (used in arcllm/tokens.py).
# uvloop: optional speed-up (used in arcllm/__init__.py:install_uvloop).
[[tool.mypy.overrides]]
module = ["tiktoken", "uvloop"]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
filterwarnings = [
"ignore::DeprecationWarning",
]
# CI/CD markers for filtering tests
markers = [
"smoke: Quick smoke tests for CI/CD validation",
"slow: Slow tests that may be skipped in CI",
"integration: All integration tests requiring live API keys",
"live: Tests that fire live provider API calls; only run on the nightly integration workflow",
"openai: OpenAI-specific tests",
"anthropic: Anthropic-specific tests",
"gemini: Google Gemini-specific tests",
"groq: Groq-specific tests",
"together_ai: Together AI-specific tests",
"fireworks_ai: Fireworks AI-specific tests",
"mistral: Mistral-specific tests",
"perplexity: Perplexity-specific tests",
"cohere: Cohere-specific tests",
"deepseek: DeepSeek-specific tests",
]
[tool.coverage.run]
source = ["arcllm"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@abstractmethod",
]
# Omit provider adapters that are thin wrappers with similar patterns
# These adapters follow the same pattern as OpenAI and can be tested
# via integration tests with real API calls
omit = [
"arcllm/providers/bedrock_adapter.py",
"arcllm/providers/cohere_adapter.py",
"arcllm/providers/databricks_adapter.py",
"arcllm/providers/ollama_adapter.py",
"arcllm/providers/vertex_adapter.py",
"arcllm/providers/azure_adapter.py",
"arcllm/providers/mistral_adapter.py",
# Async client networking code is better tested via integration
"arcllm/http/async_client.py",
]
[tool.pyright]
pythonVersion = "3.10"
typeCheckingMode = "strict"
reportMissingImports = true
reportMissingTypeStubs = false
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
reportPrivateUsage = true
reportConstantRedefinition = true
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
reportUntypedFunctionDecorator = true
reportUntypedClassDecorator = true
reportUntypedBaseClass = true
reportUntypedNamedTuple = true
reportCallInDefaultInitializer = false
reportImplicitStringConcatenation = false
reportMissingSuperCall = false