-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpyproject.toml
244 lines (226 loc) · 6.42 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
[project]
name = "fastapi-quickstart"
version = "0.0.1"
description = ""
authors = [
{name = "Kostiantyn Salnykov", email = "kostiantyn.salnykov@gmail.com"},
]
license = "MIT"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"core",
"domain",
"alembic>=1.14.1",
"asyncpg>=0.30.0",
"bcrypt>=4.2.1",
"casbin>=1.38.0",
"fastapi[standard]>=0.115.6",
"httpx>=0.28.1",
"orjson>=3.10.15",
"pendulum>=3.0.0",
"phonenumbers>=8.13.53",
"psycopg2-binary>=2.9.10",
"pydantic[email]>=2.10.5",
"pydantic-settings>=2.7.1",
"PyJWT>=2.10.1",
"redis[hiredis]>=5.1.1",
"SQLAlchemy[asyncio, mypy]>=2.0.37",
"typer>=0.15.1",
"uuid7>=0.1.0",
"casbin-async-sqlalchemy-adapter>=1.7.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv]
package = false
default-groups = ["servers"]
[tool.uv.sources]
core = { path = "libs/core", editable = true }
domain = { path = "libs/domain", editable = true }
[dependency-groups]
servers = [
"uvicorn[standard]>=0.34.0",
"granian[reload]>=1.7.5",
"gunicorn>=23.0.0",
]
lint = [
"mypy>=1.14.1",
"ruff>=0.9.4",
"xenon>=0.9.3",
"interrogate>=1.7.0",
]
test = [
"factory-boy>=3.3.1",
"Faker>=33.3.1",
"pytest>=8.3.4",
"pytest-alembic>=0.11.1",
"pytest-asyncio>=0.25.3",
"pytest-clarity>=1.0.1",
"pytest-cov>=6.0.0",
"pytest-mock>=3.14.0",
"pytest-randomly>=3.16.0",
"pytest-sugar>=1.0.0",
]
local = [
{include-group = "lint"},
{include-group = "test"},
"bump-pydantic>=0.8.0",
"ipython>=8.31.0",
"pre-commit>=4.1.0"
]
[tool.pytest.ini_options]
markers = [
'debug: marks tests as debug (deselect with -m "not debug")',
]
#addopts = """\
#--maxfail=1
#-rf
#--test-alembic
#--randomly-dont-reset-seed
#"""
norecursedirs = ["venv", ".venv", ".env", "migrations",]
testpaths = ["tests",]
python_files = ["test*.py", "*test.py"]
python_functions = ["*_test", "test_*"]
console_output_style = "progress"
asyncio_mode = "auto"
log_cli = true
[tool.coverage.run]
parallel = true
sigterm = true
branch = true
source = ["apps",]
omit = ["*/*.local/*", "*/*.idea*/*", "*/*.venv*/*", "*/*test*", "*__init__*", "*/*migrations*" , "*/*interfaces.py"]
[tool.coverage.report]
ignore_errors = true
sort = "-cover"
precision = 2
omit = ["*/*.local/*", "*/*.idea*/*", "*/*.venv*/*", "*/*test*", "*__init__*", "*/*migrations*" , "*/*interfaces.py"]
exclude_lines = [
"pragma: no cover",
"if __name__ = .__main__.:",
"@abc",
"@abstract",
]
[tool.coverage.html]
directory = ".coverage_dir"
[tool.mypy]
python_version = "3.11"
files = ['*.py', '**/*.py']
exclude = ["docs*", "coverage", "tests"]
plugins = ["pydantic.mypy", "sqlalchemy.ext.mypy.plugin"]
no_site_packages = true
follow_imports = "skip"
ignore_missing_imports = true
strict_optional = false
warn_return_any = false
warn_unused_ignores = true
show_error_codes = true
no_implicit_optional = true
disallow_untyped_defs = true
disallow_any_generics = true
check_untyped_defs = true
#disallow_any_unimported = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.ruff]
fix = true
line-length = 120
target-version = "py312"
[tool.ruff.format]
quote-style = "double"
docstring-code-format = true
docstring-code-line-length = 160
indent-style = "space"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.analyze]
detect-string-imports = true
[tool.ruff.lint]
select = [
"ANN", # flake8-annotations
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle (error)
"EM", # flake8-errmsg
"F", # Pyflakes
"FAST", # FastAPI
"FBT", # flake8-boolean-trap
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"N", # PEP8-naming
"PERF", # Perflint
"PL", # Pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff linter
"S", # flake8-bandit
"SIM", # flake8-simplify
"T20", # flake8-print
"TC", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle (warning)
]
ignore = [
"B008", # Do not perform function call {name} in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D203", # 1 blank line required before class docstring
"D213", # Should be a multi-line docstring
"EM101", # Exception must not use a string literal, assign to variable first
"F403", # from {name} import * used; unable to detect undefined names
"G004", # Logging statement uses f-string
"N805", # The First argument of a method should be named self
"PLR0913", # Too many arguments in function definition ({c_args} > {max_args})
"S104", # Possible binding to all interfaces
"S105", # Possible hardcoded password assigned to: "{STRING}"
]
[tool.ruff.lint.extend-per-file-ignores]
"test*.py" = ["S101", "S106", "S311", "D", "ANN001", "ANN002", "ANN003", "ANN401", "PT007"]
"migrations**" = ["ANN"]
"loggers.py" = ["ANN002", "ANN003"]
"cli.py" = ["ANN002", "ANN003"]
"helpers.py" = ["ANN401", "ANN002", "ANN003"]
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = true
ignore-module = true
ignore-nested-functions = true
ignore-nested-classes = true
ignore-setters = true
fail-under = 90
exclude = ["setup.py", "docs", "build", "tests", "migrations", "venv", ".venv"]
ignore-regex = [".*Base*.", ".*Interface*."]
# possible values: 0 (minimal output), 1 (-v), 2 (-vv)
verbose = 1
quiet = false
whitelist-regex = []
color = true
omit-covered-files = false
#generate-badge = "."
#badge-format = "svg"