Skip to content

Commit 02b7451

Browse files
committed
cc userver: enable Ruff checks for idiomatic typing for Python 3.10
commit_hash:c33d70ab936610e0c8b9c09344058307943ff1ab
1 parent bac0e74 commit 02b7451

File tree

16 files changed

+24
-19
lines changed

16 files changed

+24
-19
lines changed

chaotic-openapi/chaotic_openapi/back/cpp_client/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Generator
12
import dataclasses
2-
from typing import Generator
33

44
from chaotic import cpp_names
55
from chaotic import error

chaotic/chaotic/back/cpp/translator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def to_camel_case(text: str) -> str:
314314
value=val,
315315
raw_name=raw_name,
316316
cpp_name=to_camel_case(raw_name),
317-
) # noqa: COM812
317+
),
318318
)
319319

320320
return cpp_types.CppIntEnum(

clickhouse/functional_tests/basic_chaos/tests/test_clickhouse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
async def _check_that_restores(client, gate):
66
try:
77
await gate.wait_for_connections(timeout=30.0)
8-
except asyncio.TimeoutError: # noqa: UP041
8+
except asyncio.TimeoutError:
99
assert False, 'Timeout while waiting for restore'
1010

1111
assert gate.connections_count() >= 1

core/functional_tests/basic_chaos/tests/httpserver/test_httpserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def _call(
6363
data=data,
6464
testsuite_skip_prepare=testsuite_skip_prepare,
6565
)
66-
except asyncio.TimeoutError: # noqa: UP041
66+
except asyncio.TimeoutError:
6767
return ErrorType.TIMEOUT
6868
except exceptions.ServerDisconnectedError:
6969
return ErrorType.DISCONNECT

grpc/functional_tests/basic_chaos/tests-grpcclient/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async def _grpc_session_ch(grpc_mockserver_session, grpc_service_port_local):
9696
async def grpc_ch(_grpc_session_ch, grpc_service_port_local):
9797
try:
9898
await asyncio.wait_for(_grpc_session_ch.channel_ready(), timeout=10)
99-
except asyncio.TimeoutError: # noqa: UP041
99+
except asyncio.TimeoutError:
100100
raise RuntimeError(
101101
f'Failed to connect to remote gRPC server by address [::1]:{grpc_service_port_local}',
102102
)

grpc/functional_tests/basic_chaos/tests-grpcserver/requests_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async def check_ok_for(case, grpc_client, gate):
130130
return
131131
except grpc.RpcError as error:
132132
logger.warning(f'Error at "{case}" (attempt {i}): {error.code()}')
133-
except asyncio.TimeoutError: # noqa: UP041
133+
except asyncio.TimeoutError:
134134
logger.warning(f'Error at "{case}" (attempt {i}): timeout')
135135
assert False, f'{case}: all attempts failed'
136136

@@ -142,7 +142,7 @@ async def check_unavailable_for(case, grpc_client, gate):
142142
timeout=10.0,
143143
)
144144
assert False, 'Server must return UNAVAILABLE'
145-
except asyncio.TimeoutError: # noqa: UP041
145+
except asyncio.TimeoutError:
146146
assert False, 'Client channel not ready by timeout'
147147
except grpc.RpcError as error:
148148
assert grpc.StatusCode.UNAVAILABLE == error.code()

mongo/functional_tests/basic_chaos/tests/test_mongo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async def _check_that_restores(service_client, gate: chaos.TcpGate):
1414

1515
try:
1616
await gate.wait_for_connections(timeout=10.0)
17-
except asyncio.TimeoutError: # noqa: UP041
17+
except asyncio.TimeoutError:
1818
assert False, 'Timeout while waiting for restore'
1919

2020
assert gate.connections_count() >= 1

mysql/functional_tests/basic_chaos/tests/test_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
async def _check_that_restores(client, gate):
55
try:
66
await gate.wait_for_connections(timeout=30.0)
7-
except asyncio.TimeoutError: # noqa: UP041
7+
except asyncio.TimeoutError:
88
assert False, 'Timeout while waiting for restore'
99

1010
assert gate.connections_count() >= 1

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ implicit_optional = true
33
disable_error_code = ["name-match", "arg-type"]
44

55
[tool.ruff]
6-
target-version = "py312"
6+
target-version = "py310"
77
line-length = 120
88

99
[tool.ruff.format]
@@ -20,9 +20,15 @@ docstring-code-line-length = "dynamic"
2020
[tool.ruff.lint]
2121
preview = true
2222
select = [
23+
"I",
24+
"PYI026",
25+
"PYI032",
2326
"Q000",
27+
"UP006",
28+
"UP007",
29+
"UP035",
30+
"UP045",
2431
"W291",
25-
"I",
2632
]
2733
ignore = []
2834
unfixable = []

redis/functional_tests/basic_chaos/tests/test_redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
async def _check_that_restores(client, gate):
77
try:
88
await gate.wait_for_connections(timeout=10.0)
9-
except asyncio.TimeoutError: # noqa: UP041
9+
except asyncio.TimeoutError:
1010
assert False, 'Timeout while waiting for restore'
1111

1212
assert gate.connections_count() >= 1

0 commit comments

Comments
 (0)