-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
275 lines (252 loc) · 5.75 KB
/
pyproject.toml
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
273
274
275
[tool.poetry]
name = "python-tool-competition-2024"
version = "0.2.0"
description = "Pipeline to create test generators"
authors = ["Nicolas Erni <[email protected]>"]
readme = "README.md"
packages = [{include = "python_tool_competition_2024"}]
license = "GPL-3.0-or-later"
[tool.poetry.dependencies]
python = "^3.9"
pytest = "^7.3.2"
pytest-cov = "^4.1.0"
rich = "^13.4.2"
click = "^8.1.3"
defusedxml = "^0.7.1"
toml = "^0.10.2"
mutpy = "^0.6.1"
cosmic-ray = "^8.3.7"
typing-extensions = "^4.7.1"
importlib-metadata = {version = "^6.8.0", python = "<3.10"}
[tool.poetry.group.linter.dependencies]
ruff = ">=0.2.2, <0.3"
vulture = "^2.7"
pip-audit = "^2.5.6"
black = "^24.2.0"
mypy = "^1.4.0"
bandit = "^1.7.5"
types-toml = "^0.10.8.7"
[tool.poetry.scripts]
python-tool-competition-2024 = 'python_tool_competition_2024.cli:main_cli'
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.plugins."python_tool_competition_2024.test_generators"]
dummy = "python_tool_competition_2024.generators:DummyTestGenerator"
[tool.pytest.ini_options]
markers = [
'linter: all tests that run external linters which are usually slow',
]
addopts = [
# show the slowest 10 tests
'--durations=10',
'--cov=python_tool_competition_2024',
'--cov-report=html',
'--cov-report=xml',
'--cov-report=term',
'--ignore=results',
]
# disable detection of classes starting with Test
# inherit from unittest.TestCase to test them
python_classes = ''
# treat all warnings as exceptions
filterwarnings = ["error"]
[tool.mypy]
mypy_path = "stubs"
show_error_codes = true
show_absolute_path = true
show_column_numbers = true
strict_optional = true
warn_no_return = true
disallow_any_unimported = true
# Across versions of mypy, the flags toggled by --strict vary. To ensure
# we have reproducible type check, we instead manually specify the flags
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = 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_return_any = true
warn_unreachable = true
implicit_reexport = false
strict_equality = true
# Disallow any
disallow_any_explicit = true
disallow_any_decorated = true
exclude = [
'.venv',
'.tox',
'python_tool_competition_2024/templates',
]
[tool.coverage.run]
branch = true
omit = [
"python_tool_competition_2024/templates/targets/*",
]
[tool.coverage.report]
exclude_lines = [
"@(abc\\.)?abstractmethod",
"@(abc\\.)?abstractproperty",
"@(typing\\.)?overload",
"if (typing\\.)?TYPE_CHECKING:",
"class .*\\((|.*, ?)Protocol(|,.*)\\):",
"# pragma: no cover",
]
fail_under = 100
sort = 'Cover'
show_missing = true
[tool.vulture]
paths = ['python_tool_competition_2024']
ignore_decorators = [
"@pytest.fixture",
]
ignore_names = [
'side_effect',
'return_value',
]
exclude = [
'python_tool_competition_2024/templates',
]
[tool.ruff]
target-version = "py39"
extend-exclude = ["python_tool_competition_2024/templates"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# custom documentation rules
"D406",
"D407",
# handled by black:
"COM812",
# don't require self and cls to have types
"ANN101",
"ANN102",
# allow relative imports from parents
"TID252",
# don't separate typing imports
"TCH",
]
# Avoiding flagging (and removing) `V101` from any `# noqa`
# directives, despite Ruff's lack of support for `vulture`.
# See: https://github.com/jendrikseipp/vulture/blob/ecdda25a3bad37b9769e4defa93e8e26c547a1b9/vulture/core.py#L31:#L40
external = [
"V101", # unused attribute
"V102", # unused class
"V103", # unused function
"V104", # unused import
"V105", # unused method
"V106", # unused property
"V107", # unused variable
"V201", # unreachable code
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
# ignore missing docstrings
"D1",
# ignore asserts
"S101",
# ignore method calls in function defaults for hypothesis composites
"B008",
# allow magic numbers in tests
"PLR2004",
# allow accessing private members in tests
"SLF001",
]
"python_tool_competition_2024/templates/targets/**/*.py" = [
# ignore missing __init__.py
"INP001",
]
"results/**/*.py" = [
# ignore missing docstrings
"D1",
]
"stubs/**/*.pyi" = [
# ignore missing docstrings
"D1",
# ignore unused arguments
"ARG001",
# ignore missing __init__.py
"INP001",
# ignore bool params, because the library chose it this way
"FBT001",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-pytest-style]
parametrize-values-type = "tuple"
[tool.bandit]
exclude_dirs = [".tox", ".venv"]
# disable tests covered by ruff
# see: https://github.com/charliermarsh/ruff/issues/1646
skips = [
"B101",
"B102",
"B103",
"B104",
"B105",
"B106",
"B107",
"B108",
"B110",
"B112",
"B113",
# "B201",
# "B202",
"B301",
"B302",
"B303",
"B304",
"B305",
"B306",
"B307",
"B308",
"B310",
"B311",
"B312",
"B313",
"B314",
"B315",
"B316",
"B317",
"B318",
"B319",
"B320",
"B321",
# "B322", # missing
"B323",
"B324",
"B501",
# "B502",
# "B503",
# "B504",
# "B505",
"B506",
# "B507",
"B508",
"B509",
"B608",
# "B601",
"B602",
"B603",
"B604",
"B605",
"B606",
"B607",
"B608",
# "B609",
# "B610",
# "B611",
"B612",
"B701",
# "B702",
# "B703",
]
[tool.black]
skip_magic_trailing_comma = true
extend_exclude = "python_tool_competition_2024/templates"