Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 9f60796

Browse files
Bump ruff from 0.8.6 to 0.9.4 (#1062)
* Bump ruff from 0.8.6 to 0.9.4 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.6 to 0.9.4. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.8.6...0.9.4) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * make fmt --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Chris Kuehl <[email protected]>
1 parent 06d5297 commit 9f60796

File tree

7 files changed

+65
-68
lines changed

7 files changed

+65
-68
lines changed

baseplate/frameworks/queue_consumer/kafka.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ def make_kafka_consumer(
343343

344344
all_topics = set(metadata.topics.keys())
345345
for topic in topics:
346-
assert (
347-
topic in all_topics
348-
), f"topic '{topic}' does not exist. maybe it's misspelled or on a different kafka cluster?" # noqa: E501
346+
assert topic in all_topics, (
347+
f"topic '{topic}' does not exist. maybe it's misspelled or on a different kafka cluster?" # noqa: E501
348+
)
349349

350350
# pylint: disable=unused-argument
351351
def log_assign(

poetry.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def on_set_tag(self, key, value):
5151

5252
def assert_tag(self, key, value):
5353
assert key in self.tags, f"{key!r} not found in tags ({list(self.tags.keys())!r})"
54-
assert (
55-
self.tags[key] == value
56-
), f"tag {key!r}: expected value {value!r} but found {self.tags[key]!r}"
54+
assert self.tags[key] == value, (
55+
f"tag {key!r}: expected value {value!r} but found {self.tags[key]!r}"
56+
)
5757

5858
def on_log(self, name, payload):
5959
self.logs.append((name, payload))

tests/integration/redis_testcase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from . import TestBaseplateObserver, get_endpoint_or_skip_container
99

10-
redis_url = f'redis://{get_endpoint_or_skip_container("redis", 6379)}'
11-
redis_cluster_url = f'redis://{get_endpoint_or_skip_container("redis-cluster-node", 7000)}'
10+
redis_url = f"redis://{get_endpoint_or_skip_container('redis', 6379)}"
11+
redis_cluster_url = f"redis://{get_endpoint_or_skip_container('redis-cluster-node', 7000)}"
1212

1313

1414
class RedisIntegrationTestConfigurationError(Exception):

tests/unit/clients/redis_cluster_tests.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,25 @@ def test_pipeline_instrumentation(self, monitored_redis_connection, expected_lab
149149
"goodbye", 23
150150
).execute()
151151
labels = {**active_labels, "redis_success": "false"}
152-
assert (
153-
REGISTRY.get_sample_value(f"{REQUESTS_TOTAL._name}_total", labels) == 1.0
154-
), "Unexpected value for REQUESTS_TOTAL metric. Expected one 'pipeline' command"
152+
assert REGISTRY.get_sample_value(f"{REQUESTS_TOTAL._name}_total", labels) == 1.0, (
153+
"Unexpected value for REQUESTS_TOTAL metric. Expected one 'pipeline' command"
154+
)
155155
assert (
156156
REGISTRY.get_sample_value(
157157
f"{LATENCY_SECONDS._name}_bucket", {**labels, "le": "+Inf"}
158158
)
159159
== 1.0
160160
), "Expected one 'pipeline' latency request"
161-
assert (
162-
mock_manager.mock_calls
163-
== [
164-
mock.call.inc(),
165-
mock.call.dec(),
166-
]
167-
), "Instrumentation should increment and then decrement active requests exactly once" # noqa: E501
161+
assert mock_manager.mock_calls == [
162+
mock.call.inc(),
163+
mock.call.dec(),
164+
], (
165+
"Instrumentation should increment and then decrement active requests exactly once" # noqa: E501
166+
)
168167
print(list(REGISTRY.collect()))
169-
assert (
170-
REGISTRY.get_sample_value(ACTIVE_REQUESTS._name, active_labels) == 0.0
171-
), "Should have 0 (and not None) active requests"
168+
assert REGISTRY.get_sample_value(ACTIVE_REQUESTS._name, active_labels) == 0.0, (
169+
"Should have 0 (and not None) active requests"
170+
)
172171

173172

174173
class HotKeyTrackerTests(unittest.TestCase):

tests/unit/clients/redis_tests.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,24 @@ def test_pipeline_instrumentation(self, monitored_redis_connection, expected_lab
147147
"goodbye", 23
148148
).execute()
149149
labels = {**active_labels, "redis_success": "true"}
150-
assert (
151-
REGISTRY.get_sample_value(f"{REQUESTS_TOTAL._name}_total", labels) == 1.0
152-
), "Unexpected value for REQUESTS_TOTAL metric. Expected one 'pipeline' command"
150+
assert REGISTRY.get_sample_value(f"{REQUESTS_TOTAL._name}_total", labels) == 1.0, (
151+
"Unexpected value for REQUESTS_TOTAL metric. Expected one 'pipeline' command"
152+
)
153153
assert (
154154
REGISTRY.get_sample_value(
155155
f"{LATENCY_SECONDS._name}_bucket", {**labels, "le": "+Inf"}
156156
)
157157
== 1.0
158158
), "Expected one 'pipeline' latency request"
159-
assert (
160-
mock_manager.mock_calls
161-
== [
162-
mock.call.inc(),
163-
mock.call.dec(),
164-
]
165-
), "Instrumentation should increment and then decrement active requests exactly once" # noqa: E501
166-
assert (
167-
REGISTRY.get_sample_value(ACTIVE_REQUESTS._name, active_labels) == 0.0
168-
), "Should have 0 (and not None) active requests"
159+
assert mock_manager.mock_calls == [
160+
mock.call.inc(),
161+
mock.call.dec(),
162+
], (
163+
"Instrumentation should increment and then decrement active requests exactly once" # noqa: E501
164+
)
165+
assert REGISTRY.get_sample_value(ACTIVE_REQUESTS._name, active_labels) == 0.0, (
166+
"Should have 0 (and not None) active requests"
167+
)
169168

170169
def test_pipeline_instrumentation_failing(
171170
self,
@@ -197,25 +196,24 @@ def test_pipeline_instrumentation_failing(
197196
"goodbye", 23
198197
).execute()
199198
labels = {**active_labels, "redis_success": "false"}
200-
assert (
201-
REGISTRY.get_sample_value(f"{REQUESTS_TOTAL._name}_total", labels) == 1.0
202-
), "Unexpected value for REQUESTS_TOTAL metric. Expected one 'pipeline' command"
199+
assert REGISTRY.get_sample_value(f"{REQUESTS_TOTAL._name}_total", labels) == 1.0, (
200+
"Unexpected value for REQUESTS_TOTAL metric. Expected one 'pipeline' command"
201+
)
203202
assert (
204203
REGISTRY.get_sample_value(
205204
f"{LATENCY_SECONDS._name}_bucket", {**labels, "le": "+Inf"}
206205
)
207206
== 1.0
208207
), "Expected one 'pipeline' latency request"
209-
assert (
210-
mock_manager.mock_calls
211-
== [
212-
mock.call.inc(),
213-
mock.call.dec(),
214-
]
215-
), "Instrumentation should increment and then decrement active requests exactly once" # noqa: E501
216-
assert (
217-
REGISTRY.get_sample_value(ACTIVE_REQUESTS._name, active_labels) == 0.0
218-
), "Should have 0 (and not None) active requests"
208+
assert mock_manager.mock_calls == [
209+
mock.call.inc(),
210+
mock.call.dec(),
211+
], (
212+
"Instrumentation should increment and then decrement active requests exactly once" # noqa: E501
213+
)
214+
assert REGISTRY.get_sample_value(ACTIVE_REQUESTS._name, active_labels) == 0.0, (
215+
"Should have 0 (and not None) active requests"
216+
)
219217

220218

221219
class TestPoolFromConfig:

tests/unit/lib/secrets/vault_csi_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def new_fake_csi(data: dict[str, SecretType]) -> Path:
4949
Note that this would already be configured before the pod starts."""
5050
csi_dir = Path(tempfile.mkdtemp())
5151
# Closely resembles but doesn't precisely match the actual CSI plugin
52-
data_path = Path(csi_dir, f'..{datetime.datetime.today().strftime("%Y_%m_%d_%H_%M_%S.%f")}')
52+
data_path = Path(csi_dir, f"..{datetime.datetime.today().strftime('%Y_%m_%d_%H_%M_%S.%f')}")
5353
write_secrets(data_path, data)
5454
write_symlinks(data_path)
5555
return csi_dir
@@ -61,7 +61,7 @@ def simulate_secret_update(
6161
"""Simulates either TTL expiry / a secret update."""
6262
old_data_path = csi_dir.joinpath("..data").resolve()
6363
# Clone the data directory
64-
new_data_path = Path(csi_dir, f'..{datetime.datetime.today().strftime("%Y_%m_%d_%H_%M_%S.%f")}')
64+
new_data_path = Path(csi_dir, f"..{datetime.datetime.today().strftime('%Y_%m_%d_%H_%M_%S.%f')}")
6565
# Update the secret
6666
if updated_data:
6767
write_secrets(new_data_path, updated_data)

0 commit comments

Comments
 (0)