-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathpyproject.toml
More file actions
211 lines (184 loc) · 5.77 KB
/
Copy pathpyproject.toml
File metadata and controls
211 lines (184 loc) · 5.77 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
[build-system]
requires = ["hatchling>=1.25.0,<2"]
build-backend = "hatchling.build"
[project]
name = "lean-spec"
version = "0.0.1"
description = "Lean Ethereum protocol specifications"
readme = "README.md"
authors = [
{ name = "Ethereum Foundation", email = "thomas.coratger@ethereum.org" },
]
keywords = [
"lean",
"beam",
"ethereum",
"specifications",
"protocol",
"consensus",
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
requires-python = ">=3.12"
dependencies = [
"pydantic>=2.12.0,<3",
"typing-extensions>=4.4",
"lean-multisig-py>=0.0.9",
"httpx>=0.28.0,<1",
"aiohttp>=3.11.0,<4",
"cryptography>=46.0.0",
"numpy>=2.0.0,<3",
"numba>=0.61.0,<1",
"aioquic>=1.2.0,<2",
"pyyaml>=6.0.0,<7",
"prometheus-client>=0.21.0,<1",
]
[project.license]
file = "LICENSE"
[project.urls]
Homepage = "https://github.com/leanEthereum/leanSpec"
Source = "https://github.com/leanEthereum/leanSpec"
Issues = "https://github.com/leanEthereum/leanSpec/issues"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build]
exclude = [".*", "tests/", "docs/"]
[tool.hatch.build.targets.wheel]
packages = ["src/lean_spec"]
[tool.ruff]
line-length = 100
# The vulture whitelist is data for dead-code detection, not executable code.
# It references symbols by bare name, which is not valid standalone Python.
extend-exclude = ["vulture_whitelist.py"]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
# D213 is selected by exact code: the google convention would otherwise disable it.
# It forces multi-line docstring summaries onto the second line (after the opening quotes).
select = ["E", "F", "B", "W", "I", "A", "N", "D", "D213", "C", "TID"]
fixable = ["I", "B", "E", "F", "W", "D", "C", "TID"]
ignore = ["D205", "D203", "D212", "D415", "C901", "A005", "C420"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-bugbear]
# These types are immutable, so constructing one as an argument default is safe.
# Uint64 and ValidatorIndex are frozen integer types; the fork facade is stateless.
extend-immutable-calls = [
"lean_spec.spec.ssz.Uint64",
"lean_spec.spec.forks.ValidatorIndex",
"lean_spec.spec.forks.lstar.spec.LstarSpec",
]
[tool.ruff.lint.isort]
combine-as-imports = true
force-single-line = false
known-first-party = ["lean_spec", "consensus_testing"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D"]
"src/lean_spec/spec/crypto/xmss/constants.py" = ["N802"]
[tool.ty.environment]
python-version = "3.12"
[tool.ty.src]
exclude = [".claude/", "vulture_whitelist.py"]
[tool.ty.rules]
# Flag any suppression comment that no longer matches a real diagnostic.
# Keeps the ignore set honest as the code evolves and prevents stale or duplicate suppressions.
unused-ignore-comment = "error"
[tool.ty.terminal]
error-on-warning = true
[tool.pytest.ini_options]
minversion = "8.3.3"
testpaths = ["tests"]
python_files = "test_*.py"
pythonpath = ["."]
addopts = [
"-ra",
"--strict-markers",
"--cov=src",
"--cov-report=term-missing",
"--cov-report=html",
"--cov-branch",
# Exclude fixture generation tests from regular test runs
# These are only run via the 'fill' command
"--ignore=tests/consensus",
"--ignore=tests/execution",
# Exclude interop tests from regular test runs
# Run explicitly with: uv run pytest tests/interop/ -v
"--ignore=tests/interop",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"valid_until: marks tests as valid until a specific fork version",
"interop: integration tests for multiple leanSpec nodes",
"num_validators: number of validators for interop test cluster",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
timeout = 600
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
fail_under = 90
[tool.vulture]
# Scan source, the testing framework, the test tree, and the whitelist together.
# Most spec code is exercised only through the test suite, so the tests must be
# in scope or every test-only-used symbol shows up as a false positive.
# The whitelist names the indirectly-used symbols vulture cannot see; listing
# them explicitly keeps the ignores tight instead of relying on wide globs.
paths = ["src", "packages", "tests", "vulture_whitelist.py"]
# Skip build artifacts under packages, which duplicate the real source and would
# otherwise report every package symbol twice.
exclude = ["*/build/*"]
# Show the largest unused blocks first; they are the highest-value removals.
sort_by_size = true
[tool.mdformat]
number = true
wrap = 80
[tool.uv]
required-version = ">=0.7.0"
[tool.uv.workspace]
members = ["packages/*"]
[tool.uv.sources]
lean-ethereum-testing = { workspace = true }
lean-multisig-py = { git = "https://github.com/anshalshukla/leanMultisig-py", tag = "v0.0.9" }
[dependency-groups]
test = [
"pytest>=8.3.3,<9",
"pytest-cov>=6.0.0,<7",
"pytest-xdist>=3.6.1,<4",
"pytest-asyncio>=1.0.0",
"pytest-timeout>=2.2.0,<3",
"hypothesis>=6.138.14",
"lean-ethereum-testing",
"lean-multisig-py>=0.0.9",
"pycryptodome>=3.20.0,<4",
]
lint = [
"ty>=0.0.1a34",
"ruff>=0.13.2,<1",
"codespell>=2.4.1,<3",
"vulture>=2.14,<3",
]
docs = [
"mkdocs>=1.6.1,<2",
"mkdocs-material>=9.5.45,<10",
"mkdocstrings[python]>=0.27.0,<1",
"mdformat==0.7.22",
]
dev = [
{include-group = "test"},
{include-group = "lint"},
{include-group = "docs"},
"ipython>=8.31.0,<9",
"ipdb>=0.13",
"tomli-w>=1.0.0",
"build>=1.2.0,<2",
"twine>=5.1.0,<6",
]