-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
491 lines (453 loc) · 12.5 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "data-rentgen"
version = "0.0.1"
license = "Apache-2.0"
description = "Data.Rentgen REST API + Kafka consumer"
authors = ["DataOps.ETL <[email protected]>"]
readme = "README.rst"
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: Pydantic",
"Framework :: Pydantic :: 2",
"Framework :: FastAPI",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
keywords = ["Lineage", "FastAPI", "REST", "FastStream"]
packages = [
{ include = "data_rentgen" },
]
include = [
{path = "data_rentgen/py.typed"},
{path = "data_rentgen/**/*.yml"},
{path = "data_rentgen/**/*.ini"},
]
[tool.poetry.urls] # Optional
"Homepage" = "https://github.com/MobileTeleSystems/data-rentgen"
"Documentation" = "https://data-rentgen.readthedocs.io/"
"Source" = "https://github.com/MobileTeleSystems/data-rentgen"
"CI/CD" = "https://github.com/MobileTeleSystems/data-rentgen/actions"
"Tracker" = "https://github.com/MobileTeleSystems/data-rentgen/issues"
[tool.poetry.dependencies]
python = "^3.10"
# https://github.com/pydantic/pydantic/issues/10494
pydantic = "~2.8.2"
typing-extensions = "^4.12.2"
pydantic-settings = {version = "^2.5.2", optional = true}
alembic = {version = "^1.14.0", optional = true}
sqlalchemy = {version = "^2.0.35", optional = true}
sqlalchemy-utils = {version = "^0.41.2", optional = true}
greenlet = {version = "^3.1.1", optional = true}
pyyaml = {version = "^6.0.2", optional = true}
python-json-logger = {version = "^2.0.7", optional = true}
coloredlogs = {version = "^15.0.1", optional = true}
uuid6 = {version = "^2024.7.10", optional = true}
python-dateutil = {version = "^2.9.0.post0", optional = true}
fastapi = {version = "^0.115.4", optional = true}
starlette = {version = "^0.41.2", optional = true}
starlette-exporter = {version = "^0.23.0", optional = true}
uvicorn = {version = "^0.32.0", optional = true}
asyncpg = {version = "^0.30.0", optional = true}
asgi-correlation-id = {version = "^4.3.4", optional = true}
faststream = {extras = ["kafka", "cli"], version = "^0.5.28", optional = true}
# used by aiokafka for LZ4, Snappy, ZSTD compression algorithms
cramjam = {version = "^2.8.3", optional = true}
packaging = {version = "^24.2", optional = true}
[tool.poetry.extras]
server = [
"fastapi",
"starlette",
"uvicorn",
"starlette-exporter",
"asgi-correlation-id",
"pydantic-settings",
"alembic",
"sqlalchemy",
"sqlalchemy-utils",
"greenlet",
"pyyaml",
"python-json-logger",
"coloredlogs",
"uuid6",
"python-dateutil",
]
consumer = [
"faststream",
"cramjam",
"pydantic-settings",
"alembic",
"sqlalchemy",
"sqlalchemy-utils",
"greenlet",
"pyyaml",
"python-json-logger",
"coloredlogs",
"uuid6",
"python-dateutil",
"packaging",
]
postgres = [
"asyncpg",
]
[tool.poetry.group.test.dependencies]
pytest = "^8.3.3"
httpx = "^0.27.0"
# TODO: remove version limit after fixing https://github.com/pytest-dev/pytest-asyncio/issues/706
pytest-asyncio = "^0.21.1"
pytest-randomly = "^3.16.0"
pytest-deadfixtures = "^2.2.1"
pytest-rerunfailures = "^14.0"
coverage = "^7.6.4"
psycopg2-binary = "^2.9.9"
gevent = "^24.11.1"
deepdiff = "^8.0.1"
[tool.poetry.group.dev.dependencies]
pre-commit = "^4.0.1"
mypy = "^1.13.0"
black = "^24.10.0"
isort = "^5.13.2"
flake8 = "^7.1.1"
bandit = "^1.7.9"
sqlalchemy = {extras = ["mypy"], version = "^2.0.32"}
wemake-python-styleguide = "^0.19.2"
flake8-pyproject = "^1.2.3"
types-pyyaml = "^6.0.12"
types-python-dateutil = "^2.9.0"
icecream = "^2.1.3"
[tool.poetry.group.docs.dependencies]
autodoc-pydantic = "^2.2.0"
numpydoc = "^1.8.0"
sphinx = "^8.1.3"
furo = "^2024.7.18"
sphinx-copybutton = "^0.5.2"
sphinxcontrib-towncrier = "^0.4.0a0"
# TODO: remove upper limit after https://github.com/sphinx-contrib/sphinxcontrib-towncrier/issues/92
towncrier = {version = ">=23.11,<24.7"}
sphinx-issues = "^5.0.0"
sphinx-design = "^0.6.1"
sphinx-favicon = "^1.0.1"
sphinx-last-updated-by-git = "^0.3.8"
# uncomment after https://github.com/zqmillet/sphinx-plantuml/pull/4
# sphinx-plantuml = "^1.0.0"
sphinx-argparse = "^0.5.2"
[tool.poetry.plugins."tricoder_package_spy.register"]
"data-rentgen" = "data_rentgen"
[tool.poetry_bumpversion.file."data_rentgen/__init__.py"]
search = '_raw_version = "{current_version}"'
replace = '_raw_version = "{new_version}"'
[tool.poetry_bumpversion.file."docs/conf.py"]
search = 'ver = Version.parse("{current_version}")'
replace = 'ver = Version.parse("{new_version}")'
[tool.pytest.ini_options]
markers = [
"server: tests for server (require running database)",
"consumer: tests for consumer (require running database)",
"db: tests for db",
"lineage: tests for lineage endpoints (require running database)"
]
[tool.coverage.paths]
source = ["data_rentgen"]
[tool.coverage.run]
branch = true
parallel = true
relative_files = true
concurrency = ["gevent"]
omit = [
"tests/*",
]
data_file = "reports/.coverage"
[tool.coverage.report]
precision = 2
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if .*debug",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if logger.isEnabledFor",
"if sys.version_info",
"@(abc\\.)?abstractmethod",
"\\.\\.\\.",
"def downgrade\\(\\)",
]
[tool.black]
line-length = 120
target-version = ["py310", "py311", "py312"]
include = "\\.pyi?$"
exclude = "(\\.eggs|\\.git|\\.mypy_cache|\\.tox|\\.venv|_build|buck-out|build|dist)"
[tool.isort]
profile = "black"
known_first_party = ["data_rentgen", "tests"]
[tool.mypy]
python_version = "3.10"
plugins = ["pydantic.mypy", "sqlalchemy.ext.mypy.plugin"]
strict_optional = true
[[tool.mypy.overrides]]
module = "sqlalchemy_utils"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "starlette_exporter"
ignore_missing_imports = true
[tool.autoflake]
imports = ["tests", "app"]
ignore-init-module-imports = true
remove-unused-variables = true
[tool.darglint]
docstring_style = "sphinx"
[tool.codespell]
exclude-file = "poetry.lock"
[tool.flake8]
jobs = 4
# We don't control ones who use our code
i-control-code = false
# Max of noqa in a module
max-noqa-comments = 10
max-annotation-complexity = 4
max-returns = 6
max-awaits = 8
max-local-variables = 20
max-name-length = 60
# Max of expressions in a function
max-expressions = 15
# Max args in a function
max-arguments = 15
# Max classes and functions in a single module
max-module-members = 35
max-import-from-members = 35
max-methods = 25
# Max line complexity measured in AST nodes
max-line-complexity = 24
# Max Jones Score for a module: the median of all lines complexity sum
max-jones-score = 15
# Max amount of cognitive complexity per function
max-cognitive-score = 20
# Max amount of cognitive complexity per module
max-cognitive-average = 25
max-imports = 25
max-imported-names = 50
# Max of expression usages in a module
max-module-expressions = 15
# Max of expression usages in a function
max-function-expressions = 15
max-base-classes = 5
max-decorators = 6
# Max of repeated string constants in your modules
max-string-usages = 15
max-try-body-length = 15
max-asserts = 15
# Max number of access level in an expression
max-access-level = 6
# maximum number of public instance attributes
max-attributes = 20
max-line-length = 120
max-doc-length = 120
# https://pypi.org/project/flake8-quotes/
inline-quotes = "double"
multiline-quotes = "double"
docstring-quotes = "double"
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
show-source = true
# Print total number of errors
count = true
statistics = true
exclude = [
".tox",
"migrations",
"dist",
"build",
"hadoop_archive_plugin",
"virtualenv",
"venv",
"venv36",
"ve",
".venv",
"tox.ini",
"docker",
"Jenkinsfile",
"dags",
"setup.py",
"docs"
]
rst-directives = [
"autosummary",
"data",
"currentmodule",
"deprecated",
"glossary",
"moduleauthor",
"plot",
"testcode",
"versionadded",
"versionchanged"
]
# https://github.com/peterjc/flake8-rst-docstrings/pull/16
rst-roles = [
"attr",
"class",
"func",
"meth",
"mod",
"obj",
"ref",
"term",
"py:func",
"py:mod"
]
ignore = [
"ANN",
"FI1",
# Found upper-case constant in a class: DB_URL
"WPS115",
# Found statement that has no effect
"WPS428",
# Found `f` string [opinionated]
"WPS305",
# Found class without a base class (goes against PEP8) [opinionated]
"WPS306",
# Found line break before binary operator [goes against PEP8] [opinionated]
"W503",
# Found multiline conditions [opinionated]
"WPS337",
# Found mutable module constant [opinionated]
"WPS407",
# Found empty module:
"WPS411",
# Found nested import [opinionated]
"WPS433",
# Found negated condition [opinionated]
"WPS504",
# Found implicit `.get()` dict usage
"WPS529",
# Docstrings [opinionated]
"D",
# string does contain unindexed parameters'
"P101",
"P103",
# Found implicit string concatenation [optional]
"WPS326",
# Found wrong function call: locals'
"WPS421",
# module level import not at top of file
"E402",
# Document or section may not begin with a transition.
"RST399",
# Error in "code" directive
"RST307",
# Found `%` string formatting
"WPS323",
# doc line too long
"W505",
# line too long
"E501",
# Found wrong module name: util
"WPS100",
# Found wrong keyword: pass
"WPS420",
# Found incorrect node inside `class` body: pass
"WPS604",
# Found wrong variable name: data
"WPS110",
# Found builtin shadowing: id
"WPS125",
# Found too short name: e < 2
"WPS111",
# Found a line that starts with a dot
"WPS348",
# first argument of a method should be named 'self'
"N805",
# Found `finally` in `try` block without `except`
"WPS501",
# Wrong multiline string usage: textwrap.dedent + multiline comment
"WPS462",
# Found incorrect multi-line string: 3-quoted docstring with just one line
"WPS322",
# https://github.com/wemake-services/wemake-python-styleguide/issues/2847
# E704 multiple statements on one line (def)
"E704",
# WPS220 Found too deep nesting: 34 > 20
"WPS220",
# Found wrong metadata variable: __all__
"WPS410",
# constant 'UUID' imported as non constant 'UUIDv7'
"N811",
# Found subclassing a builtin: str
"WPS600",
# Found underscored number: 5_000_000
"WPS303",
# Found complex default value: Depends(some)
"WPS404",
# Do not perform function calls in argument defaults: Depends(some)
"B008",
]
per-file-ignores = [
# WPS102 Found incorrect module name pattern
# WPS432 Found magic number: 255
"data_rentgen/db/*.py:WPS102,WPS432",
# WPS237 Found a too complex `f` string
"data_rentgen/server/exceptions/*.py:WPS237",
# N815 variable 'openlineageAdapterVersion' in class scope should not be mixedCase
"data_rentgen/consumer/openlineage/*.py:N815",
# TAE001 too few type annotations
# WPS231 Found function with too much cognitive complexity
# S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
# WPS442 Found outer scope names shadowing
# WPS432 Found magic number
# WPS334 Found reversed complex comparison
# WPS218 Found too many `assert` statements: 19 > 15
# WPS226 Found string literal over-use: value > 15
# WPS118 Found too long name:
"*tests/*.py:TAE001,WPS231,S101,WPS442,WPS432,WPS334,WPS218,WPS226,WPS118",
]
[tool.towncrier]
name = "Data.Rentgen"
package = "data_rentgen"
filename = "docs/changelog/NEXT_RELEASE.rst"
directory = "docs/changelog/next_release/"
title_format = "{version} ({project_date})"
issue_format = ":issue:`{issue}`"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "significant"
name = "Significant Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "improvement"
name = "Improvements"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "dependency"
name = "Dependencies"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Doc only Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "misc"
name = "Misc"
showcontent = true