-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
200 lines (179 loc) · 5.75 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
[tool.poetry]
name = "MultiDirectory"
version = "2.1.1"
description = ""
authors = ["Mastermind-U <rex49513@gmail.com>"]
readme = "README.md"
packages = [{include = "app"}]
[tool.poetry.dependencies]
python = "3.12.6"
alembic = "^1.14.1"
asn1 = "^2.7.1"
asyncstdlib = "^3.10.6"
backoff = "^2.2.1"
bcrypt = "4.0.1"
cryptography = "^44.0.1"
dishka = "^1.4.2"
dnspython = "^2.7.0"
fastapi = "^0.115.0"
gssapi = "^1.9.0"
httpx = "^0.27.2"
jinja2 = "^3.1.4"
ldap-filter = "^1.0.1"
loguru = "^0.7.2"
passlib = {extras = ["bcrypt"], version = "^1.7.4"}
psycopg = {extras = ["binary", "pool"], version = "^3.2.3"}
pydantic = "^2.9.2"
python-jose = {extras = ["cryptography"], version = "^3.3.0"}
python-multipart = "^0.0.17"
pytz = "^2025.1"
redis = "^5.2.1"
sqlalchemy = {extras = ["asyncio", "mypy"], version = "^2.0.35"}
uvicorn = "^0.32.0"
uvloop = "^0.21.0"
websockets = "^14.0"
[tool.poetry.group.linters.dependencies]
mypy = "^1.13.0"
ruff = "0.9.5"
types-pytz = "^2022.7.1.0"
[tool.poetry.group.test.dependencies]
coverage = "7.6.4"
gevent = "^24.10.3"
ldap3 = "^2.9.1"
pytest = "^8.3.3"
pytest-asyncio = "^0.24.0"
pytest-cov = "^4.1.0"
[tool.poetry.group.dev.dependencies]
py-hot-reload = "^1.0.6"
watchdog = "4.0.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.mypy]
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
ignore_missing_imports = true
platform = "linux"
disallow_untyped_defs = true
exclude = ["app/alembic", "alembic"]
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"
[tool.coverage.report]
show_missing = true
[tool.coverage.run]
concurrency = ["thread", "gevent"]
# 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 TODO uncomment, ruff fix and fix error
# "TD", # flake8-todos TODO uncomment, ruff fix and fix error
"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.
]
# 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.
"COM812", # this is necessary. Cause conflicts when used with the formatter
"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
]
extend-select = []
fixable = ["ALL"]
unfixable = []
[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]
# 22 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 = [
"ldap_protocol",
"client",
"config",
"models",
"api",
"security",
"tests",
"web_app",
"ioc",
"schedule",
"extra",
]
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