hatchet-sdk 1.0.3__py3-none-any.whl → 1.2.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.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (42) hide show
  1. hatchet_sdk/__init__.py +2 -1
  2. hatchet_sdk/client.py +3 -16
  3. hatchet_sdk/clients/admin.py +7 -32
  4. hatchet_sdk/clients/dispatcher/action_listener.py +4 -10
  5. hatchet_sdk/clients/dispatcher/dispatcher.py +35 -8
  6. hatchet_sdk/clients/durable_event_listener.py +11 -12
  7. hatchet_sdk/clients/events.py +11 -15
  8. hatchet_sdk/clients/rest/models/tenant_resource.py +2 -0
  9. hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +1 -5
  10. hatchet_sdk/clients/run_event_listener.py +55 -40
  11. hatchet_sdk/clients/v1/api_client.py +1 -38
  12. hatchet_sdk/clients/workflow_listener.py +9 -10
  13. hatchet_sdk/contracts/dispatcher_pb2.py +46 -46
  14. hatchet_sdk/contracts/dispatcher_pb2.pyi +4 -2
  15. hatchet_sdk/contracts/dispatcher_pb2_grpc.py +1 -1
  16. hatchet_sdk/contracts/events_pb2_grpc.py +1 -1
  17. hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py +1 -1
  18. hatchet_sdk/contracts/v1/workflows_pb2_grpc.py +1 -1
  19. hatchet_sdk/contracts/workflows_pb2_grpc.py +1 -1
  20. hatchet_sdk/features/cron.py +5 -4
  21. hatchet_sdk/features/logs.py +2 -1
  22. hatchet_sdk/features/metrics.py +4 -3
  23. hatchet_sdk/features/rate_limits.py +1 -1
  24. hatchet_sdk/features/runs.py +8 -7
  25. hatchet_sdk/features/scheduled.py +5 -4
  26. hatchet_sdk/features/workers.py +4 -3
  27. hatchet_sdk/features/workflows.py +4 -3
  28. hatchet_sdk/metadata.py +2 -2
  29. hatchet_sdk/runnables/standalone.py +3 -18
  30. hatchet_sdk/runnables/task.py +4 -0
  31. hatchet_sdk/runnables/workflow.py +28 -0
  32. hatchet_sdk/utils/aio.py +43 -0
  33. hatchet_sdk/worker/action_listener_process.py +7 -1
  34. hatchet_sdk/worker/runner/run_loop_manager.py +1 -1
  35. hatchet_sdk/worker/runner/runner.py +21 -5
  36. hatchet_sdk/workflow_run.py +7 -20
  37. hatchet_sdk-1.2.0.dist-info/METADATA +109 -0
  38. {hatchet_sdk-1.0.3.dist-info → hatchet_sdk-1.2.0.dist-info}/RECORD +40 -40
  39. hatchet_sdk/utils/aio_utils.py +0 -18
  40. hatchet_sdk-1.0.3.dist-info/METADATA +0 -42
  41. {hatchet_sdk-1.0.3.dist-info → hatchet_sdk-1.2.0.dist-info}/WHEEL +0 -0
  42. {hatchet_sdk-1.0.3.dist-info → hatchet_sdk-1.2.0.dist-info}/entry_points.txt +0 -0
@@ -272,6 +272,10 @@ class BaseWorkflow(Generic[TWorkflowInput]):
272
272
  def is_durable(self) -> bool:
273
273
  return any(task.is_durable for task in self.tasks)
274
274
 
275
+ @property
276
+ def name(self) -> str:
277
+ return self.config.name
278
+
275
279
  def create_bulk_run_item(
276
280
  self,
277
281
  input: TWorkflowInput | None = None,
@@ -487,6 +491,18 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
487
491
  :param backoff_max_seconds: The maximum number of seconds to allow retries with exponential backoff to continue. Default: `None`
488
492
  :type backoff_max_seconds: int | None
489
493
 
494
+ :param concurrency: A list of concurrency expressions for the task. Defaults to an empty list (no concurrency).
495
+ :type concurrency: list[ConcurrencyExpression]
496
+
497
+ :param wait_for: A list of conditions that must be met before the task can run. Defaults to an empty list (no conditions).
498
+ :type wait_for: list[Condition | OrGroup]
499
+
500
+ :param skip_if: A list of conditions that, if met, will cause the task to be skipped. Defaults to an empty list (no conditions).
501
+ :type skip_if: list[Condition | OrGroup]
502
+
503
+ :param cancel_if: A list of conditions that, if met, will cause the task to be canceled. Defaults to an empty list (no conditions).
504
+ :type cancel_if: list[Condition | OrGroup]
505
+
490
506
  :returns: A decorator which creates a `Task` object.
491
507
  :rtype: Callable[[Callable[[Type[BaseModel], Context], R]], Task[Type[BaseModel], R]]
492
508
  """
@@ -572,6 +588,18 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
572
588
  :param backoff_max_seconds: The maximum number of seconds to allow retries with exponential backoff to continue. Default: `None`
573
589
  :type backoff_max_seconds: int | None
574
590
 
591
+ :param concurrency: A list of concurrency expressions for the task. Defaults to an empty list (no concurrency).
592
+ :type concurrency: list[ConcurrencyExpression]
593
+
594
+ :param wait_for: A list of conditions that must be met before the task can run. Defaults to an empty list (no conditions).
595
+ :type wait_for: list[Condition | OrGroup]
596
+
597
+ :param skip_if: A list of conditions that, if met, will cause the task to be skipped. Defaults to an empty list (no conditions).
598
+ :type skip_if: list[Condition | OrGroup]
599
+
600
+ :param cancel_if: A list of conditions that, if met, will cause the task to be canceled. Defaults to an empty list (no conditions).
601
+ :type cancel_if: list[Condition | OrGroup]
602
+
575
603
  :returns: A decorator which creates a `Task` object.
576
604
  :rtype: Callable[[Callable[[Type[BaseModel], Context], R]], Task[Type[BaseModel], R]]
577
605
  """
@@ -0,0 +1,43 @@
1
+ import asyncio
2
+ from concurrent.futures import ThreadPoolExecutor
3
+ from typing import Callable, Coroutine, ParamSpec, TypeVar
4
+
5
+ P = ParamSpec("P")
6
+ R = TypeVar("R")
7
+ Y = TypeVar("Y")
8
+ S = TypeVar("S")
9
+
10
+
11
+ def _run_async_function_do_not_use_directly(
12
+ async_func: Callable[P, Coroutine[Y, S, R]],
13
+ *args: P.args,
14
+ **kwargs: P.kwargs,
15
+ ) -> R:
16
+ loop = asyncio.new_event_loop()
17
+ asyncio.set_event_loop(loop)
18
+ try:
19
+ return loop.run_until_complete(async_func(*args, **kwargs))
20
+ finally:
21
+ loop.close()
22
+
23
+
24
+ def run_async_from_sync(
25
+ async_func: Callable[P, Coroutine[Y, S, R]],
26
+ *args: P.args,
27
+ **kwargs: P.kwargs,
28
+ ) -> R:
29
+ try:
30
+ loop = asyncio.get_event_loop()
31
+ except RuntimeError:
32
+ loop = None
33
+
34
+ if loop and loop.is_running():
35
+ return loop.run_until_complete(async_func(*args, **kwargs))
36
+ else:
37
+ with ThreadPoolExecutor() as executor:
38
+ future = executor.submit(
39
+ lambda: _run_async_function_do_not_use_directly(
40
+ async_func, *args, **kwargs
41
+ )
42
+ )
43
+ return future.result()
@@ -38,6 +38,7 @@ class ActionEvent:
38
38
  action: Action
39
39
  type: Any # TODO type
40
40
  payload: str
41
+ should_not_retry: bool
41
42
 
42
43
 
43
44
  STOP_LOOP_TYPE = Literal["STOP_LOOP"]
@@ -190,7 +191,10 @@ class WorkerActionListenerProcess:
190
191
 
191
192
  asyncio.create_task(
192
193
  self.dispatcher_client.send_step_action_event(
193
- event.action, event.type, event.payload
194
+ event.action,
195
+ event.type,
196
+ event.payload,
197
+ event.should_not_retry,
194
198
  )
195
199
  )
196
200
  case ActionType.CANCEL_STEP_RUN:
@@ -235,6 +239,7 @@ class WorkerActionListenerProcess:
235
239
  action=action,
236
240
  type=STEP_EVENT_TYPE_STARTED, # TODO ack type
237
241
  payload="",
242
+ should_not_retry=False,
238
243
  )
239
244
  )
240
245
  logger.info(
@@ -255,6 +260,7 @@ class WorkerActionListenerProcess:
255
260
  action=action,
256
261
  type=GROUP_KEY_EVENT_TYPE_STARTED, # TODO ack type
257
262
  payload="",
263
+ should_not_retry=False,
258
264
  )
259
265
  )
260
266
  logger.info(
@@ -60,7 +60,7 @@ class WorkerActionRunLoopManager:
60
60
 
61
61
  async def aio_start(self, retry_count: int = 1) -> None:
62
62
  await capture_logs(
63
- self.client.logInterceptor,
63
+ self.client.log_interceptor,
64
64
  self.client.event,
65
65
  self._async_start,
66
66
  )(retry_count=retry_count)
@@ -38,7 +38,7 @@ from hatchet_sdk.runnables.contextvars import (
38
38
  spawn_index_lock,
39
39
  workflow_spawn_indices,
40
40
  )
41
- from hatchet_sdk.runnables.task import Task
41
+ from hatchet_sdk.runnables.task import NonRetryableException, Task
42
42
  from hatchet_sdk.runnables.types import R, TWorkflowInput
43
43
  from hatchet_sdk.utils.typing import WorkflowValidator
44
44
  from hatchet_sdk.worker.action_listener_process import ActionEvent
@@ -117,7 +117,9 @@ class Runner:
117
117
  log = f"unknown action type: {action.action_type}"
118
118
  logger.error(log)
119
119
 
120
- def step_run_callback(self, action: Action) -> Callable[[asyncio.Task[Any]], None]:
120
+ def step_run_callback(
121
+ self, action: Action, action_task: "Task[TWorkflowInput, R]"
122
+ ) -> Callable[[asyncio.Task[Any]], None]:
121
123
  def inner_callback(task: asyncio.Task[Any]) -> None:
122
124
  self.cleanup_run_id(action.step_run_id)
123
125
 
@@ -132,12 +134,15 @@ class Runner:
132
134
  except Exception as e:
133
135
  errored = True
134
136
 
137
+ should_not_retry = isinstance(e, NonRetryableException)
138
+
135
139
  # This except is coming from the application itself, so we want to send that to the Hatchet instance
136
140
  self.event_queue.put(
137
141
  ActionEvent(
138
142
  action=action,
139
143
  type=STEP_EVENT_TYPE_FAILED,
140
144
  payload=str(pretty_format_exception(f"{e}", e)),
145
+ should_not_retry=should_not_retry,
141
146
  )
142
147
  )
143
148
 
@@ -151,6 +156,7 @@ class Runner:
151
156
  action=action,
152
157
  type=STEP_EVENT_TYPE_COMPLETED,
153
158
  payload=self.serialize_output(output),
159
+ should_not_retry=False,
154
160
  )
155
161
  )
156
162
 
@@ -181,6 +187,7 @@ class Runner:
181
187
  action=action,
182
188
  type=GROUP_KEY_EVENT_TYPE_FAILED,
183
189
  payload=str(pretty_format_exception(f"{e}", e)),
190
+ should_not_retry=False,
184
191
  )
185
192
  )
186
193
 
@@ -194,6 +201,7 @@ class Runner:
194
201
  action=action,
195
202
  type=GROUP_KEY_EVENT_TYPE_COMPLETED,
196
203
  payload=self.serialize_output(output),
204
+ should_not_retry=False,
197
205
  )
198
206
  )
199
207
 
@@ -302,7 +310,12 @@ class Runner:
302
310
 
303
311
  self.contexts[action.step_run_id] = context
304
312
  self.event_queue.put(
305
- ActionEvent(action=action, type=STEP_EVENT_TYPE_STARTED, payload="")
313
+ ActionEvent(
314
+ action=action,
315
+ type=STEP_EVENT_TYPE_STARTED,
316
+ payload="",
317
+ should_not_retry=False,
318
+ )
306
319
  )
307
320
 
308
321
  loop = asyncio.get_event_loop()
@@ -312,7 +325,7 @@ class Runner:
312
325
  )
313
326
  )
314
327
 
315
- task.add_done_callback(self.step_run_callback(action))
328
+ task.add_done_callback(self.step_run_callback(action, action_func))
316
329
  self.tasks[action.step_run_id] = task
317
330
 
318
331
  try:
@@ -341,7 +354,10 @@ class Runner:
341
354
  # send an event that the group key run has started
342
355
  self.event_queue.put(
343
356
  ActionEvent(
344
- action=action, type=GROUP_KEY_EVENT_TYPE_STARTED, payload=""
357
+ action=action,
358
+ type=GROUP_KEY_EVENT_TYPE_STARTED,
359
+ payload="",
360
+ should_not_retry=False,
345
361
  )
346
362
  )
347
363
 
@@ -1,4 +1,3 @@
1
- import asyncio
2
1
  from typing import Any
3
2
 
4
3
  from hatchet_sdk.clients.run_event_listener import (
@@ -6,19 +5,19 @@ from hatchet_sdk.clients.run_event_listener import (
6
5
  RunEventListenerClient,
7
6
  )
8
7
  from hatchet_sdk.clients.workflow_listener import PooledWorkflowRunListener
9
- from hatchet_sdk.utils.aio_utils import get_active_event_loop
8
+ from hatchet_sdk.config import ClientConfig
9
+ from hatchet_sdk.utils.aio import run_async_from_sync
10
10
 
11
11
 
12
12
  class WorkflowRunRef:
13
13
  def __init__(
14
14
  self,
15
15
  workflow_run_id: str,
16
- workflow_listener: PooledWorkflowRunListener,
17
- workflow_run_event_listener: RunEventListenerClient,
16
+ config: ClientConfig,
18
17
  ):
19
18
  self.workflow_run_id = workflow_run_id
20
- self.workflow_listener = workflow_listener
21
- self.workflow_run_event_listener = workflow_run_event_listener
19
+ self.workflow_listener = PooledWorkflowRunListener(config)
20
+ self.workflow_run_event_listener = RunEventListenerClient(config=config)
22
21
 
23
22
  def __str__(self) -> str:
24
23
  return self.workflow_run_id
@@ -27,19 +26,7 @@ class WorkflowRunRef:
27
26
  return self.workflow_run_event_listener.stream(self.workflow_run_id)
28
27
 
29
28
  async def aio_result(self) -> dict[str, Any]:
30
- return await self.workflow_listener.result(self.workflow_run_id)
29
+ return await self.workflow_listener.aio_result(self.workflow_run_id)
31
30
 
32
31
  def result(self) -> dict[str, Any]:
33
- coro = self.workflow_listener.result(self.workflow_run_id)
34
-
35
- loop = get_active_event_loop()
36
-
37
- if loop is None:
38
- loop = asyncio.new_event_loop()
39
- asyncio.set_event_loop(loop)
40
- try:
41
- return loop.run_until_complete(coro)
42
- finally:
43
- asyncio.set_event_loop(None)
44
- else:
45
- return loop.run_until_complete(coro)
32
+ return run_async_from_sync(self.aio_result)
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.1
2
+ Name: hatchet-sdk
3
+ Version: 1.2.0
4
+ Summary:
5
+ Author: Alexander Belanger
6
+ Author-email: alexander@hatchet.run
7
+ Requires-Python: >=3.10,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Provides-Extra: otel
13
+ Requires-Dist: aiohttp (>=3.10.5,<4.0.0)
14
+ Requires-Dist: aiohttp-retry (>=2.8.3,<3.0.0)
15
+ Requires-Dist: aiostream (>=0.5.2,<0.6.0)
16
+ Requires-Dist: cel-python (>=0.2.0,<0.3.0)
17
+ Requires-Dist: grpcio (>=1.64.1,!=1.68.*) ; python_version < "3.13"
18
+ Requires-Dist: grpcio (>=1.69.0) ; python_version >= "3.13"
19
+ Requires-Dist: grpcio-tools (>=1.64.1,!=1.68.*) ; python_version < "3.13"
20
+ Requires-Dist: grpcio-tools (>=1.69.0) ; python_version >= "3.13"
21
+ Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
22
+ Requires-Dist: opentelemetry-api (>=1.28.0,<2.0.0) ; extra == "otel"
23
+ Requires-Dist: opentelemetry-distro (>=0.49b0) ; extra == "otel"
24
+ Requires-Dist: opentelemetry-exporter-otlp (>=1.28.0,<2.0.0) ; extra == "otel"
25
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.28.0,<2.0.0) ; extra == "otel"
26
+ Requires-Dist: opentelemetry-instrumentation (>=0.49b0) ; extra == "otel"
27
+ Requires-Dist: opentelemetry-sdk (>=1.28.0,<2.0.0) ; extra == "otel"
28
+ Requires-Dist: prometheus-client (>=0.21.1,<0.22.0)
29
+ Requires-Dist: protobuf (>=5.29.1,<6.0.0)
30
+ Requires-Dist: pydantic (>=2.6.3,<3.0.0)
31
+ Requires-Dist: pydantic-settings (>=2.7.1,<3.0.0)
32
+ Requires-Dist: pytest-timeout (>=2.3.1,<3.0.0)
33
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
34
+ Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
35
+ Requires-Dist: tenacity (>=8.4.1)
36
+ Requires-Dist: urllib3 (>=1.26.20)
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Hatchet Python SDK
40
+
41
+ <div align="center">
42
+
43
+ [![PyPI version](https://badge.fury.io/py/hatchet-sdk.svg)](https://badge.fury.io/py/hatchet-sdk)
44
+ [![Documentation](https://img.shields.io/badge/docs-hatchet.run-blue)](https://docs.hatchet.run)
45
+ [![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)
46
+
47
+ </div>
48
+
49
+ This is the official Python SDK for [Hatchet](https://hatchet.run), a distributed, fault-tolerant task queue. The SDK allows you to easily integrate Hatchet's task scheduling and workflow orchestration capabilities into your Python applications.
50
+
51
+ ## Installation
52
+
53
+ Install the SDK using pip:
54
+
55
+ ```bash
56
+ pip install hatchet-sdk
57
+ ```
58
+
59
+ Or using poetry:
60
+
61
+ ```bash
62
+ poetry add hatchet-sdk
63
+ ```
64
+
65
+ ## Quick Start
66
+
67
+ Here's a simple example of how to use the Hatchet Python SDK:
68
+
69
+ ```python
70
+ from hatchet_sdk import Context, EmptyModel, Hatchet
71
+
72
+ hatchet = Hatchet(debug=True)
73
+
74
+
75
+ @hatchet.task(name="SimpleWorkflow")
76
+ def step1(input: EmptyModel, ctx: Context) -> None:
77
+ print("executed step1")
78
+
79
+
80
+ def main() -> None:
81
+ worker = hatchet.worker("test-worker", slots=1, workflows=[step1])
82
+ worker.start()
83
+
84
+ if __name__ == "__main__":
85
+ main()
86
+ ```
87
+
88
+ ## Features
89
+
90
+ - 🔄 **Workflow Orchestration**: Define complex workflows with dependencies and parallel execution
91
+ - 🔁 **Automatic Retries**: Configure retry policies for handling transient failures
92
+ - 📊 **Observability**: Track workflow progress and monitor execution metrics
93
+ - ⏰ **Scheduling**: Schedule workflows to run at specific times or on a recurring basis
94
+ - 🔄 **Event-Driven**: Trigger workflows based on events in your system
95
+
96
+ ## Documentation
97
+
98
+ For detailed documentation, examples, and best practices, visit:
99
+ - [Hatchet Documentation](https://docs.hatchet.run)
100
+ - [Examples](https://github.com/hatchet-dev/hatchet/tree/main/sdks/python/examples)
101
+
102
+ ## Contributing
103
+
104
+ We welcome contributions! Please check out our [contributing guidelines](https://docs.hatchet.run/contributing) and join our [Discord community](https://discord.gg/ZMeUafwH89) for discussions and support.
105
+
106
+ ## License
107
+
108
+ This SDK is released under the MIT License. See [LICENSE](https://github.com/hatchet-dev/hatchet/blob/main/LICENSE) for details.
109
+
@@ -1,11 +1,11 @@
1
- hatchet_sdk/__init__.py,sha256=o_06wLLKCKRq4uQuCF62yDRb8hTQYYcqPC3FIDNHxuQ,10002
2
- hatchet_sdk/client.py,sha256=nfLv2jzv7XlL9VzQSnfyCdtK4ew0zanUgsoXC0KEtY0,2255
3
- hatchet_sdk/clients/admin.py,sha256=C-a1kkF2OCR4LOj489uIg_vHAEPiiG3LjyKxU7Y085w,16638
4
- hatchet_sdk/clients/dispatcher/action_listener.py,sha256=8enip982Fkb_8blco1ixahmuaKwxsahx06wDWte_4MU,16595
5
- hatchet_sdk/clients/dispatcher/dispatcher.py,sha256=GMb4ljE-gSTf5RkpmRboPXCMncJKAJ6KKERGcf1nz48,6993
6
- hatchet_sdk/clients/durable_event_listener.py,sha256=XzXECjulUWSsu6wiWYKogqKPGa1gwcrKFtr2SJ4xSok,11850
1
+ hatchet_sdk/__init__.py,sha256=xpvq4zASQag5sYGlkaU8cg9wmACaAaeXXCdTtU17-UM,10054
2
+ hatchet_sdk/client.py,sha256=lApcV1-qlvIdiHyGrQJAIlT9qzP96I0mQ2STZ1ZV_2g,1940
3
+ hatchet_sdk/clients/admin.py,sha256=cc-TyZL6uLz3MGpdVKYziiZlmi29twP8MUJ66CboLtU,15160
4
+ hatchet_sdk/clients/dispatcher/action_listener.py,sha256=FogjHd6vhj4HeQs--Z-99kPwCfaETo1-EcotjdIkrig,16266
5
+ hatchet_sdk/clients/dispatcher/dispatcher.py,sha256=7tHEoCvL2MKklxbT43oRsQdx9JuLIVCJvFuIUqTHjis,7794
6
+ hatchet_sdk/clients/durable_event_listener.py,sha256=J5Tg8niikms-tEfB8wps_wgsPF7Fx-pYhYExd0lJo7Y,11791
7
7
  hatchet_sdk/clients/event_ts.py,sha256=tbWLz3NXrwMyIoEm0Q2TfitF5cNEpo3k42jWKciOK8A,1082
8
- hatchet_sdk/clients/events.py,sha256=yw8Goyh0KUk9bSSfTXjaGhF4gtxOG1T0wZOmYBbqPpI,5565
8
+ hatchet_sdk/clients/events.py,sha256=sKqzGwkrW_AKWW0Q_rxfwo9jXV5EUpLx7fTQvCNHaVo,5443
9
9
  hatchet_sdk/clients/rest/__init__.py,sha256=Bee4HPFiMGDHx5xbHkxxVbLBz_mDgSZUqh-nIhvsD1k,16511
10
10
  hatchet_sdk/clients/rest/api/__init__.py,sha256=XWlkH9iwpQvJHDqKe7kWl3MUzcTOaH-JiFZbki_fg_U,1200
11
11
  hatchet_sdk/clients/rest/api/api_token_api.py,sha256=C10FEIHHGBpwq-bIKkrBhvPlg6az4aHlREWEUlJHWl0,33577
@@ -130,7 +130,7 @@ hatchet_sdk/clients/rest/models/tenant_member.py,sha256=DL5J-osK7A6K7DNQXIg3F4s-
130
130
  hatchet_sdk/clients/rest/models/tenant_member_list.py,sha256=b-8pU27TUqkcEHHrRygQ-fLXaHzR5HGRsh_CQVt2N4g,3487
131
131
  hatchet_sdk/clients/rest/models/tenant_member_role.py,sha256=NGzfU-h6TBOgCh9gRpFBONJ3C9Dovxj_8ozYM3QnCVM,692
132
132
  hatchet_sdk/clients/rest/models/tenant_queue_metrics.py,sha256=cTZ_ccGXM9XDwksD-RSJt5Ia5h9z1F0A-GqxYjCc2eA,3738
133
- hatchet_sdk/clients/rest/models/tenant_resource.py,sha256=s6xOzDdWSbXGemKvpx1h6njOZ4DPwWjA2BaliIxH5NI,744
133
+ hatchet_sdk/clients/rest/models/tenant_resource.py,sha256=oQX7-Ekg_NAOHWgs59kmxfD8kIzTk5v7-jYtSquEnPg,802
134
134
  hatchet_sdk/clients/rest/models/tenant_resource_limit.py,sha256=iVkEliSDbLcdi1EYdh9jfA66Ft1bhCcrIQ2ZC9JgGe8,4236
135
135
  hatchet_sdk/clients/rest/models/tenant_resource_policy.py,sha256=laL2UxMLkn3CPULnK3og2tLxoLaCvdcqDYi4er9cAQo,3092
136
136
  hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py,sha256=Qtn8XWyOQCR8ZwBuaZp7LXg8D_RLxxZ6ZFyjnFtai5g,2417
@@ -200,7 +200,7 @@ hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details
200
200
  hatchet_sdk/clients/rest/models/workflow_run_status.py,sha256=X_jDDvq3GhjTNvdGy_NXUVNlUiIFrwbsQTw9kG_7YPs,805
201
201
  hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py,sha256=j6Ob3ICDL2wqZuFE2Bu1wuusH75HPwH0S53xpjQaRHY,3545
202
202
  hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py,sha256=57o2jz6LN3PB2gi2SH_PBmyyhg5_94uNx2Shv_EpiSE,2537
203
- hatchet_sdk/clients/rest/models/workflow_runs_metrics.py,sha256=7CfcXlvHNny8Q496CR6iW_DBjyefgN4NZ3QhH8IhX3k,2865
203
+ hatchet_sdk/clients/rest/models/workflow_runs_metrics.py,sha256=VokrmzO64TRSpPhLDIbsoBRfX9c7-9tKWvzY0wO7p-4,2745
204
204
  hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py,sha256=8pe_pI8UXe0YeMaOTRwrog3_Gq1z0LR2kLtq9hwS28g,3217
205
205
  hatchet_sdk/clients/rest/models/workflow_tag.py,sha256=9aPXHeUYW6FV-6dB-I5Ex0P5g82YNePEuy8-VG5Ecrs,2494
206
206
  hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py,sha256=_6r0laWazB6r_eC1Sc7RZOYACWzhnItasKkMtkqu4Eg,2498
@@ -214,54 +214,54 @@ hatchet_sdk/clients/rest/models/workflow_version_meta.py,sha256=TW4R7bAuYAg_LraN
214
214
  hatchet_sdk/clients/rest/models/workflow_workers_count.py,sha256=qhzqfvjjIDyARkiiLGluMIqEmqO-diHTsjlu0Doi0yg,2875
215
215
  hatchet_sdk/clients/rest/rest.py,sha256=NbmK_NvoL3-g6Oul6dsZgJO3XvCWtw2V0qAbr8pGfQE,6967
216
216
  hatchet_sdk/clients/rest/tenacity_utils.py,sha256=n6QvwuGwinLQpiWNU5GxrDNhFBE8_wZdg3WNur21rJ0,1055
217
- hatchet_sdk/clients/run_event_listener.py,sha256=12o2P8bi3NUGhzPi7UM9d9D-FX94cr5qyNIEWIweFD0,9960
218
- hatchet_sdk/clients/v1/api_client.py,sha256=0FmhJIjN5Y4CWEsIWt0XzoOmIFUjPwFOAG0TI-fVqHI,2412
219
- hatchet_sdk/clients/workflow_listener.py,sha256=sdeCN3z1kMurG_5rLoT3-rVUJKrd3XJerVPnMfR6U4U,10470
217
+ hatchet_sdk/clients/run_event_listener.py,sha256=rIjBLRF7d7FBoEq7RKbmbOA84lX_hHSU26trwnthqV8,10230
218
+ hatchet_sdk/clients/v1/api_client.py,sha256=L5dbAvIJMnoe9oiUuwLJx8Atn_NTpCctGJ_cXxE-KFs,1247
219
+ hatchet_sdk/clients/workflow_listener.py,sha256=x6FQ8d786MiubARPG0B92L3Jbs4Ve0CQJFx_udJIB3s,10522
220
220
  hatchet_sdk/config.py,sha256=piNrTA4EuYNNl0FpsFWceOuIOps-6R95PWZomQWOMBA,3426
221
221
  hatchet_sdk/connection.py,sha256=B5gT5NL9BBB5-l9U_cN6pMlraQk880rEYMnqaK_dgL0,2590
222
222
  hatchet_sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  hatchet_sdk/context/context.py,sha256=ViVd-aiKy-dIcCmjVegNFb_vEJhqQ-Q3Zh9llU7nlXY,9002
224
224
  hatchet_sdk/context/worker_context.py,sha256=OVcEWvdT_Kpd0nlg61VAPUgIPSFzSLs0aSrXWj-1GX4,974
225
- hatchet_sdk/contracts/dispatcher_pb2.py,sha256=B35F3XQQkk05UA84nuZOIFtiydgPbB8gA5FhvNvSqb0,14414
226
- hatchet_sdk/contracts/dispatcher_pb2.pyi,sha256=JLtc615N9vNDRtQoUVynclPBbgIsRhbikcrT8b7Z-TM,18336
227
- hatchet_sdk/contracts/dispatcher_pb2_grpc.py,sha256=nO6Vvy-WVcF5TCYzi936Yl9tE06UtbSc1c8rgDv2-mM,24715
225
+ hatchet_sdk/contracts/dispatcher_pb2.py,sha256=SN4CIKeQwYkrbfRGhdhZo2uBn4nGzjUWIC1vvXdDeOQ,14503
226
+ hatchet_sdk/contracts/dispatcher_pb2.pyi,sha256=ZSGio5eYxkw-QuQx2C5ASTNcKzeMQn5JTnWaRiThafM,18455
227
+ hatchet_sdk/contracts/dispatcher_pb2_grpc.py,sha256=zJ4c0Z0-iJngrVEw51vmwQgP1c8aZhAkjcUJUpH6JQ0,24756
228
228
  hatchet_sdk/contracts/events_pb2.py,sha256=sda_dHK2N7g8kmaZSNqfvUSvHaa-ro9IBw0Diu1PCE4,4074
229
229
  hatchet_sdk/contracts/events_pb2.pyi,sha256=eoHvNI5gY98ZfFleiynbtIz3SiW_X49ggMBOlOgAP74,4014
230
- hatchet_sdk/contracts/events_pb2_grpc.py,sha256=2NXI6Ym1S04lls9hlVjpqMP_MUih0sY1WywP10eMXVA,10236
230
+ hatchet_sdk/contracts/events_pb2_grpc.py,sha256=XXEaAwVzGbqqPHIk0E2hTlZXmcGE-E5W3AaYWW8NBHA,10277
231
231
  hatchet_sdk/contracts/v1/dispatcher_pb2.py,sha256=PpMvh5ilrgNIR6DQSC-LS17xuXMknbT5Va2G7beqEfk,2546
232
232
  hatchet_sdk/contracts/v1/dispatcher_pb2.pyi,sha256=hjfQWs1jxBdF04IpJzS8sGpyuLbOjAims_PP_3sFVjk,1679
233
- hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py,sha256=AkGO18Wma0eEDEJSAh32DOBi8fXF5TK5KJA79Twv4QA,5758
233
+ hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py,sha256=alnJTOJmf9AWr5qvqX0ivqEm1IlFfEKxJJqzPQmxd3A,5799
234
234
  hatchet_sdk/contracts/v1/shared/condition_pb2.py,sha256=dLBp9p48xEgDIOUU3lWn9wb5HWlQShaMp-1-_OAbKZY,3194
235
235
  hatchet_sdk/contracts/v1/shared/condition_pb2.pyi,sha256=OZrUydy3wmHIoZjUQ5wrVTEaayTQlIZhfwJ8KyS26t8,3873
236
236
  hatchet_sdk/contracts/v1/shared/condition_pb2_grpc.py,sha256=-LQAfCTGRcj81g8ij2CUeuBDNKHTO3JojkByh3ay0QY,1136
237
237
  hatchet_sdk/contracts/v1/workflows_pb2.py,sha256=auxcW4LHwdMYvCDb6mknJ5P9TcXTsNznO2aIney3u7M,8905
238
238
  hatchet_sdk/contracts/v1/workflows_pb2.pyi,sha256=2widA1ESas3uIFsvQgQYVCdqO_rwpbtH7gxcCQTNgfo,11581
239
- hatchet_sdk/contracts/v1/workflows_pb2_grpc.py,sha256=KaRIG3-jC4DCaBLXbsoiF3zq4Y6Cb2VSpYO_BH98qpc,9258
239
+ hatchet_sdk/contracts/v1/workflows_pb2_grpc.py,sha256=XytYpV2kJQZT8iAs14z4SWsv-90ApfoFUEc8bRb5WHk,9299
240
240
  hatchet_sdk/contracts/workflows_pb2.py,sha256=9j6-YMrtgp2yxX-BePwyaqxuFhrI6OftoZSR53JPDWw,11739
241
241
  hatchet_sdk/contracts/workflows_pb2.pyi,sha256=2r5d4DWaR0kwY8jKSzcffTAMMlWrusRXCziE_03SFYc,15434
242
- hatchet_sdk/contracts/workflows_pb2_grpc.py,sha256=ekBhwoDD6Hrad58WUGCUeNES41qxOobBR4rDI_M7ET8,10778
243
- hatchet_sdk/features/cron.py,sha256=DsgRXgjM3p0CgeZiaVvVXIJpIVEabKm_QbC-a43ADHE,9188
244
- hatchet_sdk/features/logs.py,sha256=JzVohdtzZC7P5DHsK90XVQwnrrwfyIYB9IdDRw1JgEE,676
245
- hatchet_sdk/features/metrics.py,sha256=phAhQSRqqaoPusbX5Odg13bFNQbnJIZeU9nHtJCql68,2861
246
- hatchet_sdk/features/rate_limits.py,sha256=4VqbPzLY5pZMrZBPH4n2-mNbHxJMPbhn0rODsGwnuhA,1554
247
- hatchet_sdk/features/runs.py,sha256=YunX58qF_buZXC9iYki289hrqnilD2QV9PYiKDlKl4k,8133
248
- hatchet_sdk/features/scheduled.py,sha256=0Qoa9SikuJviMTtw86m6iGHa55eSqtD6OihOEntRmG0,8870
249
- hatchet_sdk/features/workers.py,sha256=-o5f8k_AqHPtDbJN47KPYc_XVQI672ZnNGEPVIfEv7o,1553
250
- hatchet_sdk/features/workflows.py,sha256=MoC5rL3sbuYgBDri2XigaeIUOGoN0frNVcL6O7243Kg,2107
242
+ hatchet_sdk/contracts/workflows_pb2_grpc.py,sha256=2V8E72DlJx5qlH2yiQpVCu5cQbKUba5X7T1yNrQDF_s,10819
243
+ hatchet_sdk/features/cron.py,sha256=VRq5w15QpVYMkvkyIUgBO77IQpASbTxyplbgGukdmE8,9218
244
+ hatchet_sdk/features/logs.py,sha256=Fm3l0f2VUlQ_YqYrKqHYviK5g_j9_wUEW6J_Ax9cYzc,724
245
+ hatchet_sdk/features/metrics.py,sha256=Lmmu-3TITHyGGx5moA_emuzy-ZrbJhXLBDzR7Fm73pk,2897
246
+ hatchet_sdk/features/rate_limits.py,sha256=Df-DBFRpT1MHRf7qcvD4YJseNuFJUp5X9aO72yLkW6Q,1521
247
+ hatchet_sdk/features/runs.py,sha256=th2czurM9uawOlcm48MBalvQTqSmfVhOMcAbHjPH_hk,8145
248
+ hatchet_sdk/features/scheduled.py,sha256=MfUrUOYNWewoX6GJ4YV2UWmKrxVJrgj4fX8wCxkkgv0,8900
249
+ hatchet_sdk/features/workers.py,sha256=HpUX8LyvFfseNn677tTvQukNqyD90-uWPhdf10znUkA,1589
250
+ hatchet_sdk/features/workflows.py,sha256=4hZgk7vhRhMK8wb2K3b9617TolnxRkeYL35aeLWHY2c,2143
251
251
  hatchet_sdk/hatchet.py,sha256=tmTGNRKcpLZlVquqMPmvS14OCgcMsYEsGTeFpKay5NE,22933
252
252
  hatchet_sdk/labels.py,sha256=nATgxWE3lFxRTnfISEpoIRLGbMfAZsHF4lZTuG4Mfic,182
253
253
  hatchet_sdk/logger.py,sha256=5uOr52T4mImSQm1QvWT8HvZFK5WfPNh3Y1cBQZRFgUQ,333
254
- hatchet_sdk/metadata.py,sha256=QzIcTlOGhFd-O3BF2f8sPYESPFFN9387Zi8-OdKDntA,105
254
+ hatchet_sdk/metadata.py,sha256=XkRbhnghJJGCdVvF-uzyGBcNaTqpeQ3uiQvNNP1wyBc,107
255
255
  hatchet_sdk/opentelemetry/instrumentor.py,sha256=KYZG1koVv4704kgr7YJ-M3QqRcTrZI2T1fHh0NCygoo,14038
256
256
  hatchet_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
257
257
  hatchet_sdk/rate_limit.py,sha256=TwbCuggiZaWpYuo4mjVLlE-z1OfQ2mRBiVvCSaG3lv4,3919
258
258
  hatchet_sdk/runnables/contextvars.py,sha256=6MDocAMmlyiRW37oQ1jyx10tAlJs-xgDjR3xPoPz05g,426
259
- hatchet_sdk/runnables/standalone.py,sha256=DIj-E7RlZmVcUIAyd7ck9YcOt5MgladWWelKatLbpM4,6442
260
- hatchet_sdk/runnables/task.py,sha256=jQiRPeE9EbIzNOxv6hkmJ8RqyVR7hMLXX4cnGRl_GF8,4832
259
+ hatchet_sdk/runnables/standalone.py,sha256=2jgUgILYIyHSYy3S6M6n2QAQ7UyvxfSQk0DDRar5RpI,5996
260
+ hatchet_sdk/runnables/task.py,sha256=O0DEDvYZT6gC5eNF6ObsE2MhCBUNKWkr2JXPZx2aUZM,4883
261
261
  hatchet_sdk/runnables/types.py,sha256=JWo4hkYb2XYoktIFVvnqud6Ywmo7AHMK_upYpdNmij0,4235
262
- hatchet_sdk/runnables/workflow.py,sha256=lRkzDTYIsQl_3RPpWGKFKzsanEtUr6DYCfXp3hTwExA,29133
262
+ hatchet_sdk/runnables/workflow.py,sha256=eYIbpAAwlArhEZrd3NHDT4Yy8_GejgCzRG6TZomPugI,30681
263
263
  hatchet_sdk/token.py,sha256=KjIiInwG5Kqd_FO4BSW1x_5Uc7PFbnzIVJqr50-ZldE,779
264
- hatchet_sdk/utils/aio_utils.py,sha256=PSspZGyUKJsdluB_a8jjfmAVXCmPJYlSQ4mUMa21PTk,484
264
+ hatchet_sdk/utils/aio.py,sha256=A9pKNn8eAKUeinY2uBkJn4jdrYI5vAw_A-gzz04xdvQ,1122
265
265
  hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
266
266
  hatchet_sdk/utils/proto_enums.py,sha256=0UybwE3s7TcqmzoQSO8YnhgAKOS8WZXsyPchB8-eksw,1247
267
267
  hatchet_sdk/utils/timedelta_to_expression.py,sha256=n5jIxlcswN9GwFPjktuMceedekzWWT6X7U6gbsZciIQ,455
@@ -499,13 +499,13 @@ hatchet_sdk/v0/workflow.py,sha256=d4o425efk7J3JgLIge34MW_A3pzwnwSRtwEOgIqM2pc,93
499
499
  hatchet_sdk/v0/workflow_run.py,sha256=jsEZprXshrSV7i_TtL5uoCL03D18zQ3NeJCq7mp97Dg,1752
500
500
  hatchet_sdk/waits.py,sha256=mBJVOjvTJfhXCngyIfNccYFtg7eiFM2B2n7lcg90S3A,3327
501
501
  hatchet_sdk/worker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
502
- hatchet_sdk/worker/action_listener_process.py,sha256=OslEFdj0VZvC65yPB8vNqrLQXQYeRxrfjz7XPzZ8AcA,11455
503
- hatchet_sdk/worker/runner/run_loop_manager.py,sha256=uLzNCKy0yHEX8IosDCQvA8TqkIOd14BaAFFArOaPxzA,3970
504
- hatchet_sdk/worker/runner/runner.py,sha256=IIvjrE1sJlF1oEdMTk7s15-CjTyCu8om6yEFia2XcdE,16434
502
+ hatchet_sdk/worker/action_listener_process.py,sha256=KxS7-wBpfKnsq0LNSvk-MG442Lh60iQMy3VpD1FW3mU,11703
503
+ hatchet_sdk/worker/runner/run_loop_manager.py,sha256=GKIH2ncGdM7nwtPn--8f6dAxQqBQv6O82mZYCEM5qnk,3971
504
+ hatchet_sdk/worker/runner/runner.py,sha256=ruDVu1NouU52xqe3Fgw9vZrvX7ljm-LDZWq-RstZhWI,17008
505
505
  hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=nHRPSiDBqzhObM7i2X7t03OupVFnE7kQBdR2Ckgg-2w,2709
506
506
  hatchet_sdk/worker/worker.py,sha256=qyHs64H-grF9HR1CgH7MlnoDmTQ8mm4d8basx-ZDyWc,14490
507
- hatchet_sdk/workflow_run.py,sha256=JTLOuGyEat4OvMM3h55WrX0aFFpqs5YtK7YJxTMC92I,1428
508
- hatchet_sdk-1.0.3.dist-info/METADATA,sha256=Ltt_FG3crdnhRIB2CZLjTSKSpM6ca06QiylFWgBHQfM,1876
509
- hatchet_sdk-1.0.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
510
- hatchet_sdk-1.0.3.dist-info/entry_points.txt,sha256=5mTp_AsCWK5raiVxP_MU9eBCgkRGl4OsN6chpHcvm7o,1235
511
- hatchet_sdk-1.0.3.dist-info/RECORD,,
507
+ hatchet_sdk/workflow_run.py,sha256=Q1nTpnWNsFfjWWpx49xXYUHsVbqTnHL6JWnSKoFM3_I,1029
508
+ hatchet_sdk-1.2.0.dist-info/METADATA,sha256=NeiqHrlBf1Kgy7TjcMrivyFyhySNESFO90HFb9xZ0YI,3963
509
+ hatchet_sdk-1.2.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
510
+ hatchet_sdk-1.2.0.dist-info/entry_points.txt,sha256=5mTp_AsCWK5raiVxP_MU9eBCgkRGl4OsN6chpHcvm7o,1235
511
+ hatchet_sdk-1.2.0.dist-info/RECORD,,
@@ -1,18 +0,0 @@
1
- import asyncio
2
-
3
-
4
- def get_active_event_loop() -> asyncio.AbstractEventLoop | None:
5
- """
6
- Get the active event loop.
7
-
8
- Returns:
9
- asyncio.AbstractEventLoop: The active event loop, or None if there is no active
10
- event loop in the current thread.
11
- """
12
- try:
13
- return asyncio.get_event_loop()
14
- except RuntimeError as e:
15
- if str(e).startswith("There is no current event loop in thread"):
16
- return None
17
- else:
18
- raise e
@@ -1,42 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: hatchet-sdk
3
- Version: 1.0.3
4
- Summary:
5
- Author: Alexander Belanger
6
- Author-email: alexander@hatchet.run
7
- Requires-Python: >=3.10,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.10
10
- Classifier: Programming Language :: Python :: 3.11
11
- Classifier: Programming Language :: Python :: 3.12
12
- Provides-Extra: otel
13
- Requires-Dist: aiohttp (>=3.10.5,<4.0.0)
14
- Requires-Dist: aiohttp-retry (>=2.8.3,<3.0.0)
15
- Requires-Dist: aiostream (>=0.5.2,<0.6.0)
16
- Requires-Dist: cel-python (>=0.2.0,<0.3.0)
17
- Requires-Dist: grpcio (>=1.64.1,!=1.68.*) ; python_version < "3.13"
18
- Requires-Dist: grpcio (>=1.69.0) ; python_version >= "3.13"
19
- Requires-Dist: grpcio-tools (>=1.64.1,!=1.68.*) ; python_version < "3.13"
20
- Requires-Dist: grpcio-tools (>=1.69.0) ; python_version >= "3.13"
21
- Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
22
- Requires-Dist: opentelemetry-api (>=1.28.0,<2.0.0) ; extra == "otel"
23
- Requires-Dist: opentelemetry-distro (>=0.49b0) ; extra == "otel"
24
- Requires-Dist: opentelemetry-exporter-otlp (>=1.28.0,<2.0.0) ; extra == "otel"
25
- Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.28.0,<2.0.0) ; extra == "otel"
26
- Requires-Dist: opentelemetry-instrumentation (>=0.49b0) ; extra == "otel"
27
- Requires-Dist: opentelemetry-sdk (>=1.28.0,<2.0.0) ; extra == "otel"
28
- Requires-Dist: prometheus-client (>=0.21.1,<0.22.0)
29
- Requires-Dist: protobuf (>=5.29.1,<6.0.0)
30
- Requires-Dist: pydantic (>=2.6.3,<3.0.0)
31
- Requires-Dist: pydantic-settings (>=2.7.1,<3.0.0)
32
- Requires-Dist: pytest-timeout (>=2.3.1,<3.0.0)
33
- Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
34
- Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
35
- Requires-Dist: tenacity (>=8.4.1)
36
- Requires-Dist: urllib3 (>=1.26.20)
37
- Description-Content-Type: text/markdown
38
-
39
- # Hatchet Python SDK
40
-
41
- This is the [Hatchet](https://hatchet.run) Python SDK. For usage, see the [docs](https://docs.hatchet.run).
42
-