Skip to content

Commit cf6eec6

Browse files
committed
fix linters
Signed-off-by: Mikhail Koviazin <github@mkmk.aleeas.com>
1 parent 2850c9e commit cf6eec6

4 files changed

Lines changed: 22 additions & 14 deletions

File tree

tests/test_asyncio/test_commands.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
import pytest
1616
import pytest_asyncio
17-
from valkey import __version__ as VALKEY_VERSION
1817
import valkey.asyncio as valkey
19-
from valkey.typing import KeyT, StreamIdT, StringTypeT
2018
from packaging.version import Version
2119
from tests.conftest import (
2220
assert_geo_is_close,
@@ -28,6 +26,7 @@
2826
skip_if_server_version_lt,
2927
skip_unless_arch_bits,
3028
)
29+
from valkey import __version__ as VALKEY_VERSION
3130
from valkey import exceptions
3231
from valkey._parsers.helpers import (
3332
_ValkeyCallbacks,
@@ -36,6 +35,7 @@
3635
parse_info,
3736
)
3837
from valkey.client import EMPTY_RESPONSE, NEVER_DECODE
38+
from valkey.typing import KeyT, StreamIdT, StringTypeT
3939

4040
if sys.version_info >= (3, 11, 3):
4141
from asyncio import timeout as async_timeout
@@ -514,7 +514,9 @@ async def test_client_capa_redirect_on_replica(self, r: valkey.Valkey):
514514
info = await replica.info("replication")
515515
assert info["role"] in ("slave", "replica")
516516
expected_host = info["master_host"]
517-
expected_port = int(info["master_port"]) # type: ignore[arg-type] # TODO: fix
517+
expected_port = int(
518+
info["master_port"] # type: ignore[arg-type] # TODO: fix
519+
)
518520

519521
with pytest.raises(valkey.RedirectError) as exc_get:
520522
await replica.get(key)
@@ -566,10 +568,16 @@ async def test_config_get(self, r: valkey.Valkey):
566568
@pytest.mark.onlynoncluster
567569
async def test_config_resetstat(self, r: valkey.Valkey):
568570
await r.ping()
569-
prior_commands_processed = int((await r.info())["total_commands_processed"]) # type: ignore[arg-type] # TODO: fix
571+
# TODO: fix
572+
prior_commands_processed = int(
573+
(await r.info())["total_commands_processed"] # type: ignore[arg-type]
574+
)
570575
assert prior_commands_processed >= 1
571576
await r.config_resetstat()
572-
reset_commands_processed = int((await r.info())["total_commands_processed"]) # type: ignore[arg-type] # TODO: fix
577+
# TODO: fix
578+
reset_commands_processed = int(
579+
(await r.info())["total_commands_processed"] # type: ignore[arg-type]
580+
)
573581
assert reset_commands_processed < prior_commands_processed
574582

575583
async def test_config_set(self, r: valkey.Valkey):

valkey/asyncio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Dict,
1414
Iterable,
1515
List,
16+
Literal,
1617
Mapping,
1718
MutableMapping,
1819
Optional,
@@ -25,7 +26,6 @@
2526
Union,
2627
cast,
2728
)
28-
from typing import Literal
2929

3030
from valkey._cache import (
3131
DEFAULT_ALLOW_LIST,

valkey/asyncio/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
Dict,
1212
Generator,
1313
List,
14+
Literal,
1415
Mapping,
1516
Optional,
1617
Tuple,
1718
Type,
1819
TypeVar,
1920
Union,
2021
)
21-
from typing import Literal
2222

2323
from valkey._cache import (
2424
DEFAULT_ALLOW_LIST,

valkey/commands/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Literal,
1717
Mapping,
1818
NoReturn,
19-
Optional,
2019
Sequence,
2120
TypeVar,
2221
Union,
@@ -31,16 +30,18 @@
3130
AnyEncodableT,
3231
AnyFieldT,
3332
AnyKeyT,
34-
AnyStreamIdT,
3533
AsyncClientProtocol,
3634
BitfieldOffsetT,
3735
BlockingPopResult,
36+
BZPopResultT,
3837
ChannelT,
3938
CommandsProtocol,
4039
ConsumerT,
4140
EncodableT,
4241
ExpiryT,
4342
FieldT,
43+
FunctionListEntryT,
44+
FunctionStatsT,
4445
GeoSearchReplyT,
4546
GroupT,
4647
InfoData,
@@ -49,8 +50,6 @@
4950
LCSIdxData,
5051
MemoryStatsData,
5152
PatternT,
52-
FunctionListEntryT,
53-
FunctionStatsT,
5453
ResponseT,
5554
ScriptTextT,
5655
StreamEntryT,
@@ -59,10 +58,9 @@
5958
StreamReadResp3T,
6059
StringTypeT,
6160
SyncClientProtocol,
62-
BZPopResultT,
6361
TimeoutSecT,
64-
XPendingResult,
6562
XPendingRangeEntry,
63+
XPendingResult,
6664
ZMPopResultT,
6765
ZPopResultT,
6866
ZScoreBoundT,
@@ -8490,7 +8488,9 @@ def zrange(
84908488
# Need to support ``desc`` also when using old redis version
84918489
# because it was supported in 3.5.3 (of redis-py)
84928490
if not byscore and not bylex and (offset is None and num is None) and desc:
8493-
return self.zrevrange(name, start, end, withscores, score_cast_func) # type: ignore[misc]
8491+
return self.zrevrange( # type: ignore[misc]
8492+
name, start, end, withscores, score_cast_func
8493+
)
84948494

84958495
return self._zrange(
84968496
"ZRANGE",

0 commit comments

Comments
 (0)