runtimepy 5.8.4__py3-none-any.whl → 5.9.0__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.
runtimepy/__init__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.1.4
4
- # hash=99838ab674af55409015e5abdd55fc6e
4
+ # hash=809a612b14ec99a3d62dfdd4add8900e
5
5
  # =====================================
6
6
 
7
7
  """
@@ -10,7 +10,7 @@ Useful defaults and other package metadata.
10
10
 
11
11
  DESCRIPTION = "A framework for implementing Python services."
12
12
  PKG_NAME = "runtimepy"
13
- VERSION = "5.8.4"
13
+ VERSION = "5.9.0"
14
14
 
15
15
  # runtimepy-specific content.
16
16
  METRICS_NAME = "metrics"
runtimepy/net/util.py CHANGED
@@ -159,7 +159,7 @@ def hostname(ip_address: str) -> str:
159
159
  def address_str(name: str, fallback_host: str = "localhost", **kwargs) -> str:
160
160
  """Get an IP address string for a given name."""
161
161
 
162
- return _socket.getaddrinfo(
162
+ return _socket.getaddrinfo( # type: ignore
163
163
  name if name else fallback_host, None, **kwargs
164
164
  )[0][4][0]
165
165
 
@@ -40,6 +40,17 @@ class BaseIntPrimitive(PrimitiveIsCloseMixin[int]):
40
40
  self.set_value(new_val, timestamp_ns=timestamp_ns)
41
41
  return new_val
42
42
 
43
+ async def wait_for_increment(
44
+ self, timeout: float, count: int = 1
45
+ ) -> EvalResult:
46
+ """Wait for this primitive to increment by a certain amount."""
47
+
48
+ return await self.wait_for_value(
49
+ self.raw.value + count,
50
+ timeout,
51
+ operation=Operator.LESS_THAN_OR_EQUAL,
52
+ )
53
+
43
54
  async def wait_for_value(
44
55
  self,
45
56
  value: int | float,
@@ -136,6 +136,15 @@ class PeriodicTask(
136
136
  self._enabled.clear()
137
137
  return result
138
138
 
139
+ async def wait_iterations(self, timeout: float, count: int = 1) -> bool:
140
+ """Wait for a task to complete a certain number of iterations."""
141
+
142
+ return bool(
143
+ await self.metrics.dispatches.wait_for_increment(
144
+ timeout, count=count
145
+ )
146
+ )
147
+
139
148
  async def run(
140
149
  self, period_s: float = None, stop_sig: _asyncio.Event = None
141
150
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Libre Embedded
3
+ Copyright (c) 2025 Libre Embedded
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: runtimepy
3
- Version: 5.8.4
3
+ Version: 5.9.0
4
4
  Summary: A framework for implementing Python services.
5
5
  Home-page: https://github.com/vkottler/runtimepy
6
6
  Author: Vaughn Kottler
@@ -17,11 +17,11 @@ Classifier: License :: OSI Approved :: MIT License
17
17
  Requires-Python: >=3.12
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: svgen>=0.7.4
21
- Requires-Dist: vcorelib>=3.4.8
22
20
  Requires-Dist: websockets
21
+ Requires-Dist: svgen>=0.7.4
23
22
  Requires-Dist: psutil
24
23
  Requires-Dist: aiofiles
24
+ Requires-Dist: vcorelib>=3.4.8
25
25
  Provides-Extra: test
26
26
  Requires-Dist: pylint; extra == "test"
27
27
  Requires-Dist: flake8; extra == "test"
@@ -40,16 +40,20 @@ Requires-Dist: types-psutil; extra == "test"
40
40
  Requires-Dist: setuptools-wrapper; extra == "test"
41
41
  Requires-Dist: types-setuptools; extra == "test"
42
42
  Requires-Dist: uvloop; (sys_platform != "win32" and sys_platform != "cygwin") and extra == "test"
43
+ Dynamic: author
44
+ Dynamic: home-page
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
43
47
 
44
48
  <!--
45
49
  =====================================
46
50
  generator=datazen
47
51
  version=3.1.4
48
- hash=f89c565370dd68d4215345aeab6feff4
52
+ hash=3ef34104e5e034e1dbd47bb8020808b6
49
53
  =====================================
50
54
  -->
51
55
 
52
- # runtimepy ([5.8.4](https://pypi.org/project/runtimepy/))
56
+ # runtimepy ([5.9.0](https://pypi.org/project/runtimepy/))
53
57
 
54
58
  [![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
55
59
  ![Build Status](https://github.com/vkottler/runtimepy/workflows/Python%20Package/badge.svg)
@@ -1,4 +1,4 @@
1
- runtimepy/__init__.py,sha256=oMrAywftcbstGYwY0z1DXS3TjHOgKgWR7CH65gdZkbQ,390
1
+ runtimepy/__init__.py,sha256=Hpdu2mXPW86wvJDXbnHtABLikRBQtxf-jEtzqNYLzZQ,390
2
2
  runtimepy/__main__.py,sha256=OPAed6hggoQdw-6QAR62mqLC-rCkdDhOq0wyeS2vDRI,332
3
3
  runtimepy/app.py,sha256=sTvatbsGZ2Hdel36Si_WUbNMtg9CzsJyExr5xjIcxDE,970
4
4
  runtimepy/dev_requirements.txt,sha256=j0dh11ztJAzfaUL0iFheGjaZj9ppDzmTkclTT8YKO8c,230
@@ -144,7 +144,7 @@ runtimepy/net/manager.py,sha256=-M-ZSB9izay6HK1ytTayAYnSHYAz34dcwxaiNhC4lWg,4264
144
144
  runtimepy/net/mixin.py,sha256=5UlFK4lRrJ2O0nEUuScGbkYd4-El-RruFt_UcQR0aic,3039
145
145
  runtimepy/net/mtu.py,sha256=XnLXAFMsDxK1Lj5v_zgWaBrC3lNqf81DkbDc6hpMdmI,3495
146
146
  runtimepy/net/ssl.py,sha256=dj9uECPKDT5k-5vlR5I3Z7Go3WWZhbaJ9nb0rC3kJvg,854
147
- runtimepy/net/util.py,sha256=P6WnH4n8JJkEfKwepk1eP4lGPxWjqcFv0yL3N0mvtrw,5897
147
+ runtimepy/net/util.py,sha256=XTQQ-Ql_ImhVd1_O8nSeDX9MY8xJwRBggvliSLCrsc8,5913
148
148
  runtimepy/net/apps/__init__.py,sha256=vjo7e19QXtJwe6V6B-QGvYiJveYobnYIfpkKZrnS17w,710
149
149
  runtimepy/net/arbiter/__init__.py,sha256=ptKF995rYKvkm4Mya92vA5QEDqcFq5NRD0IYGqZ6_do,740
150
150
  runtimepy/net/arbiter/base.py,sha256=hggbHBWkuJaEkBTenlI2eCtTywhicvUpAIeI-PPYUkY,14958
@@ -235,7 +235,7 @@ runtimepy/primitives/bool.py,sha256=c-IRpVZ84m-pOreCHC382tOW0NFKEwSTiEeXAtlJjvk,
235
235
  runtimepy/primitives/byte_order.py,sha256=80mMk1Sj_l49XvAtvrPmoYFpFYSM1HgYuwR2-P7os3Q,767
236
236
  runtimepy/primitives/evaluation.py,sha256=0N7mT8uoiJaY-coF2PeEXU2WO-FmbyN2Io9_EaghO9Q,4657
237
237
  runtimepy/primitives/float.py,sha256=aeEsj0xRJM57Hcv04OtLfT_sTBocZldbn19HpQq3Hxs,1946
238
- runtimepy/primitives/int.py,sha256=Zch7iIW9xsLmAtmIYWY9lWOJpv6dbZT102J2Yey66gc,3018
238
+ runtimepy/primitives/int.py,sha256=OSJ5_lPrzJfLMDssMQHSbB0PzuqQRvCtJSRen7G9QBc,3352
239
239
  runtimepy/primitives/scaling.py,sha256=Vtxp2CSBahqPp4i2-IS4wjbcC023xwf-dqZMbYWf3V4,1144
240
240
  runtimepy/primitives/string.py,sha256=ic5VKhXCSIwEOUfqIb1VUpZPwjdAcBul-cLLIihVkQI,2532
241
241
  runtimepy/primitives/array/__init__.py,sha256=qPH8SN8vqRZR-J3OZsm-46tKqfnXpGLb1lw9Jni1udI,8362
@@ -272,7 +272,7 @@ runtimepy/task/asynchronous.py,sha256=w4oEUCyj-X-zDVFmlsAtRL1gv66ahQ78QKE0GmLGT1
272
272
  runtimepy/task/sample.py,sha256=_nbLj5Julwa1NJC_-WQsotI0890G-TlOWftVHEKiclY,2735
273
273
  runtimepy/task/basic/__init__.py,sha256=NryfG-JmSyqYh-TNG4NLO6-9RJFVq5vn1Z-oV3qTVvg,243
274
274
  runtimepy/task/basic/manager.py,sha256=2P_swKZlFfPHCmX6sMVGSYePWEZOqXp9B4YPyRYSGCo,1858
275
- runtimepy/task/basic/periodic.py,sha256=_EhX5XfvOJlTr0jUuO6r0mbgF7UE1TT2VVt8jFeWptk,6989
275
+ runtimepy/task/basic/periodic.py,sha256=VevcEzxMsKwqDU18ejOgmbhMYEwjkc-uePSQV7qumCA,7286
276
276
  runtimepy/task/trig/__init__.py,sha256=GuGNb9eLuFEnl3nAI7Mi_eS5mqJ4MOhEy2Wfv48RFic,785
277
277
  runtimepy/telemetry/__init__.py,sha256=G_JLZsp0EZMGaxSQ12fYgbG2kN4QkvVG4lExV_TzEhM,268
278
278
  runtimepy/telemetry/sample.py,sha256=1weoGSH-yGg-fOaLysZAsO3dSTM6yAXX3XdulAiqi3s,3216
@@ -284,9 +284,9 @@ runtimepy/tui/task.py,sha256=nUZo9fuOC-k1Wpqdzkv9v1tQirCI28fZVgcC13Ijvus,1093
284
284
  runtimepy/tui/channels/__init__.py,sha256=evDaiIn-YS9uGhdo8ZGtP9VK1ek6sr_P1nJ9JuSET0o,4536
285
285
  runtimepy/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
286
286
  runtimepy/ui/controls.py,sha256=yvT7h3thbYaitsakcIAJ90EwKzJ4b-jnc6p3UuVf_XE,1241
287
- runtimepy-5.8.4.dist-info/LICENSE,sha256=s2ILEylm2dAJJXL25nM92IWLRKmJW92zQRQe_cfdsHo,1071
288
- runtimepy-5.8.4.dist-info/METADATA,sha256=xOJmQiU6_1njXfp36M4IuEavC0ddklFVwz-kWL7vur4,9288
289
- runtimepy-5.8.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
290
- runtimepy-5.8.4.dist-info/entry_points.txt,sha256=-btVBkYv7ybcopqZ_pRky-bEzu3vhbaG3W3Z7ERBiFE,51
291
- runtimepy-5.8.4.dist-info/top_level.txt,sha256=0jPmh6yqHyyJJDwEID-LpQly-9kQ3WRMjH7Lix8peLg,10
292
- runtimepy-5.8.4.dist-info/RECORD,,
287
+ runtimepy-5.9.0.dist-info/LICENSE,sha256=yKBRwbO-cOPBrlpsZmJkkSa33DfY31aE8t7lZ0DwlUo,1071
288
+ runtimepy-5.9.0.dist-info/METADATA,sha256=d7lEAUBqGKdhpRo6BKLfB06RErKoWPhk8RD-kMoZiKE,9371
289
+ runtimepy-5.9.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
290
+ runtimepy-5.9.0.dist-info/entry_points.txt,sha256=-btVBkYv7ybcopqZ_pRky-bEzu3vhbaG3W3Z7ERBiFE,51
291
+ runtimepy-5.9.0.dist-info/top_level.txt,sha256=0jPmh6yqHyyJJDwEID-LpQly-9kQ3WRMjH7Lix8peLg,10
292
+ runtimepy-5.9.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5