-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
251 lines (237 loc) · 9.15 KB
/
pyproject.toml
File metadata and controls
251 lines (237 loc) · 9.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
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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "axonflow"
version = "7.0.0"
description = "AxonFlow Python SDK - Enterprise AI Governance in 3 Lines of Code"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "AxonFlow", email = "hello@getaxonflow.com"}
]
maintainers = [
{name = "AxonFlow", email = "hello@getaxonflow.com"}
]
keywords = [
"ai", "governance", "llm", "openai", "anthropic", "bedrock",
"policy", "compliance", "enterprise", "mcp", "multi-agent"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
requires-python = ">=3.10"
dependencies = [
"httpx>=0.25.0",
"pydantic>=2.0.0",
"tenacity>=8.0.0",
"structlog>=23.0.0",
"cachetools>=5.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"pytest-httpx>=0.22.0",
"mypy>=1.5.0",
"types-cachetools>=5.0.0",
"ruff>=0.1.0",
"black>=23.0.0",
"isort>=5.12.0",
"pre-commit>=3.0.0",
"mcp>=1.0.0",
"langchain-core>=0.3.0",
# pyyaml: used by tests/test_wire_shape.py. Declared explicitly
# rather than relying on transitive availability via langchain-core
# or pre-commit, so the wire-shape gate can't break if either of
# those deps is removed from [dev] in the future.
"pyyaml>=6.0",
]
docs = [
"sphinx>=7.0.0",
"sphinx-rtd-theme>=1.3.0",
"sphinx-autodoc-typehints>=1.24.0",
"myst-parser>=2.0.0",
]
openai = ["openai>=1.0.0"]
anthropic = ["anthropic>=0.18.0"]
langgraph = ["mcp>=1.0.0", "langchain-core>=0.3.0"]
all = [
"openai>=1.0.0",
"anthropic>=0.18.0",
"mcp>=1.0.0",
"langchain-core>=0.3.0",
]
[project.urls]
Homepage = "https://getaxonflow.com"
Documentation = "https://docs.getaxonflow.com/docs/sdk/python-getting-started"
Repository = "https://github.com/getaxonflow/axonflow-sdk-python"
Changelog = "https://github.com/getaxonflow/axonflow-sdk-python/blob/main/CHANGELOG.md"
Issues = "https://github.com/getaxonflow/axonflow-sdk-python/issues"
[tool.setuptools.packages.find]
where = ["."]
include = ["axonflow*"]
[tool.setuptools.package-data]
axonflow = ["py.typed"]
[tool.ruff]
target-version = "py310"
line-length = 100
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # pyupgrade
"ANN", # flake8-annotations
"S", # flake8-bandit (security)
"BLE", # flake8-blind-except
"A", # flake8-builtins
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PGH", # pygrep-hooks
"PL", # pylint
"TRY", # tryceratops
"RUF", # Ruff-specific rules
]
ignore = [
"ANN401", # Dynamically typed expressions (Any)
"COM812", # Trailing comma (conflicts with formatter)
"ISC001", # Single line implicit string concatenation
"PLR0913", # Too many arguments
"TRY003", # Avoid long exception messages
"A001", # Variable shadowing builtin
"A004", # Import shadowing builtin
"RUF022", # Unsorted __all__
"RUF023", # Unsorted __slots__
"RUF100", # Unused noqa
"TC003", # Move stdlib import to type-checking (false positive for pydantic)
"SLF001", # Private member access (needed for structlog context)
"C901", # Too complex (interceptors need nested structure)
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "S105", "S106", "ANN", "PLR2004", "ARG", "PLC0415", "PT011", "PT012", "TC001", "TC002", "UP035", "F401", "F841", "EM101", "TRY301"]
# Cross-platform real-stack harness: a thin process orchestrator (subprocess +
# urllib + global counters in the fake server). The lints flagged below are
# intentional for harness/test infrastructure: subprocess usage with non-shell
# args is safe; Yoda comparisons and global state in the fake server keep the
# code readable; line length nudges are not worth ad-hoc reflows.
"tests/heartbeat-real-stack/**/*.py" = [
"S310", # urlopen — calling a localhost endpoint we just spun up; trusted by construction
"S603", # subprocess — args are constructed by the test, not from user input
"S110", # try/except/pass — silent catch in the fake server is appropriate
"PLR0911", "PLR0912", "PLR0915", # complexity in the orchestrator main()
"PLW0603", # globals — fake server uses module-level counters by design
"PLW1510", # subprocess.run check kwarg — explicit returncode handling instead
"SIM105", "SIM300", # stylistic
"PTH119", "PTH123", # Path vs os.path — old-style is fine for this small file
"BLE001", # bare except in the smoke for "best-effort" health check
"E501", # 100-col over by 2-5 chars on a few descriptive lines
]
"axonflow/adapters/langgraph_wrapper.py" = ["ARG002", "PLC0415", "E501"] # Callback signatures must match base; lazy import of langchain-core
"axonflow/adapters/langchain.py" = ["PLC0415", "A002", "BLE001", "S110", "SIM105"] # Lazy import of langchain-core; `input` matches LangChain interface; broad except is intentional for non-fatal audit
"axonflow/adapters/tool_wrapper.py" = ["PLC0415", "A002", "TRY301"] # Lazy import of langchain-core; `input` matches BaseTool interface; raise in _run_coro_sync try block
"examples/**/*.py" = ["T201", "ANN", "S106", "ERA001", "PLC0415", "F541"] # BLE001 (blind-except) intentionally NOT in this list — examples must demonstrate proper exception handling
"examples/wcp_retry_idempotency.py" = ["T201", "ANN", "S101", "S106", "ERA001", "BLE001", "PLC0415", "F541", "E501"] # E2E validation script: bare asserts + long assertion strings are intentional
"scripts/**/*.py" = ["T201", "ANN", "S106", "BLE001", "UP045", "DTZ005", "PTH123"]
# runtime-e2e/ is the real-stack assertion harness (CLAUDE.md HARD RULE #0):
# driver scripts that hit a real running agent and assert on its real
# responses. These are intentionally not pytest tests; they're standalone
# scripts. The same carve-outs as tests/heartbeat-real-stack/ apply: print()
# is the report channel, monkey-patching httpx is how we force scope-mismatch
# assertions, and broad except is appropriate when inspecting whatever
# wrapped error the SDK surfaces.
"runtime-e2e/**/*.py" = [
"T201", # print — the report channel for these scripts
"ANN", # type annotations — driver scripts, not library code
"BLE001", # blind except — we inspect whatever the SDK wraps
"S101", "S106", # assert / hardcoded fixture creds via env
"PLC0415", # lazy/local imports
"PLR2004", # magic numbers — fine in assertion scripts
"E501", # long descriptive lines
"F541", # f-string without placeholders
"RET504", # explicit return for clarity
"PLR0911", "PLR0912", "PLR0915", # complexity in main()
"SLF001", # private member access (httpx.AsyncClient.request monkey-patch)
]
[tool.ruff.lint.isort]
known-first-party = ["axonflow"]
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
show_error_codes = true
show_column_numbers = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = [
"-v",
"--strict-markers",
"--cov=axonflow",
"--cov-report=term-missing",
"--cov-report=xml",
"--cov-fail-under=75",
]
markers = [
"unit: Unit tests",
"integration: Integration tests (requires live agent)",
"slow: Slow tests",
"wire_shape: Wire-shape contract tests vs OpenAPI specs (requires AXONFLOW_OPENAPI_SPECS_DIR)",
]
[tool.coverage.run]
branch = true
source = ["axonflow"]
omit = ["tests/*", "examples/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]