Skip to content

Commit a607ed3

Browse files
renovate[bot]JP-Ellis
authored andcommitted
chore(deps): update ruff to v0.7.1
Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent 8c5bcd6 commit a607ed3

File tree

5 files changed

+27
-34
lines changed

5 files changed

+27
-34
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ repos:
4242
additional_dependencies: ["@biomejs/biome@1.8.2"]
4343

4444
- repo: https://github.com/astral-sh/ruff-pre-commit
45-
rev: v0.7.0
45+
rev: v0.7.1
4646
hooks:
4747
- id: ruff
4848
# Exclude python files in pact/** and tests/**, except for the

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ devel-test = [
8787
"pytest-cov ~=5.0",
8888
"testcontainers ~=4.0",
8989
]
90-
devel = ["pact-python[devel-types,devel-docs,devel-test]", "ruff==0.7.0"]
90+
devel = ["pact-python[devel-types,devel-docs,devel-test]", "ruff==0.7.1"]
9191

9292
################################################################################
9393
## Hatch Build Configuration

src/pact/v3/error.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def __str__(self) -> str:
269269
extra = copy.deepcopy(self.request)
270270
extra.pop("method")
271271
extra.pop("path")
272-
return "Missing request: " f"{self.method} {self.path}: {extra}"
272+
return f"Missing request: {self.method} {self.path}: {extra}"
273273

274274

275275
class RequestNotFound(Mismatch):
@@ -342,7 +342,7 @@ def __str__(self) -> str:
342342
extra = copy.deepcopy(self.request)
343343
extra.pop("method")
344344
extra.pop("path")
345-
return "Request not found: " f"{self.method} {self.path}: {extra}"
345+
return f"Request not found: {self.method} {self.path}: {extra}"
346346

347347

348348
class RequestMismatch(Mismatch):

src/pact/v3/ffi.py

+8-15
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ def __init__(self, ptr: cffi.FFI.CData, *, owned: bool = False) -> None:
169169
"""
170170
if ffi.typeof(ptr).cname != "struct AsynchronousMessage *":
171171
msg = (
172-
"ptr must be a struct AsynchronousMessage, got"
173-
f" {ffi.typeof(ptr).cname}"
172+
f"ptr must be a struct AsynchronousMessage, got {ffi.typeof(ptr).cname}"
174173
)
175174
raise TypeError(msg)
176175
self._ptr = ptr
@@ -238,7 +237,7 @@ def __init__(self, ptr: cffi.FFI.CData) -> None:
238237
If the `ptr` is not a `struct Generator`.
239238
"""
240239
if ffi.typeof(ptr).cname != "struct Generator *":
241-
msg = "ptr must be a struct Generator, got" f" {ffi.typeof(ptr).cname}"
240+
msg = f"ptr must be a struct Generator, got {ffi.typeof(ptr).cname}"
242241
raise TypeError(msg)
243242
self._ptr = ptr
244243

@@ -457,7 +456,7 @@ def __init__(self, ptr: cffi.FFI.CData) -> None:
457456
If the `ptr` is not a `struct MatchingRule`.
458457
"""
459458
if ffi.typeof(ptr).cname != "struct MatchingRule *":
460-
msg = "ptr must be a struct MatchingRule, got" f" {ffi.typeof(ptr).cname}"
459+
msg = f"ptr must be a struct MatchingRule, got {ffi.typeof(ptr).cname}"
461460
raise TypeError(msg)
462461
self._ptr = ptr
463462

@@ -618,9 +617,7 @@ def __init__(self, ptr: cffi.FFI.CData, *, owned: bool = True) -> None:
618617
If the `ptr` is not a `struct MessageContents`.
619618
"""
620619
if ffi.typeof(ptr).cname != "struct MessageContents *":
621-
msg = (
622-
"ptr must be a struct MessageContents, got" f" {ffi.typeof(ptr).cname}"
623-
)
620+
msg = f"ptr must be a struct MessageContents, got {ffi.typeof(ptr).cname}"
624621
raise TypeError(msg)
625622
self._ptr = ptr
626623
self._owned = owned
@@ -761,8 +758,7 @@ def __init__(self, ptr: cffi.FFI.CData) -> None:
761758
"""
762759
if ffi.typeof(ptr).cname != "struct MessageMetadataPair *":
763760
msg = (
764-
"ptr must be a struct MessageMetadataPair, got"
765-
f" {ffi.typeof(ptr).cname}"
761+
f"ptr must be a struct MessageMetadataPair, got {ffi.typeof(ptr).cname}"
766762
)
767763
raise TypeError(msg)
768764
self._ptr = ptr
@@ -1146,7 +1142,7 @@ def __init__(self, ptr: cffi.FFI.CData) -> None:
11461142
If the `ptr` is not a `struct ProviderState`.
11471143
"""
11481144
if ffi.typeof(ptr).cname != "struct ProviderState *":
1149-
msg = "ptr must be a struct ProviderState, got" f" {ffi.typeof(ptr).cname}"
1145+
msg = f"ptr must be a struct ProviderState, got {ffi.typeof(ptr).cname}"
11501146
raise TypeError(msg)
11511147
self._ptr = ptr
11521148

@@ -1371,9 +1367,7 @@ def __init__(self, ptr: cffi.FFI.CData, *, owned: bool = False) -> None:
13711367
If the `ptr` is not a `struct SynchronousHttp`.
13721368
"""
13731369
if ffi.typeof(ptr).cname != "struct SynchronousHttp *":
1374-
msg = (
1375-
"ptr must be a struct SynchronousHttp, got" f" {ffi.typeof(ptr).cname}"
1376-
)
1370+
msg = f"ptr must be a struct SynchronousHttp, got {ffi.typeof(ptr).cname}"
13771371
raise TypeError(msg)
13781372
self._ptr = ptr
13791373
self._owned = owned
@@ -1452,8 +1446,7 @@ def __init__(self, ptr: cffi.FFI.CData, *, owned: bool = False) -> None:
14521446
"""
14531447
if ffi.typeof(ptr).cname != "struct SynchronousMessage *":
14541448
msg = (
1455-
"ptr must be a struct SynchronousMessage, got"
1456-
f" {ffi.typeof(ptr).cname}"
1449+
f"ptr must be a struct SynchronousMessage, got {ffi.typeof(ptr).cname}"
14571450
)
14581451
raise TypeError(msg)
14591452
self._ptr = ptr

tests/v3/compatibility_suite/util/interaction_definition.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -543,17 +543,17 @@ def add_to_pact( # noqa: C901, PLR0912, PLR0915
543543
interaction.test_name(self.test_name)
544544

545545
if self.query:
546-
assert isinstance(
547-
interaction, HttpInteraction
548-
), "Query parameters require an HTTP interaction"
546+
assert isinstance(interaction, HttpInteraction), (
547+
"Query parameters require an HTTP interaction"
548+
)
549549
query = URL.build(query_string=self.query).query
550550
logger.info("with_query_parameters(%r)", query.items())
551551
interaction.with_query_parameters(query.items())
552552

553553
if self.headers:
554-
assert isinstance(
555-
interaction, HttpInteraction
556-
), "Headers require an HTTP interaction"
554+
assert isinstance(interaction, HttpInteraction), (
555+
"Headers require an HTTP interaction"
556+
)
557557
logger.info("with_headers(%r)", self.headers.items())
558558
interaction.with_headers(self.headers.items())
559559

@@ -565,23 +565,23 @@ def add_to_pact( # noqa: C901, PLR0912, PLR0915
565565
interaction.with_matching_rules(self.matching_rules)
566566

567567
if self.response:
568-
assert isinstance(
569-
interaction, HttpInteraction
570-
), "Response requires an HTTP interaction"
568+
assert isinstance(interaction, HttpInteraction), (
569+
"Response requires an HTTP interaction"
570+
)
571571
logger.info("will_respond_with(%r)", self.response)
572572
interaction.will_respond_with(self.response)
573573

574574
if self.response_headers:
575-
assert isinstance(
576-
interaction, HttpInteraction
577-
), "Response headers require an HTTP interaction"
575+
assert isinstance(interaction, HttpInteraction), (
576+
"Response headers require an HTTP interaction"
577+
)
578578
logger.info("with_headers(%r)", self.response_headers)
579579
interaction.with_headers(self.response_headers.items(), "Response")
580580

581581
if self.response_body:
582-
assert isinstance(
583-
interaction, HttpInteraction
584-
), "Response body requires an HTTP interaction"
582+
assert isinstance(interaction, HttpInteraction), (
583+
"Response body requires an HTTP interaction"
584+
)
585585
self.response_body.add_to_interaction(interaction)
586586

587587
if self.response_matching_rules:

0 commit comments

Comments
 (0)