Skip to content

Commit 0a8d532

Browse files
ci: pre-commit autoupdate [skip ci] (#5562)
* ci: pre-commit autoupdate [skip ci] updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.4](astral-sh/ruff-pre-commit@v0.14.14...v0.15.4) - [github.com/bufbuild/buf: v1.64.0 → v1.66.0](bufbuild/buf@v1.64.0...v1.66.0) * ci: auto fixes from pre-commit.ci For more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7e13576 commit 0a8d532

File tree

5 files changed

+47
-38
lines changed

5 files changed

+47
-38
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ci:
88
exclude: '(.*\.(css|js|svg))|(.*/(snippets|grpc|proto)/.*)$'
99
repos:
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: 'v0.14.14'
11+
rev: 'v0.15.4'
1212
hooks:
1313
- id: ruff-check
1414
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
@@ -25,7 +25,7 @@ repos:
2525
hooks:
2626
- id: pdm-lock-check
2727
- repo: https://github.com/bufbuild/buf
28-
rev: v1.64.0
28+
rev: v1.66.0
2929
hooks:
3030
- id: buf-format
3131
args: [--config=src/bentoml/grpc/buf.yaml, src/bentoml/grpc]

src/_bentoml_impl/server/serving.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -387,16 +387,18 @@ def serve_http(
387387
)
388388
arbiter.exit_stack.callback(shutil.rmtree, uds_path, ignore_errors=True)
389389
arbiter.start(
390-
cb=lambda _: logger.info( # type: ignore
391-
'Starting production %s BentoServer from "%s" listening on %s://%s:%d (Press CTRL+C to quit)',
392-
scheme.upper(),
393-
bento_identifier,
394-
scheme,
395-
log_host,
396-
port,
397-
)
398-
if not svc.has_custom_command()
399-
else None,
390+
cb=lambda _: (
391+
logger.info( # type: ignore
392+
'Starting production %s BentoServer from "%s" listening on %s://%s:%d (Press CTRL+C to quit)',
393+
scheme.upper(),
394+
bento_identifier,
395+
scheme,
396+
log_host,
397+
port,
398+
)
399+
if not svc.has_custom_command()
400+
else None
401+
),
400402
)
401403
return Server(url=f"{scheme}://{log_host}:{port}", arbiter=arbiter)
402404
except Exception:

src/bentoml_cli/containerize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ def obsolete_callback(ctx: Context, param: Parameter, value: ClickParamType):
118118
)
119119
new_format = " ".join(
120120
map(
121-
lambda s: "--%s %s=%s"
122-
% (equivalent[0], opt.lstrip("--"), s),
121+
lambda s: (
122+
"--%s %s=%s" % (equivalent[0], opt.lstrip("--"), s)
123+
),
123124
value,
124125
)
125126
)

tests/e2e/bento_server_grpc/tests/test_descriptors.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ async def test_json(host: str):
143143
data={
144144
"serialized_bytes": b'{"request_id": "123", "iris_features": {"sepal_len":2.34,"sepal_width":1.58, "petal_len":6.52, "petal_width":3.23}}'
145145
},
146-
assert_data=lambda resp: resp.json # type: ignore (bad lambda types)
147-
== make_iris_proto(
148-
sepal_len=struct_pb2.Value(number_value=2.34),
149-
sepal_width=struct_pb2.Value(number_value=1.58),
150-
petal_len=struct_pb2.Value(number_value=6.52),
151-
petal_width=struct_pb2.Value(number_value=3.23),
146+
assert_data=lambda resp: (
147+
resp.json # type: ignore (bad lambda types)
148+
== make_iris_proto(
149+
sepal_len=struct_pb2.Value(number_value=2.34),
150+
sepal_width=struct_pb2.Value(number_value=1.58),
151+
petal_len=struct_pb2.Value(number_value=6.52),
152+
petal_width=struct_pb2.Value(number_value=3.23),
153+
)
152154
),
153155
)
154156
await async_client_call(
@@ -211,8 +213,10 @@ async def test_file(host: str, bin_file: str):
211213
"predict_file",
212214
channel=channel,
213215
data={"file": pb.File(kind="application/octet-stream", content=fb)},
214-
assert_data=lambda resp: resp.file.content == b"\x810\x899"
215-
and resp.file.kind == "application/octet-stream",
216+
assert_data=lambda resp: (
217+
resp.file.content == b"\x810\x899"
218+
and resp.file.kind == "application/octet-stream"
219+
),
216220
)
217221
await async_client_call(
218222
"predict_file",
@@ -329,10 +333,12 @@ async def test_pandas(host: str):
329333
columns=[pb.Series(int64_values=[23])],
330334
),
331335
},
332-
assert_data=lambda resp: resp.dataframe # type: ignore (bad lambda types)
333-
== pb.DataFrame(
334-
column_names=["col1"],
335-
columns=[pb.Series(int64_values=[46])],
336+
assert_data=lambda resp: (
337+
resp.dataframe # type: ignore (bad lambda types)
338+
== pb.DataFrame(
339+
column_names=["col1"],
340+
columns=[pb.Series(int64_values=[46])],
341+
)
336342
),
337343
)
338344
await async_client_call(
@@ -360,8 +366,9 @@ async def test_pandas_series(host: str):
360366
"echo_series_from_sample",
361367
channel=channel,
362368
data={"series": pb.Series(float_values=[1.0, 2.0, 3.0])},
363-
assert_data=lambda resp: resp.series
364-
== pb.Series(float_values=[1.0, 2.0, 3.0]),
369+
assert_data=lambda resp: (
370+
resp.series == pb.Series(float_values=[1.0, 2.0, 3.0])
371+
),
365372
)
366373

367374

tests/integration/frameworks/models/transformers.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,18 +257,16 @@ def check_model(_: transformers_ext.TransformersPipeline, __: AnyDict) -> None:
257257
"__call__": [
258258
Input(
259259
input_args=["i love you"],
260-
expected=lambda out: nested_simplify(
261-
out["score"], decimals=4
262-
)
263-
== 0.5036,
260+
expected=lambda out: (
261+
nested_simplify(out["score"], decimals=4) == 0.5036
262+
),
264263
),
265264
Input(
266265
input_args=["I hate you"],
267266
input_kwargs={"second_text": "I love you"},
268-
expected=lambda out: nested_simplify(
269-
out["score"], decimals=4
270-
)
271-
== 0.5036,
267+
expected=lambda out: (
268+
nested_simplify(out["score"], decimals=4) == 0.5036
269+
),
272270
),
273271
],
274272
},
@@ -483,8 +481,9 @@ def check_vit_output(output: tuple[int, int, int] | t.Any) -> bool:
483481
"__call__": [
484482
Input(
485483
input_args=[im],
486-
expected=lambda output: output["pixel_values"][0].shape
487-
== (3, 224, 224),
484+
expected=lambda output: (
485+
output["pixel_values"][0].shape == (3, 224, 224)
486+
),
488487
)
489488
]
490489
}

0 commit comments

Comments
 (0)