dex-python-sdk 0.2.3__tar.gz → 0.2.5__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.
Files changed (61) hide show
  1. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/PKG-INFO +1 -1
  2. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/__init__.py +5 -2
  3. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_grpc_errors.py +29 -1
  4. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_worker_dispatcher.py +1 -1
  5. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/step.py +2 -2
  6. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/pyproject.toml +1 -1
  7. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/LEGACY_NOTICES.md +0 -0
  8. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/LICENSE +0 -0
  9. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/README.md +0 -0
  10. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_async_value_hydrator.py +0 -0
  11. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_async_worker_dispatcher.py +0 -0
  12. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_async_worker_service.py +0 -0
  13. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_invocation_context.py +0 -0
  14. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_native.pyi +0 -0
  15. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_utils.py +0 -0
  16. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_value_hydrator.py +0 -0
  17. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_value_mapper.py +0 -0
  18. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/_worker_service.py +0 -0
  19. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/async_client.py +0 -0
  20. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/async_worker.py +0 -0
  21. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/attribute.py +0 -0
  22. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/blob_cache.py +0 -0
  23. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/channel.py +0 -0
  24. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/client.py +0 -0
  25. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/client_options.py +0 -0
  26. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/codec.py +0 -0
  27. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/condition.py +0 -0
  28. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/context.py +0 -0
  29. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/dexpb/__init__.py +0 -0
  30. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/dexpb/dex_pb2.py +0 -0
  31. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/dexpb/dex_pb2.pyi +0 -0
  32. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/dexpb/dex_pb2_grpc.py +0 -0
  33. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/flow.py +0 -0
  34. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/flow_config.py +0 -0
  35. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/flow_info.py +0 -0
  36. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/flow_options.py +0 -0
  37. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/flow_result.py +0 -0
  38. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/py.typed +0 -0
  39. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/runtime_errors.py +0 -0
  40. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/step_execution.py +0 -0
  41. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/stream.py +0 -0
  42. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/subflow.py +0 -0
  43. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/timer.py +0 -0
  44. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/wait.py +0 -0
  45. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/worker.py +0 -0
  46. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/dex/worker_options.py +0 -0
  47. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/Cargo.lock +0 -0
  48. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/Cargo.toml +0 -0
  49. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/Cargo.toml +0 -0
  50. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/LICENSE +0 -0
  51. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/config.rs +0 -0
  52. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/entry.rs +0 -0
  53. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/error.rs +0 -0
  54. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/format.rs +0 -0
  55. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/lib.rs +0 -0
  56. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/policy.rs +0 -0
  57. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/src/store.rs +0 -0
  58. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache/tests/blob_cache_integration.rs +0 -0
  59. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/Cargo.toml +0 -0
  60. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/LICENSE +0 -0
  61. {dex_python_sdk-0.2.3 → dex_python_sdk-0.2.5}/sdk-rust/crates/dex-blob-cache-python/src/lib.rs +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dex-python-sdk
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Requires-Dist: grpcio>=1.83.0
5
5
  Requires-Dist: grpcio-status>=1.83.0
6
6
  Requires-Dist: protobuf>=7.35.1
@@ -8,6 +8,7 @@
8
8
  # Legacy Materials remain under their original licenses.
9
9
  # See LICENSE and LEGACY_NOTICES.md.
10
10
 
11
+ from dex._grpc_errors import RetryAfterError, retry_after
11
12
  from dex.async_client import AsyncClient
12
13
  from dex.async_worker import AsyncWorker
13
14
  from dex.attribute import (
@@ -85,7 +86,7 @@ from dex.step import (
85
86
  force_complete_if_channels_empty,
86
87
  force_fail,
87
88
  go_to,
88
- go_to_multi,
89
+ go_to_many,
89
90
  graceful_complete,
90
91
  )
91
92
  from dex.step_execution import StepExecutionId, TimerId
@@ -140,6 +141,7 @@ __all__ = [
140
141
  "LongPollTimeoutError",
141
142
  "PersistenceSchema",
142
143
  "RPCResult",
144
+ "RetryAfterError",
143
145
  "RpcLockConflictError",
144
146
  "Registry",
145
147
  "TimeTravelOptions",
@@ -181,7 +183,8 @@ __all__ = [
181
183
  "force_fail",
182
184
  "graceful_complete",
183
185
  "go_to",
184
- "go_to_multi",
186
+ "go_to_many",
185
187
  "open_blob_cache",
186
188
  "rpc",
189
+ "retry_after",
187
190
  ]
@@ -37,7 +37,18 @@ _STACK_TRACE_TRUNCATION_MARKER = b"\n... stack trace truncated by Dex Python SDK
37
37
 
38
38
  @dataclass(frozen=True)
39
39
  class RetryAfterError(Exception):
40
- """Requests a delay before the next retry while preserving the current failure."""
40
+ """Requests a delay before Dex retries a failed worker method.
41
+
42
+ Raise an instance with :func:`retry_after` from a Step method when the
43
+ failure is retryable but the next attempt should happen at a known time.
44
+ Dex reports the original cause as the worker failure and uses the requested
45
+ delay instead of the retry policy's calculated interval.
46
+
47
+ Attributes:
48
+ after_seconds (int): Positive delay in seconds before the next retry.
49
+ cause (BaseException): Original failure reported to Dex and re-raised
50
+ as the retry cause.
51
+ """
41
52
 
42
53
  after_seconds: int
43
54
  cause: BaseException
@@ -47,6 +58,23 @@ class RetryAfterError(Exception):
47
58
 
48
59
 
49
60
  def retry_after(after_seconds: int, cause: BaseException) -> RetryAfterError:
61
+ """Creates an error that sets the delay before Dex retries a worker method.
62
+
63
+ Raise the returned error from a Step method after an external dependency
64
+ reports that it is not ready. For example::
65
+
66
+ raise retry_after(5, RuntimeError("service is not ready"))
67
+
68
+ Args:
69
+ after_seconds (int): Positive delay in seconds before the next retry.
70
+ cause (BaseException): Failure that Dex records as the worker error.
71
+
72
+ Returns:
73
+ RetryAfterError: Error to raise from the worker method.
74
+
75
+ Raises:
76
+ ValueError: If **after_seconds** is not positive or **cause** is None.
77
+ """
50
78
  if cause is None:
51
79
  raise ValueError("cause is required")
52
80
  if after_seconds <= 0:
@@ -476,7 +476,7 @@ class WorkerDispatcher:
476
476
  mapped = pb.StepDecision()
477
477
  if decision.kind is DecisionKind.NEXT:
478
478
  if not decision.movements:
479
- raise ValueError("go_to_multi requires a movement")
479
+ raise ValueError("go_to_many requires a movement")
480
480
  mapped.next_steps.extend(self._map_movements(flow, decision.movements))
481
481
  elif decision.kind is DecisionKind.GRACEFUL_COMPLETE:
482
482
  mapped.close_decision.CopyFrom(
@@ -416,10 +416,10 @@ def go_to(step: type[Step[InputT]], input: InputT) -> StepDecision:
416
416
  Returns:
417
417
  A next decision containing one StepMovement.
418
418
  """
419
- return go_to_multi(StepMovement.of(step, input))
419
+ return go_to_many(StepMovement.of(step, input))
420
420
 
421
421
 
422
- def go_to_multi(*movements: StepMovement[Any]) -> StepDecision:
422
+ def go_to_many(*movements: StepMovement[Any]) -> StepDecision:
423
423
  """Create a decision that schedules several next Steps.
424
424
 
425
425
  Args:
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "dex-python-sdk"
3
3
  # Publish uses tag sdk-python/v*; CI stamps this for release builds.
4
- version = "0.2.3"
4
+ version = "0.2.5"
5
5
  description = "Python SDK for the Dex workflow engine"
6
6
  authors = [{name = "Super Durable"}]
7
7
  readme = "README.md"
File without changes
File without changes