Skip to content

Commit f06f672

Browse files
committed
Replace black with ruff format; run it
1 parent e57796c commit f06f672

30 files changed

+65
-76
lines changed

benchmarks/basic_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def wrapper(*args, **kwargs):
5454
count = args[1]
5555
print(f"{func.__name__} - {count} Requests")
5656
print(f"Duration = {duration}")
57-
print(f"Rate = {count/duration}")
57+
print(f"Rate = {count / duration}")
5858
print()
5959
return ret
6060

benchmarks/command_packer_benchmark.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def pack_command(self, *args):
7878

7979

8080
class CommandPackerBenchmark(Benchmark):
81-
8281
ARGUMENTS = (
8382
{
8483
"name": "connection_class",

benchmarks/socket_read_size.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class SocketReadBenchmark(Benchmark):
7-
87
ARGUMENTS = (
98
{"name": "parser", "values": [PythonParser, _HiredisParser]},
109
{

dev_requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
build
2-
black==24.3.0
32
click==8.0.4
43
invoke==2.2.0
54
mock

redis/_parsers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
from .encoders import Encoder
3333
from .socket import SERVER_CLOSED_CONNECTION_ERROR, SocketBuffer
3434

35-
MODULE_LOAD_ERROR = "Error loading the extension. " "Please check the server logs."
35+
MODULE_LOAD_ERROR = "Error loading the extension. Please check the server logs."
3636
NO_SUCH_MODULE_ERROR = "Error unloading module: no such module with that name"
37-
MODULE_UNLOAD_NOT_POSSIBLE_ERROR = "Error unloading module: operation not " "possible."
37+
MODULE_UNLOAD_NOT_POSSIBLE_ERROR = "Error unloading module: operation not possible."
3838
MODULE_EXPORTS_DATA_TYPES_ERROR = (
3939
"Error unloading module: the module "
4040
"exports one or more module-side data "

redis/asyncio/cluster.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,7 @@ def get_node(
11541154
return self.nodes_cache.get(node_name)
11551155
else:
11561156
raise DataError(
1157-
"get_node requires one of the following: "
1158-
"1. node name "
1159-
"2. host and port"
1157+
"get_node requires one of the following: 1. node name 2. host and port"
11601158
)
11611159

11621160
def set_nodes(
@@ -1338,7 +1336,7 @@ async def initialize(self) -> None:
13381336
if len(disagreements) > 5:
13391337
raise RedisClusterException(
13401338
f"startup_nodes could not agree on a valid "
1341-
f'slots cache: {", ".join(disagreements)}'
1339+
f"slots cache: {', '.join(disagreements)}"
13421340
)
13431341

13441342
# Validate if all slots are covered or if we should try next startup node

redis/auth/token.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def get_received_at_ms(self) -> float:
7676

7777

7878
class JWToken(TokenInterface):
79-
8079
REQUIRED_FIELDS = {"exp"}
8180

8281
def __init__(self, token: str):

redis/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,8 +1514,7 @@ def raise_first_error(self, commands, response):
15141514
def annotate_exception(self, exception, number, command):
15151515
cmd = " ".join(map(safe_str, command))
15161516
msg = (
1517-
f"Command # {number} ({cmd}) of pipeline "
1518-
f"caused error: {exception.args[0]}"
1517+
f"Command # {number} ({cmd}) of pipeline caused error: {exception.args[0]}"
15191518
)
15201519
exception.args = (msg,) + exception.args[1:]
15211520

redis/cluster.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ def initialize(self):
16281628
if len(disagreements) > 5:
16291629
raise RedisClusterException(
16301630
f"startup_nodes could not agree on a valid "
1631-
f'slots cache: {", ".join(disagreements)}'
1631+
f"slots cache: {', '.join(disagreements)}"
16321632
)
16331633

16341634
fully_covered = self.check_slots_coverage(tmp_slots)
@@ -2047,8 +2047,7 @@ def annotate_exception(self, exception, number, command):
20472047
"""
20482048
cmd = " ".join(map(safe_str, command))
20492049
msg = (
2050-
f"Command # {number} ({cmd}) of pipeline "
2051-
f"caused error: {exception.args[0]}"
2050+
f"Command # {number} ({cmd}) of pipeline caused error: {exception.args[0]}"
20522051
)
20532052
exception.args = (msg,) + exception.args[1:]
20542053

redis/commands/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def cluster_setslot(
595595
"CLUSTER SETSLOT", slot_id, state, node_id, target_nodes=target_node
596596
)
597597
elif state.upper() == "STABLE":
598-
raise RedisError('For "stable" state please use ' "cluster_setslot_stable")
598+
raise RedisError('For "stable" state please use cluster_setslot_stable')
599599
else:
600600
raise RedisError(f"Invalid slot state: {state}")
601601

0 commit comments

Comments
 (0)