orcher-sdk 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.
Files changed (139) hide show
  1. orcher_sdk-0.4.0/CHANGELOG.md +1 -0
  2. orcher_sdk-0.4.0/CONTRIBUTING.md +54 -0
  3. orcher_sdk-0.4.0/Cargo.lock +2120 -0
  4. orcher_sdk-0.4.0/Cargo.toml +63 -0
  5. orcher_sdk-0.4.0/LICENSE +201 -0
  6. orcher_sdk-0.4.0/PKG-INFO +352 -0
  7. orcher_sdk-0.4.0/README.md +310 -0
  8. orcher_sdk-0.4.0/native/src/actor_state.rs +395 -0
  9. orcher_sdk-0.4.0/native/src/client.rs +879 -0
  10. orcher_sdk-0.4.0/native/src/codec.rs +371 -0
  11. orcher_sdk-0.4.0/native/src/convert.rs +187 -0
  12. orcher_sdk-0.4.0/native/src/error.rs +166 -0
  13. orcher_sdk-0.4.0/native/src/journal_times.rs +194 -0
  14. orcher_sdk-0.4.0/native/src/lib.rs +198 -0
  15. orcher_sdk-0.4.0/native/src/runtime.rs +64 -0
  16. orcher_sdk-0.4.0/native/src/types.rs +559 -0
  17. orcher_sdk-0.4.0/native/src/worker.rs +2148 -0
  18. orcher_sdk-0.4.0/pyproject.toml +114 -0
  19. orcher_sdk-0.4.0/src/orcher/__init__.py +211 -0
  20. orcher_sdk-0.4.0/src/orcher/_internal/__init__.py +34 -0
  21. orcher_sdk-0.4.0/src/orcher/_internal/async_utils.py +160 -0
  22. orcher_sdk-0.4.0/src/orcher/_internal/logging.py +75 -0
  23. orcher_sdk-0.4.0/src/orcher/_internal/utils.py +139 -0
  24. orcher_sdk-0.4.0/src/orcher/_native.pyi +575 -0
  25. orcher_sdk-0.4.0/src/orcher/actor/__init__.py +52 -0
  26. orcher_sdk-0.4.0/src/orcher/actor/client.py +125 -0
  27. orcher_sdk-0.4.0/src/orcher/actor/context.py +142 -0
  28. orcher_sdk-0.4.0/src/orcher/actor/state/__init__.py +16 -0
  29. orcher_sdk-0.4.0/src/orcher/actor/state/client.py +182 -0
  30. orcher_sdk-0.4.0/src/orcher/actor/state/manager.py +123 -0
  31. orcher_sdk-0.4.0/src/orcher/actor/state/mock.py +41 -0
  32. orcher_sdk-0.4.0/src/orcher/actor/types.py +92 -0
  33. orcher_sdk-0.4.0/src/orcher/client/__init__.py +28 -0
  34. orcher_sdk-0.4.0/src/orcher/client/client.py +359 -0
  35. orcher_sdk-0.4.0/src/orcher/client/config.py +53 -0
  36. orcher_sdk-0.4.0/src/orcher/client/workflow_handle.py +257 -0
  37. orcher_sdk-0.4.0/src/orcher/codec/__init__.py +32 -0
  38. orcher_sdk-0.4.0/src/orcher/converter/__init__.py +97 -0
  39. orcher_sdk-0.4.0/src/orcher/converter/base.py +164 -0
  40. orcher_sdk-0.4.0/src/orcher/converter/json.py +377 -0
  41. orcher_sdk-0.4.0/src/orcher/converter/payload.py +399 -0
  42. orcher_sdk-0.4.0/src/orcher/core/__init__.py +35 -0
  43. orcher_sdk-0.4.0/src/orcher/core/bridge.py +147 -0
  44. orcher_sdk-0.4.0/src/orcher/core/native.py +125 -0
  45. orcher_sdk-0.4.0/src/orcher/decorators/__init__.py +55 -0
  46. orcher_sdk-0.4.0/src/orcher/decorators/actor.py +141 -0
  47. orcher_sdk-0.4.0/src/orcher/decorators/query.py +117 -0
  48. orcher_sdk-0.4.0/src/orcher/decorators/registry.py +520 -0
  49. orcher_sdk-0.4.0/src/orcher/decorators/task.py +164 -0
  50. orcher_sdk-0.4.0/src/orcher/decorators/task_class.py +116 -0
  51. orcher_sdk-0.4.0/src/orcher/decorators/update.py +125 -0
  52. orcher_sdk-0.4.0/src/orcher/decorators/workflow.py +165 -0
  53. orcher_sdk-0.4.0/src/orcher/errors/__init__.py +68 -0
  54. orcher_sdk-0.4.0/src/orcher/errors/_translate.py +124 -0
  55. orcher_sdk-0.4.0/src/orcher/errors/base.py +84 -0
  56. orcher_sdk-0.4.0/src/orcher/errors/client.py +38 -0
  57. orcher_sdk-0.4.0/src/orcher/errors/codes.py +63 -0
  58. orcher_sdk-0.4.0/src/orcher/errors/context.py +360 -0
  59. orcher_sdk-0.4.0/src/orcher/errors/failure.py +507 -0
  60. orcher_sdk-0.4.0/src/orcher/errors/service.py +27 -0
  61. orcher_sdk-0.4.0/src/orcher/errors/task.py +81 -0
  62. orcher_sdk-0.4.0/src/orcher/errors/workflow.py +130 -0
  63. orcher_sdk-0.4.0/src/orcher/interceptors/__init__.py +66 -0
  64. orcher_sdk-0.4.0/src/orcher/interceptors/base.py +267 -0
  65. orcher_sdk-0.4.0/src/orcher/interceptors/builtin/__init__.py +36 -0
  66. orcher_sdk-0.4.0/src/orcher/interceptors/builtin/logging.py +203 -0
  67. orcher_sdk-0.4.0/src/orcher/interceptors/builtin/metrics.py +367 -0
  68. orcher_sdk-0.4.0/src/orcher/interceptors/builtin/tracing.py +344 -0
  69. orcher_sdk-0.4.0/src/orcher/interceptors/chain.py +224 -0
  70. orcher_sdk-0.4.0/src/orcher/py.typed +0 -0
  71. orcher_sdk-0.4.0/src/orcher/task/__init__.py +37 -0
  72. orcher_sdk-0.4.0/src/orcher/task/cancellation.py +72 -0
  73. orcher_sdk-0.4.0/src/orcher/task/context.py +192 -0
  74. orcher_sdk-0.4.0/src/orcher/task/execution.py +185 -0
  75. orcher_sdk-0.4.0/src/orcher/task/info.py +46 -0
  76. orcher_sdk-0.4.0/src/orcher/task/reference.py +102 -0
  77. orcher_sdk-0.4.0/src/orcher/testing/__init__.py +78 -0
  78. orcher_sdk-0.4.0/src/orcher/testing/builders.py +516 -0
  79. orcher_sdk-0.4.0/src/orcher/testing/environment.py +767 -0
  80. orcher_sdk-0.4.0/src/orcher/testing/mocks.py +517 -0
  81. orcher_sdk-0.4.0/src/orcher/testing/time_controller.py +266 -0
  82. orcher_sdk-0.4.0/src/orcher/testing/types.py +245 -0
  83. orcher_sdk-0.4.0/src/orcher/types/__init__.py +441 -0
  84. orcher_sdk-0.4.0/src/orcher/worker/__init__.py +99 -0
  85. orcher_sdk-0.4.0/src/orcher/worker/builder.py +610 -0
  86. orcher_sdk-0.4.0/src/orcher/worker/config.py +218 -0
  87. orcher_sdk-0.4.0/src/orcher/worker/execution_pool.py +455 -0
  88. orcher_sdk-0.4.0/src/orcher/worker/executor.py +424 -0
  89. orcher_sdk-0.4.0/src/orcher/worker/poller.py +339 -0
  90. orcher_sdk-0.4.0/src/orcher/worker/session.py +159 -0
  91. orcher_sdk-0.4.0/src/orcher/worker/worker.py +1981 -0
  92. orcher_sdk-0.4.0/src/orcher/workflow/__init__.py +110 -0
  93. orcher_sdk-0.4.0/src/orcher/workflow/child.py +85 -0
  94. orcher_sdk-0.4.0/src/orcher/workflow/commands.py +301 -0
  95. orcher_sdk-0.4.0/src/orcher/workflow/context.py +1360 -0
  96. orcher_sdk-0.4.0/src/orcher/workflow/events.py +271 -0
  97. orcher_sdk-0.4.0/src/orcher/workflow/execution.py +126 -0
  98. orcher_sdk-0.4.0/src/orcher/workflow/info.py +37 -0
  99. orcher_sdk-0.4.0/src/orcher/workflow/queries.py +222 -0
  100. orcher_sdk-0.4.0/src/orcher/workflow/random.py +62 -0
  101. orcher_sdk-0.4.0/src/orcher/workflow/saga.py +175 -0
  102. orcher_sdk-0.4.0/src/orcher/workflow/sentinels.py +14 -0
  103. orcher_sdk-0.4.0/src/orcher/workflow/session.py +213 -0
  104. orcher_sdk-0.4.0/src/orcher/workflow/time.py +71 -0
  105. orcher_sdk-0.4.0/tests/__init__.py +1 -0
  106. orcher_sdk-0.4.0/tests/support/__init__.py +0 -0
  107. orcher_sdk-0.4.0/tests/support/fake_engine.py +290 -0
  108. orcher_sdk-0.4.0/tests/test_bridge_call_signatures.py +51 -0
  109. orcher_sdk-0.4.0/tests/test_child_handles.py +133 -0
  110. orcher_sdk-0.4.0/tests/test_client.py +279 -0
  111. orcher_sdk-0.4.0/tests/test_closures_journal_and_replay.py +107 -0
  112. orcher_sdk-0.4.0/tests/test_context.py +411 -0
  113. orcher_sdk-0.4.0/tests/test_converter.py +591 -0
  114. orcher_sdk-0.4.0/tests/test_decorators.py +366 -0
  115. orcher_sdk-0.4.0/tests/test_errors.py +599 -0
  116. orcher_sdk-0.4.0/tests/test_handle_raises_documented_errors.py +114 -0
  117. orcher_sdk-0.4.0/tests/test_integration.py +412 -0
  118. orcher_sdk-0.4.0/tests/test_interceptors.py +1213 -0
  119. orcher_sdk-0.4.0/tests/test_interceptors_run.py +149 -0
  120. orcher_sdk-0.4.0/tests/test_random_is_stable_across_processes.py +66 -0
  121. orcher_sdk-0.4.0/tests/test_replay_step_ids.py +89 -0
  122. orcher_sdk-0.4.0/tests/test_retry_policy.py +130 -0
  123. orcher_sdk-0.4.0/tests/test_service.py +654 -0
  124. orcher_sdk-0.4.0/tests/test_silent_no_ops.py +69 -0
  125. orcher_sdk-0.4.0/tests/test_small_defects.py +144 -0
  126. orcher_sdk-0.4.0/tests/test_smoke.py +64 -0
  127. orcher_sdk-0.4.0/tests/test_status_is_the_documented_enum.py +70 -0
  128. orcher_sdk-0.4.0/tests/test_task_duration_encoding.py +39 -0
  129. orcher_sdk-0.4.0/tests/test_task_failure_type.py +62 -0
  130. orcher_sdk-0.4.0/tests/test_task_heartbeat.py +56 -0
  131. orcher_sdk-0.4.0/tests/test_testing.py +689 -0
  132. orcher_sdk-0.4.0/tests/test_types.py +164 -0
  133. orcher_sdk-0.4.0/tests/test_vocabulary.py +50 -0
  134. orcher_sdk-0.4.0/tests/test_wait_for_event_timeout.py +127 -0
  135. orcher_sdk-0.4.0/tests/test_worker_api_key.py +136 -0
  136. orcher_sdk-0.4.0/tests/test_worker_builder_durations.py +45 -0
  137. orcher_sdk-0.4.0/tests/test_worker_version_id.py +83 -0
  138. orcher_sdk-0.4.0/tests/test_workflow_failure_type.py +19 -0
  139. orcher_sdk-0.4.0/tests/test_workflow_time.py +121 -0
@@ -0,0 +1 @@
1
+ # Changelog
@@ -0,0 +1,54 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in the Orcher Python SDK. Bug reports, fixes and
4
+ improvements are welcome.
5
+
6
+ ## Reporting a problem
7
+
8
+ Open an issue with the SDK version, your Python version, what you ran, and
9
+ what happened. A short script that reproduces the problem helps the most.
10
+
11
+ ## Development setup
12
+
13
+ You need Python 3.11 or later and a stable Rust toolchain.
14
+
15
+ ```bash
16
+ python -m venv .venv
17
+ source .venv/bin/activate
18
+ pip install "maturin>=1.4,<2.0"
19
+ maturin develop --extras dev # builds the native extension into the venv
20
+ ```
21
+
22
+ Rerun `maturin develop` after changing anything under `native/`.
23
+
24
+ To build against local checkouts of `sdk-core` and `protos` instead of the
25
+ crates.io releases in `Cargo.toml`, copy `.cargo/config.example.toml` to
26
+ `.cargo/config.toml`.
27
+
28
+ ## Checks
29
+
30
+ Pull requests must pass the same checks CI runs:
31
+
32
+ ```bash
33
+ ruff check .
34
+ python -m pytest -rs
35
+ ```
36
+
37
+ Unit tests do not need an engine. The suite in `contract/` does: it runs a
38
+ real worker against a running engine and checks the durable behavior end to
39
+ end. Run it for changes to the worker, the workflow context or the native
40
+ extension. See [contract/README.md](contract/README.md).
41
+
42
+ ## Pull requests
43
+
44
+ - Keep each pull request to one change, with tests for new behavior and for
45
+ bugs you fix.
46
+ - Write commit messages as [Conventional Commits](https://www.conventionalcommits.org)
47
+ (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `ci:`, `chore:`). Releases
48
+ and the changelog are generated from them.
49
+ - Update docstrings and the README when you change public behavior.
50
+
51
+ ## License
52
+
53
+ By contributing, you agree that your contributions are licensed under the
54
+ Apache License 2.0, the license of this project.