plexus-msgs-python 1.0.9__py3-none-any.whl → 1.0.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plexus/msgs/utils.py CHANGED
@@ -6,7 +6,7 @@ import pkgutil
6
6
  import textwrap
7
7
  from collections.abc import Callable
8
8
  from types import ModuleType
9
- from typing import Any, TypeVar
9
+ from typing import Any
10
10
 
11
11
  import jinja2
12
12
  from google.protobuf import descriptor_pool, message_factory
@@ -42,8 +42,6 @@ __all__ = [
42
42
  "copy_plexus_message_2",
43
43
  ]
44
44
 
45
- MessageT = TypeVar("MessageT", bound=Message)
46
-
47
45
 
48
46
  @singleton
49
47
  def import_plexus_msgs():
@@ -60,7 +58,7 @@ def plexus_msgs_descriptor_path() -> str:
60
58
 
61
59
 
62
60
  @memorized
63
- def get_protobuf_class(name: str) -> Callable[..., MessageT]:
61
+ def get_protobuf_class[MessageT: Message](name: str) -> Callable[..., MessageT]:
64
62
  """Returns the protobuf class for a given name"""
65
63
  import_plexus_msgs()
66
64
 
@@ -69,7 +67,7 @@ def get_protobuf_class(name: str) -> Callable[..., MessageT]:
69
67
  return message_factory.GetMessageClass(desc)
70
68
 
71
69
 
72
- def wrap_plexus_message(header: PlexusMessageHeaderProto, payload: MessageT) -> bytes:
70
+ def wrap_plexus_message[MessageT: Message](header: PlexusMessageHeaderProto, payload: MessageT) -> bytes:
73
71
  """Wraps a plexus message into a protobuf encoded string"""
74
72
  if header.payload_type != payload.DESCRIPTOR.full_name:
75
73
  raise ValueError(
@@ -83,7 +81,7 @@ def wrap_plexus_message(header: PlexusMessageHeaderProto, payload: MessageT) ->
83
81
  return plexus_message_pb.SerializeToString()
84
82
 
85
83
 
86
- def unwrap_plexus_message(data: bytes) -> tuple[PlexusMessageHeaderProto, MessageT]:
84
+ def unwrap_plexus_message[MessageT: Message](data: bytes) -> tuple[PlexusMessageHeaderProto, MessageT]:
87
85
  """Unwraps a plexus message from a protobuf encoded string"""
88
86
  plexus_message_pb = PlexusMessageProto()
89
87
  plexus_message_pb.ParseFromString(data)
@@ -501,7 +499,7 @@ def make_tailor_plexus_msg():
501
499
  tailor_plexus_msg = make_tailor_plexus_msg()
502
500
 
503
501
 
504
- def tailor_plexus_msg_2(message: MessageT):
502
+ def tailor_plexus_msg_2[MessageT: Message](message: MessageT):
505
503
  qualified_name = "." + message.DESCRIPTOR.full_name
506
504
  _, _, omitted_field_desc_map = plexus_msgs_omitted_fields().get(qualified_name, (None, None, {}))
507
505
  if not omitted_field_desc_map:
@@ -520,11 +518,11 @@ def tailor_plexus_msg_2(message: MessageT):
520
518
  return message
521
519
 
522
520
 
523
- def copy_plexus_message(message: MessageT, *, tailored: bool = False):
521
+ def copy_plexus_message[MessageT: Message](message: MessageT, *, tailored: bool = False):
524
522
  message_copy = copy.deepcopy(message)
525
523
  return tailor_plexus_msg(message_copy) if tailored else message_copy
526
524
 
527
525
 
528
- def copy_plexus_message_2(message: MessageT, *, tailored: bool = False) -> MessageT:
526
+ def copy_plexus_message_2[MessageT: Message](message: MessageT, *, tailored: bool = False) -> MessageT:
529
527
  message_copy = copy.deepcopy(message)
530
528
  return tailor_plexus_msg_2(message_copy) if tailored else message_copy
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexus-msgs-python
3
- Version: 1.0.9
3
+ Version: 1.0.10
4
4
  Summary: Python APIs and utilities for Plexus ProtoBuf messages
5
5
  Classifier: Programming Language :: Python :: 3
6
- Classifier: Programming Language :: Python :: 3.11
7
6
  Classifier: Programming Language :: Python :: 3.12
8
7
  Classifier: Programming Language :: Python :: 3.13
9
- Requires-Python: <3.14,>=3.11
8
+ Classifier: Programming Language :: Python :: 3.14
9
+ Requires-Python: <3.15,>=3.12
10
10
  Requires-Dist: jinja2>=3.0
11
11
  Requires-Dist: protobuf>=5.0
12
12
  Requires-Dist: iker-python-common>=1.0
@@ -13,7 +13,7 @@ plexus/msgs/plexus_common_pb2.py,sha256=c1PD86c12s2PWrBopZdhYOHA7kjrUcTOARTMap6Y
13
13
  plexus/msgs/plexus_common_pb2.pyi,sha256=LTo0mRQSGpzHBrDtCz9JaNHgN2ovmezHlBPSXJNZM8M,7546
14
14
  plexus/msgs/plexus_pb2.py,sha256=V7IiyXRr3V-hx-QXcJHuib9qCCq3Tek24EyawkH4mU8,1967
15
15
  plexus/msgs/plexus_pb2.pyi,sha256=xjEufjB6d1xzxkh8BTQXS7zrI047bwdVqqq_jzZMaU0,1098
16
- plexus/msgs/utils.py,sha256=ZZFuwOIs92TiaeX83nmtjxZZ5lZDCUCvyiPvUfHMInk,20045
16
+ plexus/msgs/utils.py,sha256=xbxC7BylUPHr8tI86ADc3teswE9r0UN0wfRLP5uoRUs,20103
17
17
  plexus/msgs/control/plexus_msgs_control_control_command_pb2.py,sha256=-_osho0zib5RjkT0j7BdKWMI91fhpHo_odXAiZXLeww,2733
18
18
  plexus/msgs/control/plexus_msgs_control_control_command_pb2.pyi,sha256=YkJpNxRQszGzln56Zi0b0IGMMnWJQ6Ce8XH-Yqe_-TA,1993
19
19
  plexus/msgs/control/plexus_msgs_control_dbw_command_pb2.py,sha256=u_qxJX3-TDETn5WjBOBC6zofIxcpGfNJm6LGjoAuuro,2861
@@ -38,8 +38,8 @@ plexus/msgs/testing/plexus_msgs_testing_dummy_pb2.py,sha256=x121-jzpntmeaBcHT_p_
38
38
  plexus/msgs/testing/plexus_msgs_testing_dummy_pb2.pyi,sha256=1k8ygoalUTdRVaazdUB6NvQFrqR94n8FCUHhLsL47Mk,23796
39
39
  plexus/msgs/vehicle/plexus_msgs_vehicle_can_messages_pb2.py,sha256=qTRo-uO9pSxOfuVKz8yzfXM5RMSGI5Q7X1d-OO4ezjo,1823
40
40
  plexus/msgs/vehicle/plexus_msgs_vehicle_can_messages_pb2.pyi,sha256=syQUL-FMatbe9l6IGDw4cTJ7H3T_e8NJoZiwqSZzjpY,994
41
- plexus_msgs_python-1.0.9.dist-info/METADATA,sha256=1Jzu54pZsJD7N4tDjEf7jMyVVZb_BKZ8ezxtjtKGhoM,782
42
- plexus_msgs_python-1.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- plexus_msgs_python-1.0.9.dist-info/entry_points.txt,sha256=FHsZqentRWi8W_GpY6vJnSN-9Rmriolti9nkVNnXW_Q,65
44
- plexus_msgs_python-1.0.9.dist-info/top_level.txt,sha256=ug_g7CVwaMQuas5UzAXbHUrQvKGCn8ezc6ZNvvRlJOE,7
45
- plexus_msgs_python-1.0.9.dist-info/RECORD,,
41
+ plexus_msgs_python-1.0.10.dist-info/METADATA,sha256=N-O8c6NjJTY8BtNgRM8UmPOuD3_4qu9zHWfUIyGtweg,783
42
+ plexus_msgs_python-1.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ plexus_msgs_python-1.0.10.dist-info/entry_points.txt,sha256=FHsZqentRWi8W_GpY6vJnSN-9Rmriolti9nkVNnXW_Q,65
44
+ plexus_msgs_python-1.0.10.dist-info/top_level.txt,sha256=ug_g7CVwaMQuas5UzAXbHUrQvKGCn8ezc6ZNvvRlJOE,7
45
+ plexus_msgs_python-1.0.10.dist-info/RECORD,,