stinger-python-utils 0.2.0__tar.gz → 0.4.0__tar.gz

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.
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: stinger-python-utils
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: Common utilities for Stinger Python services.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
7
7
  Requires-Python: >=3.7
8
+ Requires-Dist: py-stinger-conn-iface>=0.1.3
8
9
  Requires-Dist: pydantic>=2.5.3
9
- Requires-Dist: pyqttier>=0.2.0
10
+ Requires-Dist: pyqttier>=0.3.0
10
11
  Description-Content-Type: text/markdown
11
12
 
12
13
  # stinger-python-utils
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "stinger-python-utils"
7
- version = "0.2.0"
7
+ version = "0.4.0"
8
8
  description = "Common utilities for Stinger Python services."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -12,7 +12,8 @@ requires-python = ">=3.7"
12
12
 
13
13
  dependencies = [
14
14
  "pydantic>=2.5.3",
15
- "pyqttier>=0.2.0",
15
+ "pyqttier>=0.3.0",
16
+ "py-stinger-conn-iface>=0.1.3",
16
17
  ]
17
18
 
18
19
  [tool.uv]
@@ -1,4 +1,4 @@
1
- from pyqttier.message import Message
1
+ from pystingerconniface import Message
2
2
  from pydantic import BaseModel
3
3
  from typing import Union, Optional
4
4
  import uuid
@@ -211,7 +211,7 @@ class MessageCreator:
211
211
  cls,
212
212
  topic: str,
213
213
  property_obj: BaseModel,
214
- version: str,
214
+ version: Optional[int],
215
215
  response_topic: str,
216
216
  correlation_id: Union[str, bytes, None] = None,
217
217
  ) -> Message:
@@ -233,13 +233,13 @@ class MessageCreator:
233
233
  topic: str,
234
234
  payload: bytes,
235
235
  content_type: str,
236
- version: str,
236
+ version: Optional[int],
237
237
  response_topic: str,
238
238
  correlation_id: Union[str, bytes, None] = None,
239
239
  ) -> Message:
240
240
  cls._validate_topic(topic)
241
241
  cls._validate_topic(response_topic, "response_topic")
242
- return Message(
242
+ msg = Message(
243
243
  topic=topic,
244
244
  payload=payload,
245
245
  qos=1,
@@ -251,15 +251,17 @@ class MessageCreator:
251
251
  if isinstance(correlation_id, str)
252
252
  else correlation_id
253
253
  ),
254
- user_properties={"PropertyVersion": str(version)},
255
254
  )
255
+ if version is not None:
256
+ msg.user_properties = {"PropertyVersion": str(version)}
257
+ return msg
256
258
 
257
259
  @classmethod
258
260
  def property_response_message(
259
261
  cls,
260
262
  response_topic: str,
261
263
  property_obj: BaseModel,
262
- version: str,
264
+ version: Optional[int],
263
265
  return_code: Union[int, MethodReturnCode],
264
266
  correlation_id: Union[str, bytes, None] = None,
265
267
  debug_info: Optional[str] = None,
@@ -283,7 +285,7 @@ class MessageCreator:
283
285
  response_topic: str,
284
286
  payload: bytes,
285
287
  content_type: str,
286
- version: str,
288
+ version: Optional[int],
287
289
  return_code: Union[int, MethodReturnCode],
288
290
  correlation_id: Union[str, bytes, None] = None,
289
291
  debug_info: Optional[str] = None,
@@ -307,13 +309,13 @@ class MessageCreator:
307
309
  ),
308
310
  user_properties={
309
311
  "ReturnCode": str(rc),
310
- "PropertyVersion": str(version),
311
312
  },
312
313
  )
313
- if (
314
- debug_info is not None and msg_obj.user_properties is not None
315
- ): # user_properties should never be None here, but checking to satisfy type checker
316
- msg_obj.user_properties["DebugInfo"] = debug_info
314
+ if msg_obj.user_properties is not None: # user_properties should never be None here, but checking to satisfy type checker
315
+ if version is not None:
316
+ msg_obj.user_properties["PropertyVersion"] = str(version)
317
+ if debug_info is not None:
318
+ msg_obj.user_properties["DebugInfo"] = debug_info
317
319
  return msg_obj
318
320
 
319
321
  @classmethod
@@ -1,6 +1,6 @@
1
1
  from typing import Optional
2
2
  from enum import IntEnum
3
- from pyqttier.message import Message
3
+ from pystingerconniface import Message
4
4
 
5
5
 
6
6
  class MethodReturnCode(IntEnum):
@@ -865,6 +865,15 @@ wheels = [
865
865
  { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
866
866
  ]
867
867
 
868
+ [[package]]
869
+ name = "py-stinger-conn-iface"
870
+ version = "0.1.3"
871
+ source = { registry = "https://pypi.org/simple" }
872
+ sdist = { url = "https://files.pythonhosted.org/packages/92/26/db82f184c55ad7c8db4b44339c8038e0caff2d611aa4f93256c84bbddb36/py_stinger_conn_iface-0.1.3.tar.gz", hash = "sha256:81a274ef64beac11e3f6512a481aa4fdc4d852da47347c8a55f6fc927888d520", size = 36415, upload-time = "2026-09-18T23:09:24.294Z" }
873
+ wheels = [
874
+ { url = "https://files.pythonhosted.org/packages/e9/33/18e802b27d6154c6fdd6dc0632ec5a27ed1f4f657643972f07cdf7c9ea66/py_stinger_conn_iface-0.1.3-py3-none-any.whl", hash = "sha256:47d0eb708ba69aa75f1af0dd16266cecfcbae118ff0d175e8afbdb142f086152", size = 8444, upload-time = "2026-09-18T23:09:23.394Z" },
875
+ ]
876
+
868
877
  [[package]]
869
878
  name = "pydantic"
870
879
  version = "2.5.3"
@@ -1309,14 +1318,15 @@ wheels = [
1309
1318
 
1310
1319
  [[package]]
1311
1320
  name = "pyqttier"
1312
- version = "0.2.6"
1321
+ version = "0.3.0"
1313
1322
  source = { registry = "https://pypi.org/simple" }
1314
1323
  dependencies = [
1315
1324
  { name = "paho-mqtt" },
1325
+ { name = "py-stinger-conn-iface" },
1316
1326
  ]
1317
- sdist = { url = "https://files.pythonhosted.org/packages/f8/f4/a4eea2ff905c575a7968cf5fa8c4c7eebb10a2a77cc81dc26269dcef3280/pyqttier-0.2.6.tar.gz", hash = "sha256:27f1221403a4dc49582829d95f17801c2d8cacea7c2e05b1b86149e74d02351d", size = 61712, upload-time = "2026-06-01T21:48:20.054Z" }
1327
+ sdist = { url = "https://files.pythonhosted.org/packages/84/cd/7212490a43bec131e565082d9a959956f7625445bdd930ea2005d400964c/pyqttier-0.3.0.tar.gz", hash = "sha256:dcdfe072106ab7deb40706c96a0c57f975ab860735096aad5e4e51afaaee491a", size = 68791, upload-time = "2026-09-18T23:13:57.09Z" }
1318
1328
  wheels = [
1319
- { url = "https://files.pythonhosted.org/packages/3e/c4/fbfb3e163d4d0c53c64ac0e1d77e37a7bbf94d25cf92179d5a1731576192/pyqttier-0.2.6-py3-none-any.whl", hash = "sha256:052202496a3a91f0a2a03282d89b2464a640011ba7c14d97cfce180f88d340e4", size = 11057, upload-time = "2026-06-01T21:48:22.794Z" },
1329
+ { url = "https://files.pythonhosted.org/packages/87/d4/96a30d2172b94affbea218121967ab9b5f35a0fbf29c26377b0a8b2edc2a/pyqttier-0.3.0-py3-none-any.whl", hash = "sha256:f9b09aac0b687d5e7da4ae1fb9955e51249ba8b33ed823f85919eb9138e2abb4", size = 9659, upload-time = "2026-09-18T23:13:55.671Z" },
1320
1330
  ]
1321
1331
 
1322
1332
  [[package]]
@@ -1388,9 +1398,10 @@ wheels = [
1388
1398
 
1389
1399
  [[package]]
1390
1400
  name = "stinger-python-utils"
1391
- version = "0.2.0"
1401
+ version = "0.4.0"
1392
1402
  source = { editable = "." }
1393
1403
  dependencies = [
1404
+ { name = "py-stinger-conn-iface" },
1394
1405
  { name = "pydantic", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.8'" },
1395
1406
  { name = "pydantic", version = "2.10.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.8.*'" },
1396
1407
  { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9'" },
@@ -1412,8 +1423,9 @@ dev = [
1412
1423
 
1413
1424
  [package.metadata]
1414
1425
  requires-dist = [
1426
+ { name = "py-stinger-conn-iface", specifier = ">=0.1.3" },
1415
1427
  { name = "pydantic", specifier = ">=2.5.3" },
1416
- { name = "pyqttier", specifier = ">=0.2.0" },
1428
+ { name = "pyqttier", specifier = ">=0.3.0" },
1417
1429
  ]
1418
1430
 
1419
1431
  [package.metadata.requires-dev]