-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
239 lines (216 loc) · 6.63 KB
/
pyproject.toml
File metadata and controls
239 lines (216 loc) · 6.63 KB
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
[project]
name = "MultiDirectory"
version = "2.1.1"
description = ""
authors = [
{ name = "Mastermind-U", email = "rex49513@gmail.com" }
]
requires-python = "==3.13.7"
readme = "README.md"
packages = [{include = "app"}]
dependencies = [
"adaptix>=3.0.0b11",
"aioldap3 @ https://github.com/MultiDirectoryLab/aioldap3/releases/download/v1.3/aioldap3-1.3-py3-none-any.whl",
"alembic>=1.14.1",
"asn1==2.8.0",
"asyncstdlib>=3.10.6",
"backoff>=2.2.1",
"bcrypt==4.0.1",
"cryptography>=44.0.1",
"dishka>=1.6.0",
"dnsdist-console>=1.6.0",
"dnspython>=2.7.0",
"fastapi>=0.115.0",
"fastapi-error-map>=0.9.8",
"gssapi>=1.9.0",
"httpx>=0.28.1",
"jinja2>=3.1.4",
"ldap-filter>=1.0.1",
"ldap3>=2.9.1",
"loguru>=0.7.2",
"passlib[bcrypt]>=1.7.4",
"proxy-protocol>=0.11.3",
"psycopg[binary,pool]>=3.2.8",
"pydantic>=2.9.2",
"python-jose[cryptography]>=3.3.0",
"python-multipart>=0.0.20",
"pytz>=2025.1",
"redis>=5.2.1",
"sqlalchemy[asyncio,mypy]>=2.0.35",
"uvicorn>=0.34.2",
"uvloop==0.21.0",
"websockets>=15.0",
]
[dependency-groups]
linters = [
"mypy>=1.13.0",
"ruff==0.11.9",
"types-pytz>=2022.7.1.0",
]
test = [
"coverage==7.8.0",
"gevent>=24.10.3",
"pytest>=8.3.3",
"pytest-asyncio==0.26.0",
"pytest-cov==4.1.0",
"pytest-xdist>=3.8.0",
]
dev = [
"fastapi-sqlalchemy-monitor>=1.1.3",
"py-hot-reload>=1.0.6",
"watchdog==4.0.2",
]
[tool.uv]
default-groups = ["linters", "test", "dev"]
[tool.mypy]
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
ignore_missing_imports = true
platform = "linux"
disallow_untyped_defs = true
show_column_numbers = true
pretty = true
warn_unreachable = true
color_output = true
warn_unused_ignores = true
[tool.pytest.ini_options]
pythonpath = ["app"]
addopts = [
"--cov",
"--cov-report=term-missing:skip-covered"
]
asyncio_mode = "auto"
cache_dir ="/app/.pytest_cache"
[tool.coverage.report]
show_missing = true
[tool.coverage.run]
concurrency = ["thread", "gevent"]
omit = [
"*/__dishka_factory_*",
]
# RUFF
# Ruff is a linter, not a type checker.
#
# commands:
# ruff check . --preview
# ruff check . --fix --unsafe-fixes
# ruff format .
[tool.ruff]
target-version = "py312"
line-length = 79
output-format = "grouped"
unsafe-fixes = true
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 79
line-ending = "lf"
skip-magic-trailing-comma = false # default: false
[tool.ruff.lint]
select = [
"F", # Pyflakes. Must have
"E", # pycodestyle (Error), check tool.ruff.lint.pycodestyle. Must have
"W", # pycodestyle (Warnings), check tool.ruff.lint.pycodestyle
"C90", # mccabe (max_complexity), check tool.ruff.lint.mccabe
"I", # isort, check tool.ruff.lint.isort. Must have
"N", # pep8-naming
"A", # flake8 builtin-attribute-shadowing
"D", # pydocstyle, check tool.ruff.lint.pydocstyle
"UP", # pyupgrade, check tool.ruff.lint.pyupgrade. Must have
"ANN", # flake8-annotations, check tool.ruff.lint.flake8-annotations
"ASYNC", # flake8-async
"S", # flake8-bandit
"B", # flake8-bugbear. Must have
"COM", # flake8-commas
# "CPY", # flake8-copyright TODO uncomment, ruff fix and fix error
"PIE", # flake8-pie
# "PYI", # flake8-pyi TODO uncomment, ruff fix and fix error
"PT", # flake8-pytest
"Q", # flake8-quotes
# "RET", # flake8-return TODO uncomment, ruff fix and fix error
# "SLF", # flake8-self TODO uncomment, ruff fix and fix error
"SIM", # flake8-simplify. Must have
"TC", # flake8-type-checking, check flake8-type-checking
"ARG", # flake8-unused-arguments
"FIX", # flake8-fixme
"T20", # flake8-print
"ERA", # eradicate
# "PGH", # pygrep-hooks TODO does we need it? uncomment, ruff fix and fix error
# "PL", # Pylint TODO uncomment, ruff fix and fix error
# "DOC", # pydoclint TODO uncomment, ruff fix and fix error
# "RUF", # Ruff-specific rules TODO uncomment, ruff fix and fix error
"RUF100", # Ruff100-specific rule TODO delete that and uncomment "RUF"-rule in line up.
"SLF001", # flake8-self: checks for access to private/protected attributes via self
"COM812", # this is necessary. It checks for commas in the end of the line.
]
# Gradually remove all values marked 'TODO' and fix errors.
ignore = [
"D102", # TODO delete that and fix all errors
"D104", # TODO delete that and fix all errors
"D203", # this is necessary. Conflict with `D211`
"D213", # this is necessary. Conflict with `D212`
"D301", # this is necessary.
"UP017", # TODO delete that and fix all errors
"UP034", # TODO delete that and fix all errors
"UP035", # this is necessary. We allowed deprecated import
"ANN001", # TODO delete that and fix all errors
"ANN002", # this is necessary.
"ANN003", # this is necessary.
"ANN401", # TODO delete that and fix all errors
"ASYNC109",
"ASYNC230",
"S311", # this is necessary.
"B904", # this is necessary.
"TC001", # this is necessary.
"TC002", # this is necessary.
"TC003", # this is necessary.
"SIM101", # analogue simplify-boolean-expressions IF100
"B905", # this is necessary. get-attr-with-constant
"D107", # ignore missing docstrings in __init__ methods
"D101", # ignore missing docstrings in public classes
"D103", # ignore missing docstrings in public functions
]
extend-select = []
fixable = ["ALL"]
unfixable = [
"T20", # dont auto delete print/pprint lines in code
]
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["S101"] # Ignore `Flake8-bandit S101` rule for the `tests/` directory.
"alembic/*.py" = ["I001"] # Ignore `Flake8-isort IO01` rule for the `alembic/` directory. It works incorrect in CI ruff test.
[tool.ruff.lint.mccabe]
# 15 Complexity level is too high, need to reduce this level or ignore it `# noqa: C901`.
max-complexity = 15
[tool.ruff.lint.isort]
known-first-party = [
"password_manager",
"ldap_protocol",
"abstract_dao",
"abstract_service",
"authorization_provider_protocol",
"client",
"config",
"constants",
"entities",
"repo",
"api",
"security",
"tests",
"web_app",
"ioc",
"password_utils",
"schedule",
"extra",
"enums",
"errors",
]
known-third-party = [
"alembic", # https://github.com/astral-sh/ruff/issues/10519
]
split-on-trailing-comma = false
combine-as-imports = true
[tool.ruff.lint.flake8-annotations]
suppress-dummy-args = true
suppress-none-returning = true
[tool.ruff.lint.flake8-type-checking]
quote-annotations = true