-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
272 lines (256 loc) · 6.47 KB
/
pyproject.toml
File metadata and controls
272 lines (256 loc) · 6.47 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
272
[project]
name = "crypt"
version = "0.1.0"
description = "Pure Python implementation of common cryptographic algorithms for educational purposes"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [
{ name = "azwpayne", email = "paynewu0719@gmail.com" }
]
keywords = [
"cryptography",
"encryption",
"hash",
"security",
"education",
"aes",
"rsa",
"sha",
"blake2",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Education",
"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",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Security :: Cryptography",
"Typing :: Typed",
]
dependencies = [
"blake3>=0.4",
"cryptography>=42.0",
"pycryptodome>=3.20",
]
[dependency-groups]
dev = [
"poethepoet",
"ruff",
]
test = [
"pytest",
"pytest-xdist[psutil]",
"pytest-parallel",
"pytest-randomly",
"pytest-order",
"pytest-repeat",
"pytest-rerunfailures",
"pytest-timeout",
# Mocking & simulation
"pytest-mock",
"responses",
"moto[all]",
"vcrpy",
"time-machine",
"pytest-socket",
"testcontainers",
# Data generation
"hypothesis",
"faker",
"factory-boy",
"pytest-factoryboy",
"polyfactory",
# Coverage & mutation testing
"pytest-cov",
"coverage[toml]",
"diff-cover",
"mutmut",
"cosmic-ray",
"pytest-deadfixtures",
# Visualization & reporting
"syrupy",
"pytest-html",
"allure-pytest",
"pytest-sugar",
"pytest-instafail",
"pytest-pretty",
"pytest-watcher",
# Performance & resources
# "pytest-benchmark",
"pytest-memray",
"pytest-leaks",
"pytest-profiling",
# Async
"pytest-asyncio",
"pytest-anyio",
# Security & quality
"pytest-bandit",
"safety",
"pytest-mypy",
"pytest-ruff",
# Advanced assertions
"pytest-check",
"pytest-subtests",
"pytest-describe",
]
[tool.poe]
executor.type = "uv"
tasks.full = ["clean", "format"]
tasks.test = [
"clean",
"test-py310",
"test-py311",
"test-py312",
"test-py313",
"test-py314",
"test-py314t",
]
tasks.format = "ruff format"
tasks.lint = "ruff check --fix --unsafe-fixes"
tasks.test-py310 = { shell = "uv run --python 3.10 --group test pytest" }
tasks.test-py311 = { shell = "uv run --python 3.11 --group test pytest" }
tasks.test-py312 = { shell = "uv run --python 3.12 --group test pytest" }
tasks.test-py313 = { shell = "uv run --python 3.13 --group test pytest" }
tasks.test-py314 = { shell = "uv run --python 3.14 --group test pytest" }
tasks.test-py314t = { shell = "uv run --python 3.14t --group test pytest" }
tasks.clean = { shell = """
rm -rf .*_cache htmlcov .coverage .coverage.* .benchmarks reports prof
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
""" }
[tool.pytest.ini_options]
minversion = "8.0"
python_files = ["test_*.py", "*_test.py", "testing.py"]
python_classes = ["Test*", "*Test"]
python_functions = ["test_*", "it_*", "its_*", "check_*"]
pythonpath = ["src", "."]
testpaths = ["tests", "src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
timeout = 300
addopts = [
# Parallel & randomization
"-n=8",
"--randomly-seed=last",
"--dist=loadscope",
# Coverage
"--cov=src",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-report=html:reports/coverage",
"--cov-report=xml:reports/coverage.xml",
"--cov-report=json:reports/coverage.json",
"--cov-fail-under=90",
"--no-cov-on-fail",
# Performance & timeout
"--timeout=300",
"--timeout-method=thread",
"--profile",
"--profile-svg",
# "--benchmark-only",
# "--benchmark-max-time=1.0",
# Visual & experience
"-v",
"--tb=short",
"--strict-markers",
"--strict-config",
"--html=reports/test_report.html",
"--self-contained-html",
# "--sugar",
"--instafail",
# Security & quality
"--bandit",
"--mypy",
"--ruff",
]
filterwarnings = [
# "ignore::pytest_benchmark.logger.PytestBenchmarkWarning",
"error::UserWarning", # Treat warnings as errors
"ignore::DeprecationWarning:pkg_resources.*",
]
markers = [
"unit: Pure unit tests (no IO, <10ms)",
"integration: Integration tests (with DB/HTTP)",
"e2e: End-to-end tests (full user flows)",
"slow: Tests taking >1s to execute",
"flaky: Known unstable tests (needs retry)",
"security: Security-related tests",
"mutation: Mutation testing filter",
"benchmark: Performance benchmark tests",
"snapshot: Snapshot tests",
"property: Hypothesis property-based tests",
]
[tool.pyrefly]
strict = true
# Special config for test directory
[[tool.pyrefly.overrides]]
pattern = "tests/**/*.py"
strict = false
ignore_errors = ["bad-argument-type"]
[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/test_*",
"*/conftest.py",
"*/migrations/*",
"*/venv/*",
]
branch = true
parallel = true
concurrency = ["thread", "multiprocessing"]
[tool.coverage.report]
precision = 2
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.coverage.html]
directory = "reports/coverage"
title = "Coverage Report"
[tool.mutmut]
paths_to_mutate = "src/"
backup = false
runner = "python -m pytest -x --timeout=60"
tests_dir = "tests/"
show_mutations = true
[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101"] # Skip assert checks (pytest uses many asserts)
[tool.mypy]
warn_return_any = false
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = false
warn_no_return = true
follow_imports = "normal"
ignore_missing_imports = true
show_error_codes = true
pretty = true
[tool.pytest-watcher]
now = true
patterns = ["*.py", "*.toml"]
ignore_patterns = ["*.pyc", "__pycache__/*", "reports/*"]
[tool.pytest_benchmark]
min_rounds = 5
min_time = 0.000005
max_time = 1.0
calibration_precision = 10
warmup = true
warmup_iterations = 100000