Skip to content

Commit b933810

Browse files
committed
fix: update proto2pydantic to v0.5.0 with ruff-compliant output
- gen_proto.sh: bump proto2pydantic v0.4.0 -> v0.5.0 - a2a_pydantic.py: improved millisecond formatting in timestamp serializer
1 parent 45904ac commit b933810

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/gen_proto.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
set -e
33

44
# Install proto2pydantic plugin for Pydantic model generation
5-
echo "Installing protoc-gen-proto2pydantic@v0.4.0..."
6-
go install github.com/protocgen/proto2pydantic@v0.4.0
5+
echo "Installing protoc-gen-proto2pydantic@v0.5.0..."
6+
go install github.com/protocgen/proto2pydantic@v0.5.0
77

88
# Run buf generate to regenerate protobuf code and OpenAPI spec
99
npx --yes @bufbuild/buf generate

src/a2a/types/a2a_pydantic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def _serialize_timestamp(cls, v: datetime | None, _info: Any) -> str | None:
128128
"""Serialize datetime to RFC 3339 with UTC 'Z' suffix for ProtoJSON."""
129129
if v is None:
130130
return None
131-
return v.strftime('%Y-%m-%dT%H:%M:%S.') + f'{v.microsecond:06d}'[:3] + 'Z'
131+
return v.strftime('%Y-%m-%dT%H:%M:%S.') + f'{v.microsecond // 1000:03d}' + 'Z'
132132

133133

134134

@@ -528,7 +528,7 @@ def _serialize_timestamp(cls, v: datetime | None, _info: Any) -> str | None:
528528
"""Serialize datetime to RFC 3339 with UTC 'Z' suffix for ProtoJSON."""
529529
if v is None:
530530
return None
531-
return v.strftime('%Y-%m-%dT%H:%M:%S.') + f'{v.microsecond:06d}'[:3] + 'Z'
531+
return v.strftime('%Y-%m-%dT%H:%M:%S.') + f'{v.microsecond // 1000:03d}' + 'Z'
532532

533533

534534

0 commit comments

Comments
 (0)