/
pyproject.toml
140 lines (126 loc) · 4.34 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
[build-system]
requires = ['poetry-core>=1.5.1']
build-backend = 'poetry.core.masonry.api'
[tool.poetry]
name = 'frontik'
version = '8.0.1'
description = 'Frontik is an asyncronous Tornado-based application server'
authors = ['platform <platform@hh.ru>']
repository = 'https://github.com/hhru/frontik'
homepage = 'https://github.com/hhru/frontik'
readme = 'README.md'
[tool.poetry.scripts]
frontik = 'frontik.server:main'
[tool.poetry.dependencies]
python = '~=3.9'
aiohttp = '3.8.3'
jinja2 = '3.1.2'
lxml = '4.9.2'
pydantic = '^2.3.0'
tornado = '6.3.2'
orjson = '*'
http-client = {git = 'https://github.com/hhru/balancing-http-client.git', tag = '2.1.12'}
python-consul2-hh = {git = 'https://github.com/hhru/python-consul2', tag = 'v0.2.9'}
opentelemetry-sdk = '1.17.0'
opentelemetry-api = '1.17.0'
opentelemetry-exporter-otlp-proto-grpc = '1.17.0'
opentelemetry-instrumentation-fastapi = '0.38b0'
opentelemetry-instrumentation-aiohttp-client = '0.38b0'
fastapi = '0.105.0'
aiokafka = '0.8.1'
sentry-sdk = '2.1.1'
aioresponses = '0.7.4'
tornado-httpclient-mock = '0.2.3'
uvicorn = '0.29.0'
[tool.poetry.group.test.dependencies]
pytest = '8.1.1'
pytest-asyncio = '0.21.1'
pycodestyle = '>=2.5.0'
requests = '>=2.0'
types-requests = '2.31.0.8'
tox = '4.6.4'
lxml-asserts = '0.1.2'
mypy = '1.8.0'
ruff = '0.3.2'
exceptiongroup = '1.2.0'
tomli = '2.0.1'
virtualenv = '<=20.26.0'
[tool.poetry.extras]
sentry = ["sentry-sdk"]
testing = ["aioresponses", "tornado-httpclient-mock"]
[tool.pytest.ini_options]
addopts = '''
--tb native
--asyncio-mode=auto
-p no:warnings
'''
[tool.mypy]
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
show_error_codes = true
ignore_missing_imports = true
follow_imports = 'silent'
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
check_untyped_defs = true
exclude = [
'.*/api/2.*',
'tests/test_process_fork.py',
'http_client',
]
# should be fixed and enabled
#strict = true
#disallow_untyped_defs = true
#disallow_any_generics = true
#disallow_subclassing_any = true
#warn_return_any = true
[tool.ruff]
line-length = 120
target-version = 'py39'
preview = true
[tool.ruff.format]
quote-style = 'single'
#skip-magic-trailing-comma = true
[tool.ruff.lint]
select = [
'F','E','W','C90','I','N','D','UP','YTT','ANN','ASYNC','S','BLE','FBT','B','A','COM','CPY','C4','DTZ',
'T10','DJ','EM','EXE','FA','ISC','ICN','G','INP','PIE','T20','PYI','PT','Q','RSE','RET','SLF','SLOT','SIM',
'TID','TCH','INT','ARG','PTH','TD','FIX','ERA','PGH','PL','TRY','FLY','NPY','PERF','FURB','LOG','RUF'
]
ignore = [
# should be fixed and enabled
'SLF001','ANN001','ANN002','ANN003','ANN201','ANN202','ANN204','ANN205','ANN206','ANN401',
'PTH','PLR6301','FBT003','TRY400','TRY301','PLR0917','PIE807',
'PGH003','B904','S101','FA100','PLR0913','ARG002','PGH004','S311','A001','FBT001','FBT002',
'RUF012','UP007','TRY002','PLR0904','PLW1510','N818','Q000','S320',
'D212','D200','D213','D401','D205','D404','D203','D400','D415',
'DTZ005','FURB101','F841','TRY401','S403','PLR2004','ARG001','BLE001','B009','B010','C901','PLR0912','PLR0911',
'PLC0415','RUF003','TRY201','TRY300','S301','S102','S104','E721','PLW0603','RET503','PLR6201','PERF203',
'TRY003','EM102','RUF006','PYI055','RET501','PLC1901','RET502','PLC2801','EM101','B028','A002','DTZ006',
'PLR0402','PYI024','PYI024','PLW2901','S701','UP006','UP035',
# should be ignored
'ANN101','ANN102','D102','D101','CPY001','D100','D107','D106','B008','D103','D104','D105','D202',
'RET505','RET506','RET504','RSE102','TCH003','TCH002',
'COM812', 'ISC001', 'PT015',
]
[tool.ruff.lint.isort]
known-third-party = ['http_client']
#split-on-trailing-comma=false
[tool.ruff.lint.per-file-ignores]
'tests/**/*.py' = [
'S101', # asserts allowed in tests
'ARG', # Unused function args -> fixtures nevertheless are functionally relevant
'FBT', # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
'PLR2004', # Magic value used in comparison
'S311', # Standard pseudo-random generators are not suitable for cryptographic purposes
'PT009', 'PT027', # while using unittest
'ANN201',
'RUF001',
'E722','ERA001',
# should be fixed
'SIM300','PLC0414','S602','S404','S110','S603','INP001',
]
[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'