-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
261 lines (244 loc) · 7.8 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
[tool.poetry]
name = "renku-data-services"
version = "0.0.1"
description = "Collection of services that deal with data in Postgres."
authors = ["Swiss Data Science Center <[email protected]>"]
readme = "README.md"
license = "Apache License 2.0"
packages = [
{ include = "renku_data_services/data_api", from = "bases" },
{ include = "renku_data_services/background_jobs", from = "bases" },
{ include = "renku_data_services/authn", from = "components" },
{ include = "renku_data_services/db_config", from = "components" },
{ include = "renku_data_services/app_config", from = "components" },
{ include = "renku_data_services/authz", from = "components" },
{ include = "renku_data_services/crc", from = "components" },
{ include = "renku_data_services/k8s", from = "components" },
{ include = "renku_data_services/migrations", from = "components" },
{ include = "renku_data_services/errors", from = "components" },
{ include = "renku_data_services/base_models", from = "components" },
{ include = "renku_data_services/base_api", from = "components" },
{ include = "renku_data_services/storage", from = "components" },
{ include = "renku_data_services/utils", from = "components" },
{ include = "renku_data_services/git", from = "components" },
{ include = "renku_data_services/users", from = "components" },
{ include = "renku_data_services/project", from = "components" },
{ include = "renku_data_services/message_queue", from = "components" },
{ include = "renku_data_services/namespace", from = "components" },
{ include = "renku_data_services/session", from = "components" },
{ include = "renku_data_services/message_queue", from = "components" },
{ include = "renku_data_services/secrets", from = "components" },
{ include = "renku_data_services/connected_services", from = "components" },
{ include = "renku_data_services/repositories", from = "components" },
{ include = "renku_data_services/notebooks", from = "components" },
{ include = "renku_data_services/platform", from = "components" },
{ include = "renku_data_services/data_connectors", from = "components" },
]
[tool.poetry.dependencies]
python = "^3.12"
sanic = { extras = ["ext"], version = "^24.6.0" }
pydantic = { extras = ["email"], version = "^2.10.2" }
datamodel-code-generator = "^0.24.2"
sqlalchemy = { extras = ["asyncio"], version = "^2.0.36" }
alembic = "^1.14.0"
asyncpg = "^0.30.0"
pyjwt = { extras = ["crypto"], version = "^2.10.1" }
tenacity = "^9.0.0"
httpx = "<0.29"
kubernetes = "^31.0.0"
python-ulid = "^3.0.0"
python-gitlab = "^5.1.0"
psycopg = { version = "^3.2.3", extras = ["binary"] }
urllib3 = "^2.2.3"
deepmerge = "^2.0"
authlib = "^1.3.2"
redis = "^5.2.0"
dataclasses-avroschema = "^0.65.4"
undictify = "^0.11.3"
types-redis = "^4.6.0.20241004"
prometheus-sanic = "^3.0.0"
prometheus_client = "^0.7.1"
kubernetes-asyncio = "^31.1.0"
marshmallow = "^3.23.1"
escapism = "^1.0.1"
sentry-sdk = { version = "^2.19.0", extras = ["sanic"] }
authzed = "^1.1.0"
cryptography = "^44.0.0"
# see https://github.com/sanic-org/sanic/issues/2828 for setuptools dependency, remove when not needed anymore
setuptools = { version = "^75.6.0" }
kr8s = "^0.18.1"
werkzeug = "^3.1.3"
toml = "^0.10.2"
aiofiles = "^24.1.0"
# Not a direct dependency, it is needed by authzed. Was causing things to crash at startup beacuse of
# google.protobuf.runtime_version.VersionError:
# Detected incompatible Protobuf Gencode/Runtime versions when loading authzed/api/v1/core.proto: gencode 5.28.2 runtime 5.27.3.
protobuf = "^5.29.1"
[tool.poetry.group.dev.dependencies]
bandit = "^1.8.0"
mypy = "~1.13"
pytest = "^8.3.4"
pytest-cov = "^6.0.0"
pre-commit = "^4.0.1"
sanic-testing = "^24.6.0"
aiosqlite = "^0.20.0"
types-pyyaml = "^6.0.12.20240917"
schemathesis = "~3.29.2"
pytest-asyncio = "^0.21.1"
pytest-postgresql = "^6.1.1"
types-urllib3 = "^1.26.25.14"
pyavro-gen = "^0.3.3"
avro-preprocessor = "^0.3.0"
fakeredis = "^2.26.1"
ruff = "^0.8.2"
debugpy = "^1.8.9"
pytest-xdist = { version = "^3.5.0", extras = ["psutil"] }
types-requests = "^2.32.0.20241016"
types-toml = "^0.10.8.20240310"
types-aiofiles = "^24.1.0.20240626"
pytest-mock = "^3.14.0"
uvloop = "^0.21.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 120
target-version = "py311"
output-format = "full"
include = ["*.py", "*.pyi"]
exclude = [
"*/avro_models/*",
".devcontainer/",
"components/renku_data_services/notebooks/cr_amalthea_session.py",
"components/renku_data_services/notebooks/cr_jupyter_server.py",
]
[tool.ruff.format]
exclude = ["apispec.py"]
[tool.ruff.lint]
select = [
# isort
"I",
# pydocstyle
"D",
# pyflakes
"F",
# pycodestyle
"E",
"W",
# pyupgrade
"UP",
# flake8-simplify
"SIM",
]
ignore = [
"D105",
"D107",
"D202",
"D211",
"D213",
"D401",
"E202",
"E226",
"E231",
"UP007",
"UP038",
]
[tool.ruff.lint.per-file-ignores]
"test/*" = ["D"]
"*/versions/*" = ["D", "E", "W"]
"apispec.py" = ["D", "E", "W", "I", "UP"]
"components/renku_data_services/notebooks/crs.py" = ["F401"]
[tool.ruff.lint.isort]
known-first-party = ["renku_data_services", "test"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.bandit]
skips = ["B101", "B603", "B607", "B404"]
exclude_dirs = [
"test",
".devcontainer",
"components/renku_data_services/notebooks/cr_jupyter_server.py",
"components/renku_data_services/notebooks/cr_amalthea_session.py",
]
[tool.pytest.ini_options]
addopts = "--cov components/ --cov bases/ --cov-report=term-missing -v"
doctest_optionflags = "ALLOW_UNICODE"
testpaths = ["bases", "components", "test"]
markers = ["integration: mark a test as a integration."]
filterwarnings = [
"ignore:<class 'pytest_black.BlackItem'> is not using a cooperative constructor:pytest.PytestDeprecationWarning",
"ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning",
]
postgresql_host = "localhost"
postgresql_user = "renku"
postgresql_password = "renku"
asyncio_mode = "auto"
[tool.mypy]
python_version = "3.12"
mypy_path = ["components", "bases"]
files = ["bases/**/*.py", "components/**/*.py"]
namespace_packages = true
explicit_package_bases = true
exclude = ["test"]
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
warn_unreachable = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
strict_equality = true
check_untyped_defs = true
allow_redefinition = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"renku_data_services.crc.apispec",
"renku_data_services.connected_services.apispec",
"renku_data_services.data_connectors.apispec",
"renku_data_services.storage.apispec",
"renku_data_services.project.apispec",
"renku_data_services.repositories.apispec",
"renku_data_services.secrets.apispec",
"renku_data_services.session.apispec",
"renku_data_services.users.apispec",
"renku_data_services.data_api.error_handler",
"renku_data_services.namespace.apispec",
"renku_data_services.notebooks.apispec",
"renku_data_services.notebooks.cr_amalthea_session",
"renku_data_services.notebooks.cr_jupyter_server",
"renku_data_services.platform.apispec",
"renku_data_services.message_queue.apispec",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"asyncpg.*",
"aiofiles.*",
"authlib.*",
"authzed.*",
"avro_preprocessor.*",
"dataclasses_avroschema",
"deepmerge.*",
"grpc.*",
"grpcutil.*",
"kubernetes.*",
"kubernetes_asyncio.*",
"prometheus_client.*",
"prometheus_sanic.*",
"pyavro_gen.*",
"sanic_testing.*",
"undictify.*",
"urllib3.*",
"escapism.*",
"kr8s.*",
]
ignore_missing_imports = true
[tool.coverage.run]
source = ["bases/", "components/"]
omit = ["components/renku_data_services/notebooks"]
concurrency = ["thread", "greenlet"]