-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
272 lines (255 loc) · 5.12 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
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
log_level = "INFO"
testpaths = ["tests"]
timeout = 300
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
"ignore:pkg_resources is deprecated as an API",
"ignore:Deprecated call to `pkg_resources\\.declare_namespace\\('.*'\\):DeprecationWarning"
]
[tool.coverage.run]
data_file = "/tmp/.coverage"
include = ["*/onegov/*"]
omit = ["*/tests/*", "**/upgrade.py"]
[tool.coverage.report]
ignore_errors = true
exclude_lines = [
"pragma: no cover",
"pragma: unreachable",
"assert_never[(]",
"@overload",
"raise NotImplementedError",
"raise AssertionError[(].unreachable.[)]",
"if TYPE_CHECKING:",
"if __name__ == .__main__."
]
[tool.mypy]
python_version = "3.11"
follow_imports = "silent"
namespace_packages = true
explicit_package_bases = true
strict = true
implicit_reexport = true
warn_unreachable = true
warn_return_any = false
# FIXME: remove sqlalchemy when upgrading to SQlAlchemy 2.0
untyped_calls_exclude = "sqlalchemy,pycurl,onegov.core.types"
plugins = "sqlmypy"
mypy_path = "$MYPY_CONFIG_FILE_DIR/src:$MYPY_CONFIG_FILE_DIR/stubs"
[[tool.mypy.overrides]]
# ignore missing imports for packages that have no stubs available
module = [
# FIXME: Do we really need this? We have this implemented ourselves
# in OCQMS, so we could just copy that code over... plus the
# standard lib technically supports some ISO-8601 formats as well
"isodate.*",
# TODO: Consider switching to fasttext-langdetect
# langdetect is really, really slow by comparison...
"langdetect.*",
# FIXME: Remove after https://github.com/lipoja/URLExtract/issues/164
"urlextract.*",
]
ignore_missing_imports = true
[tool.bandit]
exclude_dirs = [
"tests",
"*/**/upgrade.py",
"*/**/upgrades.py"
]
skips = [
# ignore asserts
"B101",
# ignore meta-codes, we are aware of the implications
"B403",
"B404",
"B405",
]
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
src = ["src", "test", "stubs"]
include = [
"pyproject.toml",
"src/**/*.py",
"tests/**/*.py",
"stubs/**/*.pyi"
]
line-length = 79
indent-width = 4
target-version = "py311"
[tool.ruff.lint]
select = [
"B0",
"B904",
"B909",
"C4",
"COM818",
"D2",
"D301",
"D4",
"E",
"F",
"FLY002",
"I002",
"ISC",
"N",
"PERF",
"PGH004",
"PIE",
"PYI",
"Q",
"RUF",
"SIM",
"SLOT",
"UP",
"W"
]
ignore = [
"B007",
"C420",
"D200",
"D201",
"D202",
"D204",
"D205",
"D209",
"D210",
"D211",
"D400",
"D401",
"D412",
"E226",
"E402",
"E711",
"E712",
"E741",
"N818",
"PYI019",
"PYI041",
"RUF012",
"RUF013",
"RUF021",
"RUF022",
"RUF023",
"RUF031",
"RUF052",
"RUF056",
# TODO: We would like to enable SIM102, but it has a ton of
# violations, so it's a big job to clean it up
"SIM102",
"SIM103",
"SIM105",
"SIM108",
"SIM110",
"SIM118",
"SIM210",
"SIM910",
"UP009",
"UP012",
"UP032",
"UP038",
]
unfixable = []
external = ["TC"]
allowed-confusables = ["×"]
preview = true
[tool.ruff.lint.extend-per-file-ignores]
"src/onegov/core/types.py" = ["B018"]
"reportlab_settings.py" = ["N", "I002"]
"*.pyi" = [
"E501",
"N",
"Q",
# NOTE: We would prefer to set a different target version instead
# but there's no per-file-target-version
"UP",
]
"tests/**/*.py" = [
"B018",
"C4",
"D",
"E301",
"E302",
"E303",
"E304",
"E305",
"E306",
"F841",
"FLY002",
"I002",
"ISC",
"N",
"Q",
"PERF",
"PGH",
"PIE",
"PYI",
"RUF",
"SIM",
"UP",
]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.pep8-naming]
extend-ignore-names = [
"afterFlowable",
"HSTORE",
"sortKey",
"URL",
"UUID"
]
classmethod-decorators = [
# NOTE: We can potentially get rid some of these with SQLAlchemy 2.0
# since they should cleanly combine with classmethod
"declared_attr",
"expression",
"comparator",
]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
ignore-decorators = ["typing.overload"]
[tool.ruff.lint.flake8-quotes]
avoid-escape = true
docstring-quotes = "double"
inline-quotes = "single"
multiline-quotes = "double"
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.ruff.lint.ruff]
extend-markup-names = ["chameleon.utils.Markup"]
[tool.ruff.format]
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"
docstring-code-format = true
docstring-code-line-length = "dynamic"