-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
226 lines (210 loc) · 6.79 KB
/
pyproject.toml
File metadata and controls
226 lines (210 loc) · 6.79 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "agirails"
version = "3.0.1"
description = "AGIRAILS Python SDK - Agent Commerce Transaction Protocol"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.9"
authors = [
{ name = "AGIRAILS Team", email = "developers@agirails.io" },
]
keywords = [
"blockchain",
"ai-agents",
"escrow",
"payments",
"web3",
"ethereum",
"base",
"actp",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
# Pin upper bounds to prevent breaking changes
"web3>=7.0.0,<8.0.0",
"eth-account>=0.13.0,<0.14.0",
"eth-abi>=5.0.0,<6.0.0",
"eth-utils>=5.0.0,<6.0.0",
# eth-hash is a transitive dep of eth-account but we use it directly
# (AIP-2.1 builders, SmartWalletRouter, server hash routing). Declare
# explicitly so the install doesn't depend on eth-account keeping it
# in its requirement set.
"eth-hash[pycryptodome]>=0.7.0,<1.0.0",
"pydantic>=2.6.0,<3.0.0",
"python-dateutil>=2.8.0,<3.0.0",
"httpx>=0.27.0,<1.0.0",
"typer>=0.12.0,<1.0.0",
"rich>=13.0.0,<14.0.0",
# AGIRAILS.md frontmatter parsing in config.agirailsmd.
"pyyaml>=6.0,<7.0",
"typing_extensions>=4.0.0,<5.0.0;python_version<'3.10'",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=5.0.0",
"respx>=0.21.0", # HTTP mocking (httpx) for receipts/verify tests
# World-class testing additions
"hypothesis>=6.100.0", # Property-based testing
"pytest-benchmark>=4.0.0", # Performance benchmarks
"pytest-xdist>=3.5.0", # Parallel test execution
"pytest-timeout>=2.3.0", # Test timeouts
# Development tools
"black>=24.0.0",
"ruff>=0.6.0",
"mypy>=1.11.0",
"types-python-dateutil>=2.8.0",
]
security = [
"bandit>=1.7.0",
"safety>=3.0.0",
"pip-audit>=2.7.0",
]
mutation = [
"mutmut>=2.4.0", # Mutation testing
]
server = [
"fastapi>=0.110.0", # actp serve daemon (AIP-2.1 quote channel)
"uvicorn>=0.30.0",
]
[project.scripts]
actp = "agirails.cli.main:run"
[project.urls]
Homepage = "https://agirails.io"
Documentation = "https://docs.agirails.io"
Repository = "https://github.com/agirails/sdk-python"
Issues = "https://github.com/agirails/sdk-python/issues"
[tool.hatch.build.targets.wheel]
packages = ["src/agirails"]
[tool.hatch.build.targets.sdist]
# Keep the sdist lean — dev caches, coverage exports, and CI configs are
# noise for PyPI consumers. Tests + scripts stay in (they're useful for
# downstream packagers reproducing the build), but artifacts don't.
exclude = [
"coverage.json",
".coverage",
".coverage.*",
"coverage.xml",
"htmlcov",
".mypy_cache",
".ruff_cache",
".pytest_cache",
".hypothesis",
".benchmarks",
"uv.lock",
"SCRATCHPAD.md",
"CLAUDE.md",
".actp",
".serena",
".ralph",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
pythonpath = ["src"]
addopts = "-v --tb=short -m 'not integration_sepolia and not requires_aa'"
timeout = 30 # Default test timeout in seconds
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests requiring external services",
"integration_sepolia: live Base sepolia integration; needs ACTP_KEY_PASSWORD env + sepolia ETH on the signer (skipped by default; opt-in with `-m integration_sepolia`)",
"requires_aa: needs CDP_API_KEY or PIMLICO_API_KEY for AA bundler/paymaster",
"benchmark: marks performance benchmark tests",
]
[tool.coverage.run]
source = ["src/agirails"]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
fail_under = 85
show_missing = true
[tool.mutmut]
# Scoped to a single file for the inaugural baseline. Once we have a
# kill-rate floor we'll add the other paths back. Runs the targeted
# test module instead of the full suite — each mutation takes ~1-3s
# instead of ~45s, cutting baseline run from hours to ~15 min.
# mutmut 3.x + src-layout + editable install have a structural mismatch:
# mutmut copies src/ to mutants/src/ and chdirs there before running the
# test runner, but the editable install (pip install -e .) keeps
# pointing at the ORIGINAL src/ — so mutated versions are never under
# test. Known limitation; needs either:
# - A custom runner that activates the mutants/ tree (`PYTHONPATH=mutants/src python -m pytest …`)
# - OR a wheel-install style harness where each mutation gets its own
# temporary venv
# - OR move to flat layout (agirails/ at repo root, no src/)
# All three are non-trivial; tracked for 3.1+. The weekly `mutation-test`
# CI job is left wired so it surfaces the same issue on schedule
# rather than silently passing.
paths_to_mutate = ["src/agirails/protocol/proofs.py"]
tests_dir = ["tests/test_protocol/test_proofs.py"]
runner = "python -m pytest"
[tool.black]
line-length = 100
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
[tool.ruff]
line-length = 100
target-version = "py39"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"S", # flake8-bandit (security)
"PTH", # flake8-use-pathlib
"PL", # pylint
]
ignore = [
"E501", # line too long (handled by black)
"B008", # function call in default argument
"B904", # raise without from in except
"S101", # assert used (needed for tests)
"S311", # pseudo-random generators (OK for non-crypto)
"PLR0913", # too many arguments
"PLR2004", # magic value in comparison
]
[tool.bandit]
exclude_dirs = ["tests", "test"]
skips = ["B101"] # assert_used - needed for tests
targets = ["src"]
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = ["web3.*", "eth_account.*", "eth_abi.*"]
ignore_missing_imports = true