forked from smartbugs/oyente
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
271 lines (249 loc) · 6.98 KB
/
pyproject.toml
File metadata and controls
271 lines (249 loc) · 6.98 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
[build-system]
requires = ["poetry-core>=1.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[project]
name = "oyente_plus"
version = "1.0.0"
description = "An analysis tool for smart contracts"
authors = [{ name = "Thomas Fenninger" }]
readme = "README.md"
license = { text = "GPL-3.0" }
# Python 3.12.0 is excluded due to upstream library incompatibilities present
# specifically in the initial 3.12.0 release; patch releases (3.12.1+) resolve
# these issues and are allowed.
requires-python = ">=3.9,!=3.12.0,<4.0"
dependencies = [
"requests>=2.25.0",
"web3>=6.0.0",
"z3-solver==4.14.1.0",
"crytic-compile==0.3.8",
"solc-select>=1.0.0",
"cbor2>=5.0.0",
"ethutils @ git+https://github.com/gsalzer/ethutils.git@main",
]
[project.scripts]
oyente = "oyente.oyente:main"
[project.urls]
Homepage = "https://github.com/smartbugs/oyente_plus"
Repository = "https://github.com/smartbugs/oyente_plus"
Issues = "https://github.com/smartbugs/oyente_plus/issues"
Documentation = "https://github.com/smartbugs/oyente_plus/blob/main/README.md"
[tool.poetry]
name = "oyente_plus"
version = "1.0.0"
description = "An analysis tool for smart contracts"
authors = ["Thomas Fenninger"]
readme = "README.md"
license = "GPL-3.0"
packages = [{ include = "oyente" }]
# Maintained for compatibility - prefer [project] section above
package-mode = true
[tool.poetry.dependencies]
# Keep in sync with [project.requires-python]. Exclude 3.12.0 due to
# transient upstream incompatibilities in that specific patch release; 3.12.1+
# are permitted.
python = ">=3.9,!=3.12.0,<4.0"
requests = ">=2.25.0"
web3 = ">=6.0.0"
z3-solver = "4.14.1.0"
crytic-compile = "0.3.8"
solc-select = ">=1.0.0"
cbor2 = ">=5.0.0"
ethutils = {git = "https://github.com/gsalzer/ethutils.git", branch = "main"}
[tool.poetry.group.dev.dependencies]
# Build and dependency management
poetry = ">=2.0.0"
# Code formatting and linting
black = ">=24.0.0"
ruff = ">=0.7.0"
mypy = ">=1.8.0"
pre-commit = ">=3.0.0"
# Testing framework and plugins
pytest = ">=8.0.0"
pytest-cov = ">=4.0.0"
pytest-mock = ">=3.10.0"
pytest-xdist = ">=3.2.0"
pytest-benchmark = ">=4.0.0"
pytest-sugar = ">=0.9.0"
pytest-clarity = ">=1.0.0"
pytest-timeout = ">=2.1.0"
# Test data generation
hypothesis = ">=6.68.0"
factory-boy = ">=3.2.0"
faker = ">=18.0.0"
[tool.black]
line-length = 120
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
extend-exclude = '''
/(
# Directories
\.git
| \.mypy_cache
| \.pytest_cache
| \.ruff_cache
| \.tox
| \.venv
| venv
| build
| dist
| web/node_modules
)/
'''
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
# "I", # isort # conflict with black
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"S", # flake8-bandit (security)
"T20", # flake8-print
"SIM", # flake8-simplify
"N", # pep8-naming
"RUF", # ruff-specific rules
]
ignore = [
"E501", # line too long (handled by black)
"B008", # do not perform function calls in argument defaults
"S101", # use of assert (common in tests)
"T201", # print statements (allow for debugging/logging)
"S608", # possible SQL injection (allow for dynamic queries)
"UP007", # use X | Y for type annotations (compatibility with older Python)
"I", # isort # conflict with black
]
exclude = [
".git",
".mypy_cache",
".pytest_cache",
".ruff_cache",
".tox",
".venv",
"venv",
"build",
"dist",
"web/node_modules",
"__pycache__",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports in __init__ files
"test_*.py" = ["S101", "B018"] # allow asserts and unused expressions in tests
"tests/*" = ["S101", "B018"] # allow asserts and unused expressions in tests
"tests/integration/*" = ["S101", "B018", "S603"] # allow subprocess in integration tests
"oyente/test_evm/*" = ["S101"] # allow asserts in test files
[tool.ruff.lint.isort]
known-first-party = ["oyente"]
force-single-line = true
lines-after-imports = 2
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
[tool.mypy]
python_version = "3.9"
platform = "linux"
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
strict_optional = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_decorators = false
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
show_column_numbers = true
pretty = true
exclude = ["^venv/", "^build/", "^dist/", "^web/", "test_evm/test_data/"]
# Gradual typing - start strict for new modules
[[tool.mypy.overrides]]
module = ["oyente.new_module", "oyente.utils.*"]
disallow_untyped_defs = true
disallow_incomplete_defs = true
strict = true
# Relaxed rules for test files
[[tool.mypy.overrides]]
module = ["tests.*", "oyente.test_evm.*"]
disallow_untyped_defs = false
ignore_errors = true
# Ignore z3 library as it doesn't have type stubs
[[tool.mypy.overrides]]
module = ["z3", "z3.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--tb=auto",
"--maxfail=1",
"--verbose",
"-m", "not integration", # Exclude integration tests by default
]
testpaths = ["tests"]
norecursedirs = [".*venv*", "build", "dist", ".git", ".pytest_cache", ".mypy_cache", ".ruff_cache"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"property: marks tests as property-based tests",
"performance: marks tests as performance tests",
"requires_z3: marks tests that require Z3 solver",
"requires_solc: marks tests that require Solidity compiler",
"smoke: marks tests as smoke tests (critical path)",
"regression: marks tests as regression tests",
"fuzzing: marks tests as fuzz tests",
"mutation: marks tests as mutation tests",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
xfail_strict = true
junit_family = "xunit2"
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*", "*Tests"]
python_functions = ["test_*"]
[tool.coverage.run]
source = ["oyente"]
omit = [
"*/test_*",
"*/tests/*",
"*/venv/*",
"*/build/*",
"*/dist/*",
"*/test_evm/*",
"setup.py",
"*/__init__.py",
]
parallel = false
branch = false
[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",
"if TYPE_CHECKING:",
"except ImportError:",
"pass",
]
show_missing = true
precision = 2