-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
236 lines (209 loc) · 5.89 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
[tool.poetry]
authors = [
"Joel Collins <[email protected]>",
"Ezequiel Leonardo Castaño <[email protected]>"
]
description = "A FastAPI + Pydantic extension for simplifying hypermedia-driven API development."
license = "MIT"
name = "fastapi-hypermodel"
readme = "README.md"
repository = "https://github.com/jtc42/fastapi-hypermodel"
version = "2.1.0"
[tool.poetry.dependencies]
# Make sure to update the pytest-min env in tox when changing dependencies
fastapi = ">=0.115.2,<1"
pydantic = ">=2.4.0,<3.0"
typing_extensions = ">=4.8.0,<5"
python = ">=3.8,<4"
jsonref = ">=0.1,<2"
jsonschema = ">=2.0.0,<5"
frozendict = ">=2.0.2,<3"
starlette = ">=0.37.2,<1"
[tool.poetry.group.dev.dependencies]
httpx = ">=0.23.1,<0.28.0"
mkdocs-material = ">=8.3.9,<10.0.0"
pytest = ">=7,<9"
pytest-cov = ">=3,<6"
pytest-lazy-fixtures = ">=1.0.1"
ruff = ">=0.5.1,<0.9.0"
tox = ">=4.12.1,<5"
uvicorn = ">=0.17.6,<0.33.0"
coverage = ">=7.4.1,<8"
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]
#########################
# Coverage
#########################
[tool.coverage.report]
exclude_also = [
"if __name__ == .__main__.:",
"pass",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
#########################
# MyPy
#########################
[tool.mypy]
strict = true
ignore_missing_imports = true
disable_error_code = [
"unused-ignore", # To use names in Pydantic Init
]
#########################################
# Ruff
#########################################
[tool.ruff]
fix = true
preview = true
extend-exclude = ["tests", "*_schema.py"]
target-version = "py38"
[tool.ruff.lint]
ignore = [
"A003", # FIXME
"ANN401", # Ignore Anys
"ISC001", # Disable for compatibility with ruff-format
"UP007", # Not compatible with Python 3.8
"UP006", # Not compatible with Python 3.8
]
extend-select = [
# "D", # pydocstyle
# "FBT", # flake8-boolean-trap
# "COM", # flake8-commas
"E", # pycodestyle
"UP", # pyupgrade
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"ICN", # flake8-import-conventions
"PIE", # flake8-pie
"RSE", # flake8-return
"SIM", # flake8-simplify
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"G", # flake8-logging-format
"ISC", # flake8-implicit-str-concat
"T20", # flake8-print
"EM", # flake8-errmsg
"SLF", # flake8-self
"PT", # flake8-pytest-style
"RET", # flake8-return
"TID", # flake8-tidy-imports
"PTH", # flake8-use-pathlib
"LOG", # flake8-logging
"TD", # flake8-todos
"FIX", # flake8-fixme
"TRY", # tryceratops
"I", # isort
"ERA", # erradicate
"PERF", # Perflint
"FURB", # refurb
"RUF", # ruff
]
[tool.ruff.format]
# Set Ruff to imitate Black
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
#########################################
# PyLint
#########################################
[tool.pylint.main]
fail-on = ["I"]
fail-under = 10
jobs = 8
limit-inference-results = 1000
py-version = "3.8"
load-plugins = [
"pylint.extensions.bad_builtin",
"pylint.extensions.code_style",
"pylint.extensions.comparison_placement",
"pylint.extensions.consider_refactoring_into_while_condition",
"pylint.extensions.docparams",
"pylint.extensions.dunder",
"pylint.extensions.eq_without_hash",
"pylint.extensions.for_any_all",
"pylint.extensions.magic_value",
"pylint.extensions.mccabe",
"pylint.extensions.no_self_use",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.private_import",
"pylint.extensions.redefined_loop_name",
"pylint.extensions.redefined_variable_type",
"pylint.extensions.set_membership",
"pylint.extensions.typing",
"pylint.extensions.while_used",
"pylint_pydantic",
]
[tool.pylint.dunder]
good-dunder-names = [
"__get_pydantic_core_schema__",
"__get_pydantic_json_schema__",
"__schema_subclasses__",
]
[tool.pylint.design]
max-args = 7
max-attributes = 7
max-bool-expr = 5
max-branches = 12
max-complexity = 10
max-locals = 15
max-parents = 7
max-public-methods = 20
max-returns = 6
max-statements = 50
[tool.pylint.format]
indent-after-paren = 4
indent-string = " "
max-line-length = 120
max-module-lines = 400
[tool.pylint.'MESSAGES CONTROL']
disable = [
"line-too-long",
"unsubscriptable-object", # Disabled until proper Python 3.9 support is fixed in PyLint
"fixme",
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
"missing-param-doc",
"too-few-public-methods",
"too-many-arguments",
"consider-using-assignment-expr", # Disabled until walrus operator is widely used
"unused-variable", # Too many false positives
"too-many-lines", # Disable until refactor
"too-many-positional-arguments" # No immediately obvious, sensible way to refactor
]
enable = [
"bad-inline-option",
"file-ignored",
"useless-suppression",
"deprecated-pragma",
"use-symbolic-message-instead",
"deprecated-pragma",
"file-ignored",
]
max-line-length = 88
[tool.pylint.'MASTER']
extension-pkg-allow-list = "pydantic"
[tool.pylint.refactoring]
max-nested-blocks = 3
never-returning-functions = ["sys.exit", "argparse.parse_error"]
[tool.pylint.exceptions]
overgeneral-exceptions = ["'builtins.Exception'"]
[tool.pylint.string_constant]
check-quote-consistency = true
[tool.pylint.string]
check-str-concat-over-line-jumps = true
[tool.pylint.similarities]
ignore-comments = true
ignore-docstrings = true
ignore-signatures = true
min-similarity-lines = 12
[tool.pylint.variables]
allow-global-unused-variables = false
callbacks = ["cb_", "_cb"]
dummy-variables-rgx = "(_+[a-zA-Z0-9]*?$)|dummy"
ignored-argument-names = "_.*"