-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
234 lines (214 loc) · 5.32 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
[tool.poetry]
name = "py-tools"
version = "0.1.0"
description = ""
authors = ["Rugnar Lodbrok <[email protected]>"]
packages = [
{ include = "py_tools" },
]
[tool.poetry.dependencies]
python = "^3.11"
requests = "^2.28.2"
numpy = "^1.25.2"
pydantic = "^1.10.12"
[tool.poetry.group.dev.dependencies]
autoflake = "^2.0.0"
black = "^22.0.0" # 24 messes with one-line functions: def foo(): ...
flake8 = "^6.0.0"
#flake8-alembic = "^1.0.1"
flake8-builtins = "^1.4"
flake8-comprehensions = "^3"
flake8-eradicate = "^1.5"
flake8-isolated-packages = "^2.2.0"
flake8-isort = "^6"
flake8-logging-format = "^0.9"
flake8-print = "^4"
flake8-pytest = "^1.3"
flake8-pytest-style = "^1"
flake8-pyproject = "^1.2.3"
flake8-quotes = "^3"
flake8-return = "^1.0"
flake8-tidy-imports = "^4.8.0"
isort = { version = "^5", extras = ["pyproject"] }
mypy = "^1.4.1"
pep8-naming = "^0.11"
pylint = "^2.4"
pytest = "*"
pytest-alembic = "^0.8.0"
pytest-asyncio = "^0.18.3"
pytest-cov = "^4.1.0"
pytest-freezegun = "^0.4"
pytest-deadfixtures = "^2"
pytest-lazy-fixture = "^0.6"
pytest-logger = "^0.5.1"
pytest-mock = "^3"
ruff = "^0.1"
types-freezegun = "^0.1.4"
types-python-dateutil = "^2.8.19.8"
types-pytz = "^2021.1.0"
types-requests = "^2.25.0"
types-setuptools = "^57.0.0"
types-toml = "^0.1.3"
unify = "^0.5"
[tool.isort]
profile = "black"
balanced_wrapping = true
default_section = "THIRDPARTY"
known_first_party = [
"tests",
"py_tools",
]
[tool.black]
skip-string-normalization = true
line-length = 88 # default
target-version = ["py311"]
preview = true
[tool.flake8]
enable-extensions = "G"
exclude = [".git", ".venv"]
ignore = [
"A003", # 'id' is a python builtin, consider renaming the class attribute
"E203", # whitespace before ':'
"E501", # line too long
"W503", # line break before binary operator
"W504", # Line break occurred after a binary operator
"PT011", # pytest.raises checks only exception type, without value matcher
"R504", # unnecessary variable assignment before return statement
]
max-complexity = 10
max-annotations-complexity = 5
max-line-length = 120
show-source = true
ban-relative-imports = "parents"
restrict-walrus-level = "restrict-complicated"
test_folders = "tests"
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_decorators = false
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
plugins = [
"pydantic.mypy",
]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
[tool.coverage.run]
omit = [
"tests/*",
"**/__main__.py",
"*site-packages*",
"**/.venv/*",
]
branch = true
[tool.coverage.report]
show_missing = true
skip_covered = true
fail_under = 100
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"if TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
"@overload",
'NotImplementedError'
]
[tool.pylint]
good-names = ["a", "b", "c", "i", "j", "k", "v", "e", "n", "m", "q", "p", "x", "_", "pk", "id", "fn", "t", "t0", "t1", "f", "dt"]
class-rgx = "[A-Z_][a-zA-Z0-9]*$"
generated-members = [
"responses.*",
]
output-format = "colorized"
ignored-classes = [
"contextlib.closing",
"sqlalchemy.orm.scoping.scoped_session",
"faker.generator.Generator",
]
extension-pkg-allow-list = [
"pydantic.main",
"pydantic.fields",
]
disable = [
"C0111", # Missing module docstring (missing-docstring)
"C0412", # Imports from package <xxx> are not grouped (ungrouped-imports) - conflicts with isort sometimes
"E0213", # Method should have "self" as first argument (no-self-argument) - N805 for flake8
"E0611", # No name '<name>' in module '<module>' (no-name-in-module)
"E1101", # Module has no member
"R0801", # Similar lines in 2 files (duplicate-code)
"W0707", # Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
"R0903", # Too few public methods (m/n) (too-few-public-methods)
"C0113", # allow `not not` instead of `bool()`
"comparison-with-callable", # pylint doesnt understand classproperties
]
max-module-lines = 300
max-nested-blocks = 4
max-branches = 10
max-statements = 25
max-attributes = 10
max-public-methods = 10
min-similarity-lines = 5
ignore-comments = "yes"
ignore-docstrings = "yes"
ignore-imports = "yes"
max-args = 5
max-bool-expr = 5
max-returns = 5
[tool.pytest.ini_options]
testpaths = [
"tests",
]
asyncio_mode = "auto"
filterwarnings = [
'ignore:"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning',
"ignore:Call to deprecated method start.",
"ignore:Call to deprecated method finish.",
]
[tool.ruff]
exclude = [
".git",
".venv",
]
extend-exclude = [
"tests/*",
]
ignore = [
"A003",
]
line-length = 120
select = [
"A",
"C4",
"E",
"ERA",
"F",
"PT",
"Q",
"RET",
"T2",
"W",
]
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "parents"
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.flake8-builtins]
builtins-ignorelist = ["id"]
[tool.ruff.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "single"
multiline-quotes = "double"
avoid-escape = true
[tool.ruff.pylint]
max-branches = 10
max-statements = 25
max-returns = 5
max-args = 5