-
Notifications
You must be signed in to change notification settings - Fork 16
/
pyproject.toml
187 lines (166 loc) · 4.86 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
[tool.poetry]
name = "adcm"
version = "2.0.0"
description = "Arenadata Cluster Manager"
authors = [""]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
Django = "5.1.1"
adcm-version = "1.0.3"
ansible = { git = "https://github.com/arenadata/ansible.git", branch = "v2.8.8-p6" }
apache-libcloud = "3.8.0"
attr = "0.3.2"
casestyle = "0.0.4"
coreapi = "2.3.3"
cryptography = "41.0.7"
django-auth-ldap = "4.6.0"
django-cors-headers = "4.3.1"
django-csp = "3.7"
django-filter = "23.5"
django-guardian = "2.4.0"
# concerning our way of defining serializers, so we'd have to adopt code to update to 3.15
# we've decided to keep it at 3.14.0, since 3.15.0 introduced unwanted behavior
djangorestframework = "3.14.0"
djangorestframework-camel-case = "1.4.2"
drf-extensions = "0.7.1"
drf-flex-fields = "1.0.2"
drf-nested-routers = "0.93.5"
drf-spectacular = {version = "0.27.0", extras = ["sidecar"]}
googleapis-common-protos = "1.62.0"
grpcio = "1.60.0"
jinja2 = "2.11.3"
jmespath = "1.0.1"
jsonschema = "4.20.0"
lxml = "4.9.4"
markupsafe = "1.1.1"
multipledispatch = "1.0.0"
psycopg2-binary = "2.9.9"
pycryptodome = "3.18.0"
pydantic = "2.7.0"
python-gnupg = "0.5.2"
requests-toolbelt = "1.0.0"
rstr = "3.2.2"
ruyaml = "0.91.0"
six = "1.16.0"
social-auth-app-django = "5.4.0"
uwsgi = "2.0.23"
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
ruff = "^0.1.13"
pyright = "^1.1.378"
django-stubs = "^5.0.4"
djangorestframework-stubs = "^3.15.0"
[tool.poetry.group.unittests]
optional = true
[tool.poetry.group.unittests.dependencies]
tblib = "^2.0.0"
django-test-migrations = "^1.3.0"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
pre-commit = "^3.6.0"
[tool.poetry.group.profiling]
optional = true
[tool.poetry.group.profiling.dependencies]
django-silk = "^5.0.4"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 120
[tool.ruff.lint.isort]
force-sort-within-sections = true
length-sort-straight = true
order-by-type = true
[tool.ruff.lint.per-file-ignores]
# Those rules are inadequate for migrations
# ARG001 - for python code it's common for arguments not to be used
# N803 - variables are in uppercase, because those are models
# N999 - we already have incorrect module names, won't be easy to rework
"python/cm/migrations/*" = ["ARG001", "N806", "N999"]
"python/audit/migrations/*" = ["ARG001", "N806", "N999"]
"python/rbac/migrations/*" = ["ARG001", "N806", "N999"]
# Hooks must implement specific interface, and it's visually convenient to name them as funcitons.
# ARG001 - interface implementations may not use all arguments required by that interface
# N801 - hooks that inherits from convenient class are also classes, but should be percieved as functions
"python/audit/alt/hooks.py" = ["ARG001", "N801"]
[tool.ruff.lint]
ignore = [
"E402",
"SIM117",
"A003",
"ANN001", "ANN201","ANN101", "ANN102", "ANN401", "ANN002", "ANN003", "ANN202", "ANN204", "ANN205", "ANN206",
"COM812",
"ARG005",
"S105",
"TRY003", "TRY201", "TRY301", "TRY300",
"S106",
"RET503", "RET505",
"FBT001", "FBT002", "FBT003",
"PIE800",
"PTH103", "PTH107", "PTH110", "PTH112", "PTH118", "PTH119", "PTH120","PTH123",
"S107"
]
select = [
# Pyflakes
"F",
# Pycodestyle
"E", "W",
# isort
"I",
# "COM" - The following rules may cause conflicts when used with the formatter: `COM812`.
# To avoid unexpected behavior, we recommend disabling these rules
"N", "UP", "YTT", "ANN",
"S", "BLE", "FBT", "B", "COM", "A", "C4",
"DTZ", "ICN", "PIE", "Q", "RET",
"SIM", "ARG", "PTH", "PLE", "TRY"
]
[tool.pyright]
include = [
"python",
"dev/linters",
"conf/adcm/python_scripts",
]
exclude = [
"python/api",
"python/api_ui",
"python/audit/cases",
"python/rbac/endpoints",
"python/rbac/endpoints_ui",
"python/rbac/services",
"**/tests",
"**/migrations",
"**/__pycache__",
]
typeCheckingMode = "standard"
reportUnnecessaryTypeIgnoreComment = true
reportMissingImports = "error"
reportMissingTypeStubs = false
pythonVersion = "3.10"
pythonPlatform = "Linux"
executionEnvironments = [
{ root = "python" },
{ root = "conf/adcm/python_scripts", extraPaths = [ "python" ] },
]
# TODO: Remove. Temporarily disable type issue checks
reportAttributeAccessIssue = false
reportReturnType = false
reportOptionalMemberAccess = false
reportArgumentType = false
reportIncompatibleMethodOverride = false
reportOptionalSubscript = false
reportAssignmentType = false
reportIncompatibleVariableOverride = false
reportCallIssue = false
reportOptionalIterable = false
reportInvalidTypeForm = false
reportOptionalCall = false
reportInvalidTypeArguments = false
reportPossiblyUnboundVariable = false
reportInvalidTypeVarUse = false
reportGeneralTypeIssues = false
reportIndexIssue = false
reportOperatorIssue = false
# END Remove.