async-durable-execution 0.1.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 (67) hide show
  1. async_durable_execution-0.1.0/.github/workflows/pypi.yml +70 -0
  2. async_durable_execution-0.1.0/.gitignore +31 -0
  3. async_durable_execution-0.1.0/LICENSE +175 -0
  4. async_durable_execution-0.1.0/PKG-INFO +80 -0
  5. async_durable_execution-0.1.0/README.md +70 -0
  6. async_durable_execution-0.1.0/pyproject.toml +44 -0
  7. async_durable_execution-0.1.0/src/async_durable_execution/.gitignore +0 -0
  8. async_durable_execution-0.1.0/src/async_durable_execution/__about__.py +4 -0
  9. async_durable_execution-0.1.0/src/async_durable_execution/__init__.py +42 -0
  10. async_durable_execution-0.1.0/src/async_durable_execution/concurrency/__init__.py +0 -0
  11. async_durable_execution-0.1.0/src/async_durable_execution/concurrency/executor.py +461 -0
  12. async_durable_execution-0.1.0/src/async_durable_execution/concurrency/models.py +540 -0
  13. async_durable_execution-0.1.0/src/async_durable_execution/config.py +499 -0
  14. async_durable_execution-0.1.0/src/async_durable_execution/context.py +635 -0
  15. async_durable_execution-0.1.0/src/async_durable_execution/exceptions.py +403 -0
  16. async_durable_execution-0.1.0/src/async_durable_execution/execution.py +463 -0
  17. async_durable_execution-0.1.0/src/async_durable_execution/identifier.py +14 -0
  18. async_durable_execution-0.1.0/src/async_durable_execution/lambda_service.py +1120 -0
  19. async_durable_execution-0.1.0/src/async_durable_execution/logger.py +131 -0
  20. async_durable_execution-0.1.0/src/async_durable_execution/operation/__init__.py +1 -0
  21. async_durable_execution-0.1.0/src/async_durable_execution/operation/base.py +187 -0
  22. async_durable_execution-0.1.0/src/async_durable_execution/operation/callback.py +182 -0
  23. async_durable_execution-0.1.0/src/async_durable_execution/operation/child.py +277 -0
  24. async_durable_execution-0.1.0/src/async_durable_execution/operation/invoke.py +172 -0
  25. async_durable_execution-0.1.0/src/async_durable_execution/operation/map.py +137 -0
  26. async_durable_execution-0.1.0/src/async_durable_execution/operation/parallel.py +122 -0
  27. async_durable_execution-0.1.0/src/async_durable_execution/operation/step.py +359 -0
  28. async_durable_execution-0.1.0/src/async_durable_execution/operation/wait.py +111 -0
  29. async_durable_execution-0.1.0/src/async_durable_execution/operation/wait_for_condition.py +283 -0
  30. async_durable_execution-0.1.0/src/async_durable_execution/py.typed +1 -0
  31. async_durable_execution-0.1.0/src/async_durable_execution/retries.py +174 -0
  32. async_durable_execution-0.1.0/src/async_durable_execution/serdes.py +502 -0
  33. async_durable_execution-0.1.0/src/async_durable_execution/state.py +798 -0
  34. async_durable_execution-0.1.0/src/async_durable_execution/suspend.py +84 -0
  35. async_durable_execution-0.1.0/src/async_durable_execution/threading.py +222 -0
  36. async_durable_execution-0.1.0/src/async_durable_execution/types.py +180 -0
  37. async_durable_execution-0.1.0/src/async_durable_execution/waits.py +130 -0
  38. async_durable_execution-0.1.0/tests/__init__.py +0 -0
  39. async_durable_execution-0.1.0/tests/concurrency_test.py +3298 -0
  40. async_durable_execution-0.1.0/tests/config_test.py +291 -0
  41. async_durable_execution-0.1.0/tests/context_test.py +1961 -0
  42. async_durable_execution-0.1.0/tests/durable_executions_python_language_sdk_test.py +15 -0
  43. async_durable_execution-0.1.0/tests/e2e/__init__.py +0 -0
  44. async_durable_execution-0.1.0/tests/e2e/checkpoint_response_int_test.py +768 -0
  45. async_durable_execution-0.1.0/tests/e2e/execution_int_test.py +623 -0
  46. async_durable_execution-0.1.0/tests/exceptions_test.py +376 -0
  47. async_durable_execution-0.1.0/tests/execution_test.py +2696 -0
  48. async_durable_execution-0.1.0/tests/lambda_service_test.py +2735 -0
  49. async_durable_execution-0.1.0/tests/logger_test.py +418 -0
  50. async_durable_execution-0.1.0/tests/operation/__init__.py +0 -0
  51. async_durable_execution-0.1.0/tests/operation/base_test.py +314 -0
  52. async_durable_execution-0.1.0/tests/operation/callback_test.py +1533 -0
  53. async_durable_execution-0.1.0/tests/operation/child_test.py +686 -0
  54. async_durable_execution-0.1.0/tests/operation/invoke_test.py +1187 -0
  55. async_durable_execution-0.1.0/tests/operation/map_test.py +1112 -0
  56. async_durable_execution-0.1.0/tests/operation/parallel_test.py +1104 -0
  57. async_durable_execution-0.1.0/tests/operation/step_test.py +896 -0
  58. async_durable_execution-0.1.0/tests/operation/wait_for_condition_test.py +1321 -0
  59. async_durable_execution-0.1.0/tests/operation/wait_test.py +419 -0
  60. async_durable_execution-0.1.0/tests/retries_test.py +576 -0
  61. async_durable_execution-0.1.0/tests/serdes_test.py +995 -0
  62. async_durable_execution-0.1.0/tests/state_test.py +3343 -0
  63. async_durable_execution-0.1.0/tests/suspend_test.py +65 -0
  64. async_durable_execution-0.1.0/tests/test_helpers.py +20 -0
  65. async_durable_execution-0.1.0/tests/threading_test.py +954 -0
  66. async_durable_execution-0.1.0/tests/types_test.py +198 -0
  67. async_durable_execution-0.1.0/tests/waits_test.py +415 -0
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,31 @@
1
+ *~
2
+ *#
3
+ *.swp
4
+ *.iml
5
+ *.DS_Store
6
+
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.egg-info/
11
+
12
+ /.coverage
13
+ /.coverage.*
14
+ /.cache
15
+ /.pytest_cache
16
+ /.mypy_cache
17
+ /.vscode
18
+
19
+ /doc/_apidoc/
20
+ /build
21
+
22
+ .venv
23
+ .venv/
24
+
25
+ .attach_*
26
+
27
+ dist/
28
+
29
+ .idea
30
+
31
+ .kiro/
@@ -0,0 +1,175 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: async-durable-execution
3
+ Version: 0.1.0
4
+ Summary: Async Lambda Durable Execution SDK for Python
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: aioboto3
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Async Durable Execution SDK for Python
12
+
13
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
14
+
15
+ -----
16
+
17
+ Build AWS Lambda Durable Functions With Async Python
18
+
19
+ ## ✨ Key Features
20
+
21
+ - **Automatic checkpointing** - Resume execution after Lambda pauses or restarts
22
+ - **Durable steps** - Run work with retry strategies and deterministic replay
23
+ - **Waits and callbacks** - Pause for time or external signals without blocking Lambda
24
+ - **Parallel and map operations** - Fan out work with configurable completion criteria
25
+ - **Child contexts** - Structure complex workflows into isolated subflows
26
+ - **Replay-safe logging** - Use `context.logger` for structured, de-duplicated logs
27
+ - **Local and cloud testing** - Validate workflows with the testing SDK
28
+
29
+ ## 🚀 Quick Start
30
+
31
+ Install the execution SDK:
32
+
33
+ ```console
34
+ pip install async-durable-execution
35
+ ```
36
+
37
+ Create a durable Lambda handler:
38
+
39
+ ```python
40
+ from async_durable_execution import (
41
+ DurableContext,
42
+ StepContext,
43
+ durable_execution,
44
+ durable_step,
45
+ )
46
+ from async_durable_execution.config import Duration
47
+
48
+
49
+ @durable_step
50
+ async def validate_order(step_ctx: StepContext, order_id: str) -> dict:
51
+ step_ctx.logger.info("Validating order", extra={"order_id": order_id})
52
+ return {"order_id": order_id, "valid": True}
53
+
54
+
55
+ @durable_execution
56
+ async def handler(event: dict, context: DurableContext) -> dict:
57
+ order_id = event["order_id"]
58
+ context.logger.info("Starting workflow", extra={"order_id": order_id})
59
+
60
+ validation = await context.step(validate_order(order_id), name="validate_order")
61
+ if not validation["valid"]:
62
+ return {"status": "rejected", "order_id": order_id}
63
+
64
+ # simulate approval (real world: use wait_for_callback)
65
+ await context.wait(duration=Duration.from_seconds(5), name="await_confirmation")
66
+
67
+ return {"status": "approved", "order_id": order_id}
68
+ ```
69
+
70
+ ## 📚 Documentation
71
+
72
+ - **[AWS Documentation](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html)** - Official AWS Lambda durable functions guide
73
+
74
+ ## 💬 Feedback & Support
75
+
76
+ - [Contributing guide](CONTRIBUTING.md)
77
+
78
+ ## 📄 License
79
+
80
+ See the [LICENSE](LICENSE) file for our project's licensing.
@@ -0,0 +1,70 @@
1
+ # Async Durable Execution SDK for Python
2
+
3
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
4
+
5
+ -----
6
+
7
+ Build AWS Lambda Durable Functions With Async Python
8
+
9
+ ## ✨ Key Features
10
+
11
+ - **Automatic checkpointing** - Resume execution after Lambda pauses or restarts
12
+ - **Durable steps** - Run work with retry strategies and deterministic replay
13
+ - **Waits and callbacks** - Pause for time or external signals without blocking Lambda
14
+ - **Parallel and map operations** - Fan out work with configurable completion criteria
15
+ - **Child contexts** - Structure complex workflows into isolated subflows
16
+ - **Replay-safe logging** - Use `context.logger` for structured, de-duplicated logs
17
+ - **Local and cloud testing** - Validate workflows with the testing SDK
18
+
19
+ ## 🚀 Quick Start
20
+
21
+ Install the execution SDK:
22
+
23
+ ```console
24
+ pip install async-durable-execution
25
+ ```
26
+
27
+ Create a durable Lambda handler:
28
+
29
+ ```python
30
+ from async_durable_execution import (
31
+ DurableContext,
32
+ StepContext,
33
+ durable_execution,
34
+ durable_step,
35
+ )
36
+ from async_durable_execution.config import Duration
37
+
38
+
39
+ @durable_step
40
+ async def validate_order(step_ctx: StepContext, order_id: str) -> dict:
41
+ step_ctx.logger.info("Validating order", extra={"order_id": order_id})
42
+ return {"order_id": order_id, "valid": True}
43
+
44
+
45
+ @durable_execution
46
+ async def handler(event: dict, context: DurableContext) -> dict:
47
+ order_id = event["order_id"]
48
+ context.logger.info("Starting workflow", extra={"order_id": order_id})
49
+
50
+ validation = await context.step(validate_order(order_id), name="validate_order")
51
+ if not validation["valid"]:
52
+ return {"status": "rejected", "order_id": order_id}
53
+
54
+ # simulate approval (real world: use wait_for_callback)
55
+ await context.wait(duration=Duration.from_seconds(5), name="await_confirmation")
56
+
57
+ return {"status": "approved", "order_id": order_id}
58
+ ```
59
+
60
+ ## 📚 Documentation
61
+
62
+ - **[AWS Documentation](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html)** - Official AWS Lambda durable functions guide
63
+
64
+ ## 💬 Feedback & Support
65
+
66
+ - [Contributing guide](CONTRIBUTING.md)
67
+
68
+ ## 📄 License
69
+
70
+ See the [LICENSE](LICENSE) file for our project's licensing.
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "async-durable-execution"
7
+ dynamic = ["version"]
8
+ description = 'Async Lambda Durable Execution SDK for Python'
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "Apache-2.0"
12
+ keywords = []
13
+ dependencies = ["aioboto3"]
14
+
15
+ [tool.hatch.build.targets.wheel]
16
+ packages = ["src/async_durable_execution"]
17
+
18
+ [tool.hatch.version]
19
+ path = "src/async_durable_execution/__about__.py"
20
+
21
+ [tool.hatch.envs.test]
22
+ dependencies = ["coverage[toml]", "pytest", "pytest-cov"]
23
+
24
+ [tool.hatch.envs.test.scripts]
25
+ cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/async_durable_execution --cov-fail-under=98"
26
+
27
+ [tool.hatch.envs.types]
28
+ extra-dependencies = ["mypy>=1.0.0", "pytest", "boto3-stubs[lambda]"]
29
+ [tool.hatch.envs.types.scripts]
30
+ check = "mypy --install-types --non-interactive {args:src/async_durable_execution tests}"
31
+
32
+ [tool.coverage.run]
33
+ source_pkgs = ["async_durable_execution"]
34
+ branch = true
35
+ parallel = true
36
+ omit = ["src/async_durable_execution/__about__.py"]
37
+
38
+ [tool.coverage.paths]
39
+ async_durable_execution = [
40
+ "src/async_durable_execution"
41
+ ]
42
+
43
+ [tool.coverage.report]
44
+ exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
@@ -0,0 +1,4 @@
1
+ # SPDX-FileCopyrightText: 2025-present Amazon.com, Inc. or its affiliates.
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ __version__ = "0.1.0"
@@ -0,0 +1,42 @@
1
+ """AWS Lambda Durable Executions Python SDK."""
2
+
3
+ # Package metadata
4
+ from .__about__ import __version__
5
+
6
+ # Main context - used in every durable function
7
+ # Helper decorators - commonly used for step functions
8
+ # Concurrency
9
+ from .concurrency.models import BatchResult
10
+ from .context import (
11
+ DurableContext,
12
+ durable_step,
13
+ durable_wait_for_callback,
14
+ durable_with_child_context,
15
+ )
16
+
17
+ # Most common exceptions - users need to handle these exceptions
18
+ from .exceptions import (
19
+ DurableExecutionsError,
20
+ InvocationError,
21
+ ValidationError,
22
+ )
23
+
24
+ # Core decorator - used in every durable function
25
+ from .execution import durable_execution
26
+
27
+ # Essential context types - passed to user functions
28
+ from .types import StepContext
29
+
30
+ __all__ = [
31
+ "BatchResult",
32
+ "DurableContext",
33
+ "DurableExecutionsError",
34
+ "InvocationError",
35
+ "StepContext",
36
+ "ValidationError",
37
+ "__version__",
38
+ "durable_execution",
39
+ "durable_step",
40
+ "durable_wait_for_callback",
41
+ "durable_with_child_context",
42
+ ]