aws-durable-execution-sdk-python-testing 1.0.0.post1__py3-none-any.whl → 1.1.0__py3-none-any.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.
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Amazon.com, Inc. or its affiliates.
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
- __version__ = "1.0.0.post1"
4
+ __version__ = "1.1.0"
@@ -458,7 +458,7 @@ class CliApp:
458
458
  def _create_boto3_client(
459
459
  self, endpoint_url: str | None = None, region_name: str | None = None
460
460
  ) -> Any:
461
- """Create boto3 client for lambdainternal service.
461
+ """Create boto3 client for Lambda service.
462
462
 
463
463
  Args:
464
464
  endpoint_url: Optional endpoint URL override
@@ -471,18 +471,13 @@ class CliApp:
471
471
  Exception: If client creation fails
472
472
  """
473
473
  try:
474
- # Set up AWS data path for boto models
475
- package_path = os.path.dirname(aws_durable_execution_sdk_python.__file__)
476
- data_path = f"{package_path}/botocore/data"
477
- os.environ["AWS_DATA_PATH"] = data_path
478
-
479
474
  # Use provided values or fall back to config
480
475
  final_endpoint = endpoint_url or self.config.local_runner_endpoint
481
476
  final_region = region_name or self.config.local_runner_region
482
477
 
483
478
  # Create client with local endpoint - no AWS access keys required
484
479
  return boto3.client(
485
- "lambdainternal",
480
+ "lambda",
486
481
  endpoint_url=final_endpoint,
487
482
  region_name=final_region,
488
483
  )
@@ -90,6 +90,7 @@ class Executor(ExecutionObserver):
90
90
  self._completion_events: dict[str, Event] = {}
91
91
  self._callback_timeouts: dict[str, Future] = {}
92
92
  self._callback_heartbeats: dict[str, Future] = {}
93
+ self._execution_timeout: Future | None = None
93
94
 
94
95
  def start_execution(
95
96
  self,
@@ -118,6 +119,21 @@ class Executor(ExecutionObserver):
118
119
  completion_event = self._scheduler.create_event()
119
120
  self._completion_events[execution.durable_execution_arn] = completion_event
120
121
 
122
+ # Schedule execution timeout
123
+ if input.execution_timeout_seconds > 0:
124
+
125
+ def timeout_handler():
126
+ error = ErrorObject.from_message(
127
+ f"Execution timed out after {input.execution_timeout_seconds} seconds."
128
+ )
129
+ self.on_timed_out(execution.durable_execution_arn, error)
130
+
131
+ self._execution_timeout = self._scheduler.call_later(
132
+ timeout_handler,
133
+ delay=input.execution_timeout_seconds,
134
+ completion_event=completion_event,
135
+ )
136
+
121
137
  # Schedule initial invocation to run immediately
122
138
  self._invoke_execution(execution.durable_execution_arn)
123
139
 
@@ -897,6 +913,9 @@ class Executor(ExecutionObserver):
897
913
  # complete doesn't actually checkpoint explicitly
898
914
  if event := self._completion_events.get(execution_arn):
899
915
  event.set()
916
+ if self._execution_timeout:
917
+ self._execution_timeout.cancel()
918
+ self._execution_timeout = None
900
919
 
901
920
  def wait_until_complete(
902
921
  self, execution_arn: str, timeout: float | None = None
@@ -136,9 +136,7 @@ class LambdaInvoker(Invoker):
136
136
  def create(endpoint_url: str, region_name: str) -> LambdaInvoker:
137
137
  """Create with the boto lambda client."""
138
138
  invoker = LambdaInvoker(
139
- boto3.client(
140
- "lambdainternal", endpoint_url=endpoint_url, region_name=region_name
141
- )
139
+ boto3.client("lambda", endpoint_url=endpoint_url, region_name=region_name)
142
140
  )
143
141
  invoker._current_endpoint = endpoint_url
144
142
  invoker._endpoint_clients[endpoint_url] = invoker.lambda_client
@@ -150,7 +148,7 @@ class LambdaInvoker(Invoker):
150
148
  with self._lock:
151
149
  if endpoint_url not in self._endpoint_clients:
152
150
  self._endpoint_clients[endpoint_url] = boto3.client(
153
- "lambdainternal", endpoint_url=endpoint_url, region_name=region_name
151
+ "lambda", endpoint_url=endpoint_url, region_name=region_name
154
152
  )
155
153
  self.lambda_client = self._endpoint_clients[endpoint_url]
156
154
  self._current_endpoint = endpoint_url
@@ -166,7 +164,7 @@ class LambdaInvoker(Invoker):
166
164
  if lambda_endpoint:
167
165
  if lambda_endpoint not in self._endpoint_clients:
168
166
  self._endpoint_clients[lambda_endpoint] = boto3.client(
169
- "lambdainternal",
167
+ "lambda",
170
168
  endpoint_url=lambda_endpoint,
171
169
  region_name=region_name or "us-east-1",
172
170
  )
@@ -698,10 +698,7 @@ class DurableFunctionTestRunner:
698
698
 
699
699
  # Timeout reached
700
700
  elapsed = time.time() - start_time
701
- msg = (
702
- f"Callback did not available within {timeout}s "
703
- f"(elapsed: {elapsed:.1f}s."
704
- )
701
+ msg = f"Callback did not available within {timeout}s (elapsed: {elapsed:.1f}s."
705
702
  raise TimeoutError(msg)
706
703
 
707
704
 
@@ -850,26 +847,20 @@ class WebRunner:
850
847
  self._executor = None
851
848
 
852
849
  def _create_boto3_client(self) -> Any:
853
- """Create boto3 client for lambdainternal service.
850
+ """Create boto3 client for Lambda service.
854
851
 
855
- Configures AWS data path and creates a boto3 client with the
856
- local runner endpoint and region from configuration.
852
+ Creates a boto3 client with the local runner endpoint and region from configuration.
857
853
 
858
854
  Returns:
859
- Configured boto3 client for lambdainternal service
855
+ Configured boto3 client for Lambda service
860
856
 
861
857
  Raises:
862
858
  Exception: If client creation fails - exceptions propagate naturally
863
859
  for CLI to handle as general Exception
864
860
  """
865
- # Set up AWS data path for boto models
866
- package_path = os.path.dirname(aws_durable_execution_sdk_python.__file__)
867
- data_path = f"{package_path}/botocore/data"
868
- os.environ["AWS_DATA_PATH"] = data_path
869
-
870
861
  # Create client with Lambda endpoint configuration
871
862
  return boto3.client(
872
- "lambdainternal",
863
+ "lambda",
873
864
  endpoint_url=self._config.lambda_endpoint,
874
865
  region_name=self._config.local_runner_region,
875
866
  )
@@ -904,14 +895,9 @@ class DurableFunctionCloudTestRunner:
904
895
  self.lambda_endpoint = lambda_endpoint
905
896
  self.poll_interval = poll_interval
906
897
 
907
- # Set up AWS data path for custom boto models (durable execution fields)
908
- package_path = os.path.dirname(aws_durable_execution_sdk_python.__file__)
909
- data_path = f"{package_path}/botocore/data"
910
- os.environ["AWS_DATA_PATH"] = data_path
911
-
912
898
  client_config = boto3.session.Config(parameter_validation=False)
913
899
  self.lambda_client = boto3.client(
914
- "lambdainternal",
900
+ "lambda",
915
901
  endpoint_url=lambda_endpoint,
916
902
  region_name=region,
917
903
  config=client_config,
@@ -1154,10 +1140,7 @@ class DurableFunctionCloudTestRunner:
1154
1140
 
1155
1141
  # Timeout reached
1156
1142
  elapsed = time.time() - start_time
1157
- msg = (
1158
- f"Callback did not available within {timeout}s "
1159
- f"(elapsed: {elapsed:.1f}s."
1160
- )
1143
+ msg = f"Callback did not available within {timeout}s (elapsed: {elapsed:.1f}s."
1161
1144
  raise TimeoutError(msg)
1162
1145
 
1163
1146
  def _fetch_execution_history(
@@ -110,15 +110,10 @@ class AwsRestJsonSerializer:
110
110
  InvalidParameterValueException: If serializer creation fails
111
111
  """
112
112
  try:
113
- package_path = os.path.dirname(aws_durable_execution_sdk_python.__file__)
114
- data_path = f"{package_path}/botocore/data"
115
-
116
113
  # Load service model
117
- os.environ["AWS_DATA_PATH"] = data_path
118
114
  loader = botocore.loaders.Loader()
119
- loader.search_paths.append(data_path)
120
115
 
121
- raw_model = loader.load_service_model("lambdainternal", "service-2")
116
+ raw_model = loader.load_service_model("lambda", "service-2")
122
117
  service_model = ServiceModel(raw_model)
123
118
 
124
119
  # Create serializer (rest-json protocol)
@@ -190,15 +185,10 @@ class AwsRestJsonDeserializer:
190
185
  InvalidParameterValueException: If deserializer creation fails
191
186
  """
192
187
  try:
193
- package_path = os.path.dirname(aws_durable_execution_sdk_python.__file__)
194
- data_path = f"{package_path}/botocore/data"
195
-
196
188
  # Load service model
197
- os.environ["AWS_DATA_PATH"] = data_path
198
189
  loader = botocore.loaders.Loader()
199
- loader.search_paths.append(data_path)
200
190
 
201
- raw_model = loader.load_service_model("lambdainternal", "service-2")
191
+ raw_model = loader.load_service_model("lambda", "service-2")
202
192
  service_model = ServiceModel(raw_model)
203
193
 
204
194
  # Create parser (rest-json protocol)
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aws-durable-execution-sdk-python-testing
3
- Version: 1.0.0.post1
4
- Summary: This is the Python SDK for AWS Lambda Durable Execution.
3
+ Version: 1.1.0
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
7
7
  Project-URL: Source, https://github.com/aws/aws-durable-execution-sdk-python-testing
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
19
19
  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
- Requires-Dist: boto3>=1.40.30
22
+ Requires-Dist: boto3>=1.42.1
23
23
  Requires-Dist: requests>=2.25.0
24
24
  Description-Content-Type: text/markdown
25
25
 
@@ -28,6 +28,9 @@ Description-Content-Type: text/markdown
28
28
  [![PyPI - Version](https://img.shields.io/pypi/v/aws-durable-execution-sdk-python-testing.svg)](https://pypi.org/project/aws-durable-execution-sdk-python-testing)
29
29
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aws-durable-execution-sdk-python-testing.svg)](https://pypi.org/project/aws-durable-execution-sdk-python-testing)
30
30
 
31
+
32
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/aws/aws-durable-execution-sdk-python-testing/badge)](https://scorecard.dev/viewer/?uri=github.com/aws/aws-durable-execution-sdk-python-testing)
33
+
31
34
  -----
32
35
 
33
36
  ## Table of Contents
@@ -1,15 +1,15 @@
1
- aws_durable_execution_sdk_python_testing/__about__.py,sha256=-QmpfYZ9pdzdlPWSCZhi8XGdOo1gGVCvVKZw7LcRN4Q,143
1
+ aws_durable_execution_sdk_python_testing/__about__.py,sha256=J8Ioq0hfedDOXKbDonThH6dyrixwCOoGnMoJKfbnTuQ,137
2
2
  aws_durable_execution_sdk_python_testing/__init__.py,sha256=bNtlkAlTpEvWJlUyFHcadozQfnb0PjnDze6upzJiog4,483
3
- aws_durable_execution_sdk_python_testing/cli.py,sha256=zGfKftKBd2p7zk8chOgpi4Ft6cnls0TG5vo0CZm-xKs,19137
3
+ aws_durable_execution_sdk_python_testing/cli.py,sha256=ET2C3pYX_54BtV6GpLfP7FKkwOTgGoubPl0G9ixLmJk,18875
4
4
  aws_durable_execution_sdk_python_testing/client.py,sha256=1CFuUXBZIkM7YOWwlJu4OrcjrJSTk01-Zc3N75kYSR4,1682
5
5
  aws_durable_execution_sdk_python_testing/exceptions.py,sha256=ZgFPDtKgBn4-tj7fqaye901CksNQWL9RmMhgJBhEu_U,9110
6
6
  aws_durable_execution_sdk_python_testing/execution.py,sha256=pWawO619mE6uEEEMrgtmNVI155uapIrHJCx0NhwjLTE,17448
7
- aws_durable_execution_sdk_python_testing/executor.py,sha256=_bLR1MaNJRnmYdmepM5c-9iRIus-792Lr2M3cQPd1KA,47794
8
- aws_durable_execution_sdk_python_testing/invoker.py,sha256=s-PR-EEBSosamAqgEyQX_1Mq7_QZ-X6N_3Z-e4uUmec,13210
7
+ aws_durable_execution_sdk_python_testing/executor.py,sha256=EOWLFXzRgd_h2lz0Smb5wvgPeDcruG11Q32a0vdztEw,48548
8
+ aws_durable_execution_sdk_python_testing/invoker.py,sha256=jOOcccs7v551lSXC_ozx3TorOfx6fPlZklFyySo_mmo,13156
9
9
  aws_durable_execution_sdk_python_testing/model.py,sha256=__3Vtq6n_FgcdRd0SbWN30y6eUcw9p7nj_agEX3KD1g,120112
10
10
  aws_durable_execution_sdk_python_testing/observer.py,sha256=32MOYOfrmlKRqbfTXTM7m22iT38U2oYLGUkp7ar4Kvw,4935
11
11
  aws_durable_execution_sdk_python_testing/py.typed,sha256=DbCDcAirv769HS1ibzZLXq8VPazYf7JCkKSzj3ctudM,58
12
- aws_durable_execution_sdk_python_testing/runner.py,sha256=H4SRztUf7Cm3UexNku082HxAUU8ZePFO4nzcVcSj8Sc,43202
12
+ aws_durable_execution_sdk_python_testing/runner.py,sha256=iRhNs3BDEkKj03i3toVTqCYoyK0C11P-FUf97g44S98,42559
13
13
  aws_durable_execution_sdk_python_testing/scheduler.py,sha256=yqKGu8r3OoqPaERpILVNCIwjhFRxGOKxk5u2QJyF-44,8551
14
14
  aws_durable_execution_sdk_python_testing/token.py,sha256=5rUpWMMcfZUVdOX_ptukRYiIRDsOdUA7faHXNyDGJRU,1530
15
15
  aws_durable_execution_sdk_python_testing/checkpoint/__init__.py,sha256=sPmvbGOTRrDUvjiQwxsN8jS7uEQhpobt84yzYLEHfhk,81
@@ -42,11 +42,11 @@ aws_durable_execution_sdk_python_testing/web/errors.py,sha256=8elkOXggINFhmfRFSP
42
42
  aws_durable_execution_sdk_python_testing/web/handlers.py,sha256=TBbroWvf_45Xus9zUR0ENVVQJMWWrO1Gt65F3KlTj6c,29129
43
43
  aws_durable_execution_sdk_python_testing/web/models.py,sha256=B4SKVcTculNsO4Qd53tqkPnwVxwguP5PjNgnWF7dp8o,8852
44
44
  aws_durable_execution_sdk_python_testing/web/routes.py,sha256=AU9fMhuR0HF9fltNZ6TZMNOueQc8wEeNyJqoBpMctm0,19466
45
- aws_durable_execution_sdk_python_testing/web/serialization.py,sha256=QZ1k5ilu6v9yVCZizJ43yTK8ix3nVGy4hBSfAX-DYO4,8253
45
+ aws_durable_execution_sdk_python_testing/web/serialization.py,sha256=qN6qJNgEYVqRQD9uhHupJVxyZfz4sc8KzIwxEqVIEcI,7747
46
46
  aws_durable_execution_sdk_python_testing/web/server.py,sha256=DQWwgyb_GKkHbFw_OYgPG1o7uIZ4-sG7F-GAUclLYu0,8853
47
- aws_durable_execution_sdk_python_testing-1.0.0.post1.dist-info/METADATA,sha256=Qrefbwelvox3rURxK3ONyieBjQubvFsWF68ISLr8HkQ,8729
48
- aws_durable_execution_sdk_python_testing-1.0.0.post1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
49
- aws_durable_execution_sdk_python_testing-1.0.0.post1.dist-info/entry_points.txt,sha256=fMm3DMHWb7k4-PSseaQ-BjUxNV_3Z7RyJaDVSwqnkEo,87
50
- aws_durable_execution_sdk_python_testing-1.0.0.post1.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
51
- aws_durable_execution_sdk_python_testing-1.0.0.post1.dist-info/licenses/NOTICE,sha256=1CkO1kwu3Q_OHYTj-d-yiBJA_lNN73a4zSntavaD4oc,67
52
- aws_durable_execution_sdk_python_testing-1.0.0.post1.dist-info/RECORD,,
47
+ aws_durable_execution_sdk_python_testing-1.1.0.dist-info/METADATA,sha256=_6AVzNE0BWzUaN59UskC6ZKhjOX7IXIgxMJeJ7qPFbE,8924
48
+ aws_durable_execution_sdk_python_testing-1.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
49
+ aws_durable_execution_sdk_python_testing-1.1.0.dist-info/entry_points.txt,sha256=fMm3DMHWb7k4-PSseaQ-BjUxNV_3Z7RyJaDVSwqnkEo,87
50
+ aws_durable_execution_sdk_python_testing-1.1.0.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
51
+ aws_durable_execution_sdk_python_testing-1.1.0.dist-info/licenses/NOTICE,sha256=1CkO1kwu3Q_OHYTj-d-yiBJA_lNN73a4zSntavaD4oc,67
52
+ aws_durable_execution_sdk_python_testing-1.1.0.dist-info/RECORD,,