Skip to content

Commit

Permalink
update black version
Browse files Browse the repository at this point in the history
  • Loading branch information
jrotkiewicz committed Dec 20, 2024
1 parent b13e4ca commit 3a7346a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
3 changes: 1 addition & 2 deletions avatar/metrics/interceptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ def aio_interceptors(device: PandoraClient) -> Sequence[grpc.aio.ClientIntercept


class UnaryOutcome(Protocol, Generic[_T_co]):
def result(self) -> _T_co:
...
def result(self) -> _T_co: ...


class UnaryUnaryInterceptor(grpc.UnaryUnaryClientInterceptor): # type: ignore[misc]
Expand Down
45 changes: 28 additions & 17 deletions avatar/metrics/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ def setup_test(self: BaseTestClass) -> None:


class AsTrace(Protocol):
def as_trace(self) -> TracePacket:
...
def as_trace(self) -> TracePacket: ...


class Callsite(AsTrace):
Expand Down Expand Up @@ -156,11 +155,15 @@ def as_trace(self) -> TracePacket:
name=self.name,
type=TrackEvent.Type.TYPE_SLICE_BEGIN,
track_uuid=devices_id[self.device],
debug_annotations=None
if self.message is None
else [
DebugAnnotation(name=self.message.__class__.__name__, dict_entries=debug_message(self.message)[1])
],
debug_annotations=(
None
if self.message is None
else [
DebugAnnotation(
name=self.message.__class__.__name__, dict_entries=debug_message(self.message)[1]
)
]
),
),
trusted_packet_sequence_id=devices_process_id[self.device],
)
Expand All @@ -184,11 +187,15 @@ def as_trace(self) -> TracePacket:
name=self.callsite.name,
type=TrackEvent.Type.TYPE_INSTANT,
track_uuid=devices_id[self.callsite.device],
debug_annotations=None
if self.message is None
else [
DebugAnnotation(name=self.message.__class__.__name__, dict_entries=debug_message(self.message)[1])
],
debug_annotations=(
None
if self.message is None
else [
DebugAnnotation(
name=self.message.__class__.__name__, dict_entries=debug_message(self.message)[1]
)
]
),
),
trusted_packet_sequence_id=devices_process_id[self.callsite.device],
)
Expand Down Expand Up @@ -228,11 +235,15 @@ def as_trace(self) -> TracePacket:
name=self.callsite.name,
type=TrackEvent.Type.TYPE_SLICE_END,
track_uuid=devices_id[self.callsite.device],
debug_annotations=None
if self.message is None
else [
DebugAnnotation(name=self.message.__class__.__name__, dict_entries=debug_message(self.message)[1])
],
debug_annotations=(
None
if self.message is None
else [
DebugAnnotation(
name=self.message.__class__.__name__, dict_entries=debug_message(self.message)[1]
)
]
),
),
trusted_packet_sequence_id=devices_process_id[self.callsite.device],
)
Expand Down
1 change: 1 addition & 0 deletions avatar/metrics/trace_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class TrackEvent(_message.Message):
TYPE_SLICE_END: _ClassVar[TrackEvent.Type]
TYPE_INSTANT: _ClassVar[TrackEvent.Type]
TYPE_COUNTER: _ClassVar[TrackEvent.Type]

TYPE_UNSPECIFIED: TrackEvent.Type
TYPE_SLICE_BEGIN: TrackEvent.Type
TYPE_SLICE_END: TrackEvent.Type
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dev = [
"grpcio-tools>=1.62.1",
"pyright==1.1.298",
"mypy==1.5.1",
"black==23.7.0",
"black==24.10.0",
"isort==5.12.0",
"types-psutil==5.9.5.16",
"types-setuptools==68.1.0.1",
Expand Down

0 comments on commit 3a7346a

Please sign in to comment.