dex-python-sdk 0.0.2__cp311-abi3-win_amd64.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.
Files changed (121) hide show
  1. dex/__init__.py +146 -0
  2. dex/_grpc_errors.py +73 -0
  3. dex/_invocation_context.py +269 -0
  4. dex/_native.pyd +0 -0
  5. dex/_native.pyi +20 -0
  6. dex/_utils.py +18 -0
  7. dex/_value_hydrator.py +223 -0
  8. dex/_value_mapper.py +174 -0
  9. dex/_worker_dispatcher.py +451 -0
  10. dex/_worker_service.py +60 -0
  11. dex/attribute.py +87 -0
  12. dex/blob_cache.py +73 -0
  13. dex/channel.py +165 -0
  14. dex/client.py +715 -0
  15. dex/client_options.py +19 -0
  16. dex/codec.py +286 -0
  17. dex/command_request.py +120 -0
  18. dex/command_results.py +107 -0
  19. dex/communication.py +136 -0
  20. dex/communication_schema.py +54 -0
  21. dex/condition.py +74 -0
  22. dex/context.py +86 -0
  23. dex/data_attributes.py +70 -0
  24. dex/dexpb/__init__.py +1 -0
  25. dex/dexpb/dex_pb2.py +381 -0
  26. dex/dexpb/dex_pb2.pyi +1734 -0
  27. dex/dexpb/dex_pb2_grpc.py +1298 -0
  28. dex/errors.py +109 -0
  29. dex/flow.py +456 -0
  30. dex/flow_config.py +29 -0
  31. dex/flow_info.py +51 -0
  32. dex/flow_options.py +122 -0
  33. dex/object_encoder.py +799 -0
  34. dex/persistence.py +89 -0
  35. dex/persistence_options.py +12 -0
  36. dex/persistence_schema.py +51 -0
  37. dex/py.typed +1 -0
  38. dex/registry.py +204 -0
  39. dex/reset_workflow_type_and_options.py +67 -0
  40. dex/rpc.py +93 -0
  41. dex/runtime_errors.py +81 -0
  42. dex/search_attributes.py +184 -0
  43. dex/state_decision.py +153 -0
  44. dex/state_execution_locals.py +66 -0
  45. dex/state_movement.py +115 -0
  46. dex/state_schema.py +48 -0
  47. dex/step.py +194 -0
  48. dex/step_execution.py +42 -0
  49. dex/stop_workflow_options.py +18 -0
  50. dex/tests/__init__.py +80 -0
  51. dex/tests/dex-service-env/.env +7 -0
  52. dex/tests/dex-service-env/docker-compose-init.sh +44 -0
  53. dex/tests/dex-service-env/docker-compose.yml +97 -0
  54. dex/tests/dex-service-env/dynamicconfig/README.md +39 -0
  55. dex/tests/dex-service-env/dynamicconfig/development-sql.yaml +9 -0
  56. dex/tests/dex-service-env/dynamicconfig/docker.yaml +2 -0
  57. dex/tests/test_abnormal_exit_workflow.py +43 -0
  58. dex/tests/test_basic_workflow.py +70 -0
  59. dex/tests/test_conditional_complete.py +50 -0
  60. dex/tests/test_describe_workflow.py +40 -0
  61. dex/tests/test_empty_data_decodes_properly.py +74 -0
  62. dex/tests/test_internal_channel.py +28 -0
  63. dex/tests/test_internal_channel_with_no_prefix_channel.py +41 -0
  64. dex/tests/test_persistence_data_attributes.py +62 -0
  65. dex/tests/test_persistence_search_attributes.py +127 -0
  66. dex/tests/test_persistence_state_execution_locals.py +38 -0
  67. dex/tests/test_rpc.py +64 -0
  68. dex/tests/test_rpc_with_memo.py +195 -0
  69. dex/tests/test_rpc_with_memo_duplicate_java_tests.py +117 -0
  70. dex/tests/test_signal.py +51 -0
  71. dex/tests/test_skip_wait_until.py +76 -0
  72. dex/tests/test_state_failure_recovery.py +28 -0
  73. dex/tests/test_timer.py +35 -0
  74. dex/tests/test_wait_for_state_execution_completion.py +53 -0
  75. dex/tests/test_workflow_errors.py +87 -0
  76. dex/tests/test_workflow_state_options.py +118 -0
  77. dex/tests/test_workflow_state_options_override.py +44 -0
  78. dex/tests/worker_server.py +64 -0
  79. dex/tests/workflows/abnormal_exit_workflow.py +42 -0
  80. dex/tests/workflows/basic_workflow.py +62 -0
  81. dex/tests/workflows/conditional_complete_workflow.py +95 -0
  82. dex/tests/workflows/describe_workflow.py +46 -0
  83. dex/tests/workflows/empty_data_workflow.py +45 -0
  84. dex/tests/workflows/internal_channel_workflow.py +129 -0
  85. dex/tests/workflows/internal_channel_workflow_with_no_prefix_channel.py +100 -0
  86. dex/tests/workflows/java_duplicate_rpc_memo_workflow.py +276 -0
  87. dex/tests/workflows/persistence_data_attributes_workflow.py +98 -0
  88. dex/tests/workflows/persistence_search_attributes_workflow.py +159 -0
  89. dex/tests/workflows/persistence_state_execution_local_workflow.py +63 -0
  90. dex/tests/workflows/recovery_workflow.py +82 -0
  91. dex/tests/workflows/rpc_memo_workflow.py +231 -0
  92. dex/tests/workflows/rpc_workflow.py +117 -0
  93. dex/tests/workflows/state_options_override_workflow.py +93 -0
  94. dex/tests/workflows/state_options_workflow.py +84 -0
  95. dex/tests/workflows/timer_workflow.py +46 -0
  96. dex/tests/workflows/wait_for_state_with_state_execution_id_workflow.py +70 -0
  97. dex/tests/workflows/wait_for_state_with_wait_for_key_workflow.py +71 -0
  98. dex/tests/workflows/wait_internal_channel_workflow.py +47 -0
  99. dex/tests/workflows/wait_signal_workflow.py +147 -0
  100. dex/timer.py +21 -0
  101. dex/type_store.py +99 -0
  102. dex/unregistered_client.py +585 -0
  103. dex/utils/__init__.py +3 -0
  104. dex/utils/dex_typing.py +25 -0
  105. dex/utils/persistence_utils.py +32 -0
  106. dex/wait.py +49 -0
  107. dex/worker.py +121 -0
  108. dex/worker_options.py +22 -0
  109. dex/worker_service.py +432 -0
  110. dex/workflow.py +79 -0
  111. dex/workflow_context.py +44 -0
  112. dex/workflow_info.py +16 -0
  113. dex/workflow_options.py +74 -0
  114. dex/workflow_state.py +123 -0
  115. dex/workflow_state_options.py +154 -0
  116. dex_python_sdk-0.0.2.dist-info/METADATA +202 -0
  117. dex_python_sdk-0.0.2.dist-info/RECORD +121 -0
  118. dex_python_sdk-0.0.2.dist-info/WHEEL +4 -0
  119. dex_python_sdk-0.0.2.dist-info/licenses/LEGACY_NOTICES.md +61 -0
  120. dex_python_sdk-0.0.2.dist-info/licenses/LICENSE +192 -0
  121. dex_python_sdk-0.0.2.dist-info/sboms/dex-blob-cache-python.cyclonedx.json +2406 -0
dex/channel.py ADDED
@@ -0,0 +1,165 @@
1
+ # Legacy Materials in this file remain under their original licenses.
2
+ # See LEGACY_NOTICES.md.
3
+
4
+ # Modifications Copyright (c) 2026 Super Durable, Inc.
5
+ #
6
+ # Modifications after the Legacy Cutoff are licensed under the
7
+ # Super Durable Source License 1.0.
8
+ # Legacy Materials remain under their original licenses.
9
+ # See LICENSE and LEGACY_NOTICES.md.
10
+
11
+ from __future__ import annotations
12
+
13
+ from dataclasses import dataclass
14
+ from typing import Generic, Sequence, TypeVar, cast
15
+
16
+ from dex._utils import require_name
17
+ from dex.condition import ChannelCondition, Condition
18
+ from dex.context import Context
19
+
20
+ ValueT = TypeVar("ValueT")
21
+
22
+
23
+ @dataclass(frozen=True)
24
+ class Channel(Generic[ValueT]):
25
+ name: str
26
+ value_type: type[ValueT]
27
+
28
+ def __post_init__(self) -> None:
29
+ require_name(self.name)
30
+
31
+ def publish(self, context: Context, value: ValueT) -> None:
32
+ context._publish_channel(self, None, value)
33
+
34
+ def size(self, context: Context) -> int:
35
+ return context._channel_size(cast(Channel[object], self), None)
36
+
37
+ def results(self, context: Context) -> Sequence[ValueT]:
38
+ return context._channel_results(self, None)
39
+
40
+ def for_one(self, *, condition_id: str | None = None) -> Condition:
41
+ return self.for_range(at_least=1, at_most=1, condition_id=condition_id)
42
+
43
+ def for_n(self, count: int, *, condition_id: str | None = None) -> Condition:
44
+ return self.for_range(
45
+ at_least=count,
46
+ at_most=count,
47
+ condition_id=condition_id,
48
+ )
49
+
50
+ def at_least(
51
+ self,
52
+ count: int,
53
+ *,
54
+ condition_id: str | None = None,
55
+ ) -> Condition:
56
+ return self.for_range(at_least=count, condition_id=condition_id)
57
+
58
+ def at_most(
59
+ self,
60
+ count: int,
61
+ *,
62
+ condition_id: str | None = None,
63
+ ) -> Condition:
64
+ return self.for_range(at_most=count, condition_id=condition_id)
65
+
66
+ def for_range(
67
+ self,
68
+ *,
69
+ at_least: int | None = None,
70
+ at_most: int | None = None,
71
+ condition_id: str | None = None,
72
+ ) -> Condition:
73
+ return ChannelCondition(
74
+ condition_id=condition_id,
75
+ channel=self,
76
+ at_least=at_least,
77
+ at_most=at_most,
78
+ )
79
+
80
+
81
+ @dataclass(frozen=True)
82
+ class ChannelMap(Generic[ValueT]):
83
+ name: str
84
+ value_type: type[ValueT]
85
+
86
+ def __post_init__(self) -> None:
87
+ require_name(self.name)
88
+
89
+ def publish(self, context: Context, instance: str, value: ValueT) -> None:
90
+ context._publish_channel(self, instance, value)
91
+
92
+ def size(self, context: Context, instance: str) -> int:
93
+ return context._channel_size(cast(ChannelMap[object], self), instance)
94
+
95
+ def results(self, context: Context, instance: str) -> Sequence[ValueT]:
96
+ return context._channel_results(self, instance)
97
+
98
+ def for_one(
99
+ self,
100
+ instance: str,
101
+ *,
102
+ condition_id: str | None = None,
103
+ ) -> Condition:
104
+ return self.for_range(
105
+ instance,
106
+ at_least=1,
107
+ at_most=1,
108
+ condition_id=condition_id,
109
+ )
110
+
111
+ def for_n(
112
+ self,
113
+ instance: str,
114
+ count: int,
115
+ *,
116
+ condition_id: str | None = None,
117
+ ) -> Condition:
118
+ return self.for_range(
119
+ instance,
120
+ at_least=count,
121
+ at_most=count,
122
+ condition_id=condition_id,
123
+ )
124
+
125
+ def at_least(
126
+ self,
127
+ instance: str,
128
+ count: int,
129
+ *,
130
+ condition_id: str | None = None,
131
+ ) -> Condition:
132
+ return self.for_range(
133
+ instance,
134
+ at_least=count,
135
+ condition_id=condition_id,
136
+ )
137
+
138
+ def at_most(
139
+ self,
140
+ instance: str,
141
+ count: int,
142
+ *,
143
+ condition_id: str | None = None,
144
+ ) -> Condition:
145
+ return self.for_range(
146
+ instance,
147
+ at_most=count,
148
+ condition_id=condition_id,
149
+ )
150
+
151
+ def for_range(
152
+ self,
153
+ instance: str,
154
+ *,
155
+ at_least: int | None = None,
156
+ at_most: int | None = None,
157
+ condition_id: str | None = None,
158
+ ) -> Condition:
159
+ return ChannelCondition(
160
+ condition_id=condition_id,
161
+ channel=self,
162
+ instance=instance,
163
+ at_least=at_least,
164
+ at_most=at_most,
165
+ )