aws-durable-execution-sdk-python-testing 1.1.2__tar.gz → 1.2.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.
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/.gitignore +0 -3
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/PKG-INFO +1 -2
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/__about__.py +1 -1
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/cli.py +27 -25
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/execution.py +5 -1
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/pyproject.toml +2 -33
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/LICENSE +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/NOTICE +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/README.md +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processor.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/base.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/callback.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/context.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/execution.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/step.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/processors/wait.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/transformer.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/checkpoint.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/callback.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/context.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/execution.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/invoke.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/step.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/wait.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/checkpoint/validators/transitions.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/client.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/exceptions.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/executor.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/invoker.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/model.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/observer.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/py.typed +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/runner.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/scheduler.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/stores/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/stores/base.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/stores/filesystem.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/stores/memory.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/stores/sqlite.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/token.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/__init__.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/errors.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/handlers.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/models.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/routes.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/serialization.py +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.2 → aws_durable_execution_sdk_python_testing-1.2.0}/aws_durable_execution_sdk_python_testing/web/server.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aws-durable-execution-sdk-python-testing
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: AWS Durable Execution Testing SDK for Python
|
|
5
5
|
Project-URL: Documentation, https://github.com/aws/aws-durable-execution-sdk-python-testing#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/aws/aws-durable-execution-sdk-python-testing/issues
|
|
@@ -20,7 +20,6 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
|
20
20
|
Requires-Python: >=3.11
|
|
21
21
|
Requires-Dist: aws-durable-execution-sdk-python>=1.0.0
|
|
22
22
|
Requires-Dist: boto3>=1.42.1
|
|
23
|
-
Requires-Dist: requests>=2.25.0
|
|
24
23
|
Description-Content-Type: text/markdown
|
|
25
24
|
|
|
26
25
|
# AWS Durable Execution Testing SDK for Python
|
|
@@ -21,7 +21,9 @@ from urllib.parse import urljoin
|
|
|
21
21
|
|
|
22
22
|
import aws_durable_execution_sdk_python
|
|
23
23
|
import boto3 # type: ignore
|
|
24
|
-
import
|
|
24
|
+
from urllib.error import HTTPError, URLError
|
|
25
|
+
from urllib.request import Request, urlopen
|
|
26
|
+
|
|
25
27
|
from botocore.exceptions import ConnectionError # type: ignore
|
|
26
28
|
|
|
27
29
|
from aws_durable_execution_sdk_python_testing.exceptions import (
|
|
@@ -348,37 +350,37 @@ class CliApp:
|
|
|
348
350
|
endpoint_url = self.config.local_runner_endpoint
|
|
349
351
|
url = urljoin(endpoint_url, "/start-durable-execution")
|
|
350
352
|
|
|
351
|
-
headers = {"Content-Type": "application/json"}
|
|
352
353
|
payload = start_input.to_dict()
|
|
354
|
+
data = json.dumps(payload).encode("utf-8")
|
|
355
|
+
req = Request(
|
|
356
|
+
url,
|
|
357
|
+
data=data,
|
|
358
|
+
headers={"Content-Type": "application/json"},
|
|
359
|
+
method="POST",
|
|
360
|
+
)
|
|
353
361
|
|
|
354
|
-
response = requests.post(url, json=payload, headers=headers, timeout=30)
|
|
355
|
-
|
|
356
|
-
if response.status_code == 201: # noqa: PLR2004
|
|
357
|
-
# Success - print the response
|
|
358
|
-
result = response.json()
|
|
359
|
-
print(json.dumps(result, indent=2)) # noqa: T201
|
|
360
|
-
return 0
|
|
361
|
-
|
|
362
|
-
# Error - print error details
|
|
363
362
|
try:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
363
|
+
with urlopen(req, timeout=10) as response: # noqa: S310
|
|
364
|
+
result = json.loads(response.read().decode("utf-8"))
|
|
365
|
+
print(json.dumps(result, indent=2)) # noqa: T201
|
|
366
|
+
return 0
|
|
367
|
+
except HTTPError as e:
|
|
368
|
+
try:
|
|
369
|
+
error_data = json.loads(e.read().decode("utf-8"))
|
|
370
|
+
logger.exception("HTTP error response")
|
|
371
|
+
print( # noqa: T201
|
|
372
|
+
f"Error: {error_data.get('ErrorMessage', 'Unknown error')}",
|
|
373
|
+
file=sys.stderr,
|
|
374
|
+
)
|
|
375
|
+
except json.JSONDecodeError:
|
|
376
|
+
logger.exception("Non-JSON error response")
|
|
377
|
+
return 1
|
|
378
|
+
|
|
379
|
+
except URLError:
|
|
375
380
|
logger.exception(
|
|
376
381
|
"Error: Could not connect to the local runner server. Is it running?"
|
|
377
382
|
)
|
|
378
383
|
return 1
|
|
379
|
-
except requests.exceptions.Timeout:
|
|
380
|
-
logger.exception("Request timeout")
|
|
381
|
-
return 1
|
|
382
384
|
except Exception:
|
|
383
385
|
logger.exception("Unexpected error in invoke command")
|
|
384
386
|
return 1
|
|
@@ -91,7 +91,11 @@ class Execution:
|
|
|
91
91
|
# Pattern: arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:durable-execution:[a-zA-Z0-9-_\.]+:[a-zA-Z0-9-_\.]+:[a-zA-Z0-9-_\.]+
|
|
92
92
|
# Example: arn:aws:lambda:us-east-1:123456789012:durable-execution:myDurableFunction:myDurableExecutionName:ce67da72-3701-4f83-9174-f4189d27b0a5
|
|
93
93
|
return Execution(
|
|
94
|
-
durable_execution_arn=str(uuid4())
|
|
94
|
+
durable_execution_arn=str(uuid4())
|
|
95
|
+
+ "/"
|
|
96
|
+
+ (input.invocation_id or str(uuid4())),
|
|
97
|
+
start_input=input,
|
|
98
|
+
operations=[],
|
|
95
99
|
)
|
|
96
100
|
|
|
97
101
|
def to_json_dict(self) -> dict[str, Any]:
|
|
@@ -23,7 +23,6 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
dependencies = [
|
|
25
25
|
"boto3>=1.42.1",
|
|
26
|
-
"requests>=2.25.0",
|
|
27
26
|
"aws_durable_execution_sdk_python>=1.0.0",
|
|
28
27
|
]
|
|
29
28
|
|
|
@@ -64,28 +63,7 @@ dependencies = [
|
|
|
64
63
|
|
|
65
64
|
[tool.hatch.envs.test.scripts]
|
|
66
65
|
test = "pytest tests/ -v"
|
|
67
|
-
|
|
68
|
-
examples-integration = "pytest --runner-mode=cloud -m example examples/test/ -v {args}"
|
|
69
|
-
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/aws_durable_execution_sdk_python_testing --cov-fail-under=96"
|
|
70
|
-
|
|
71
|
-
[tool.hatch.envs.examples]
|
|
72
|
-
dependencies = [
|
|
73
|
-
"boto3",
|
|
74
|
-
"PyYAML",
|
|
75
|
-
"aws_durable_execution_sdk_python>=1.0.0",
|
|
76
|
-
]
|
|
77
|
-
[tool.hatch.envs.examples.scripts]
|
|
78
|
-
cli = "python examples/cli.py {args}"
|
|
79
|
-
bootstrap = "python examples/cli.py bootstrap"
|
|
80
|
-
generate-sam-template = "python examples/scripts/generate_sam_template.py"
|
|
81
|
-
build = "python examples/cli.py build"
|
|
82
|
-
deploy = "python examples/cli.py deploy {args}"
|
|
83
|
-
invoke = "python examples/cli.py invoke {args}"
|
|
84
|
-
get = "python examples/cli.py get {args}"
|
|
85
|
-
history = "python examples/cli.py history {args}"
|
|
86
|
-
policy = "python examples/cli.py policy {args}"
|
|
87
|
-
list = "python examples/cli.py list"
|
|
88
|
-
clean = "rm -rf examples/build examples/.aws-sam examples/*.zip"
|
|
66
|
+
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/aws_durable_execution_sdk_python_testing --cov-fail-under=95"
|
|
89
67
|
|
|
90
68
|
[tool.hatch.envs.types]
|
|
91
69
|
extra-dependencies = ["mypy>=1.0.0", "pytest"]
|
|
@@ -136,15 +114,6 @@ lines-after-imports = 2
|
|
|
136
114
|
"SIM117",
|
|
137
115
|
"TRY301",
|
|
138
116
|
]
|
|
139
|
-
"examples/test/**" = [
|
|
140
|
-
"ARG001",
|
|
141
|
-
"ARG002",
|
|
142
|
-
"ARG005",
|
|
143
|
-
"S101",
|
|
144
|
-
"PLR2004",
|
|
145
|
-
"SIM117",
|
|
146
|
-
"TRY301",
|
|
147
|
-
]
|
|
148
117
|
"src/aws_durable_execution_sdk_python_testing/invoker.py" = [
|
|
149
118
|
"A002", # Argument `input` is shadowing a Python builtin
|
|
150
119
|
]
|
|
@@ -158,6 +127,6 @@ markers = [
|
|
|
158
127
|
"durable_execution: marks tests that use the durable_runner fixture (not used for test selection)",
|
|
159
128
|
]
|
|
160
129
|
# Default test discovery paths
|
|
161
|
-
testpaths = ["tests"
|
|
130
|
+
testpaths = ["tests"]
|
|
162
131
|
# Default options for all test runs
|
|
163
132
|
addopts = "-v --strict-markers"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|