localstack-core 4.7.1.dev40__py3-none-any.whl → 4.7.1.dev41__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.

Potentially problematic release.


This version of localstack-core might be problematic. Click here for more details.

Files changed (86) hide show
  1. localstack/aws/handlers/service.py +2 -2
  2. localstack/aws/mocking.py +1 -1
  3. localstack/aws/protocol/serializer.py +1 -1
  4. localstack/config.py +1 -1
  5. localstack/dev/run/__main__.py +1 -1
  6. localstack/services/cloudformation/engine/entities.py +1 -1
  7. localstack/services/cloudformation/engine/parameters.py +1 -1
  8. localstack/services/cloudformation/engine/v2/change_set_model.py +16 -16
  9. localstack/services/cloudformation/engine/v2/change_set_model_describer.py +1 -1
  10. localstack/services/cloudformation/engine/v2/change_set_model_executor.py +3 -3
  11. localstack/services/cloudformation/engine/v2/change_set_model_preproc.py +16 -16
  12. localstack/services/cloudformation/engine/v2/change_set_model_transform.py +3 -3
  13. localstack/services/cloudformation/engine/v2/change_set_model_validator.py +1 -1
  14. localstack/services/cloudformation/scaffolding/__main__.py +5 -5
  15. localstack/services/cloudformation/stores.py +1 -1
  16. localstack/services/cloudformation/v2/provider.py +3 -3
  17. localstack/services/lambda_/api_utils.py +1 -1
  18. localstack/services/lambda_/invocation/docker_runtime_executor.py +1 -1
  19. localstack/services/lambda_/provider.py +1 -1
  20. localstack/services/secretsmanager/provider.py +1 -1
  21. localstack/services/sqs/provider.py +1 -1
  22. localstack/services/stepfunctions/asl/component/common/assign/assign_decl.py +1 -1
  23. localstack/services/stepfunctions/asl/component/common/assign/assign_decl_binding.py +1 -1
  24. localstack/services/stepfunctions/asl/component/common/assign/assign_template_value_array.py +1 -1
  25. localstack/services/stepfunctions/asl/component/common/assign/assign_template_value_object.py +1 -1
  26. localstack/services/stepfunctions/asl/component/common/error_name/states_error_name_type.py +1 -1
  27. localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_value_array.py +1 -1
  28. localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_value_object.py +1 -1
  29. localstack/services/stepfunctions/asl/component/common/path/input_path.py +1 -1
  30. localstack/services/stepfunctions/asl/component/common/path/output_path.py +1 -1
  31. localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadarr/payload_arr.py +1 -1
  32. localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadtmpl/payload_tmpl.py +1 -1
  33. localstack/services/stepfunctions/asl/component/common/string/string_expression.py +1 -1
  34. localstack/services/stepfunctions/asl/component/intrinsic/argument/argument.py +1 -1
  35. localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/array/array_partition.py +1 -1
  36. localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/generic/string_format.py +1 -1
  37. localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/states_function_array.py +1 -1
  38. localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/states_function_format.py +1 -1
  39. localstack/services/stepfunctions/asl/component/intrinsic/jsonata.py +1 -1
  40. localstack/services/stepfunctions/asl/component/program/program.py +1 -1
  41. localstack/services/stepfunctions/asl/component/program/states.py +1 -1
  42. localstack/services/stepfunctions/asl/component/state/state_execution/execute_state.py +1 -1
  43. localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/item_reader_decl.py +1 -1
  44. localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/resource_eval/resource_output_transformer/resource_output_transformer_csv.py +2 -2
  45. localstack/services/stepfunctions/asl/component/state/state_execution/state_parallel/branches_decl.py +3 -3
  46. localstack/services/stepfunctions/asl/component/state/state_execution/state_task/lambda_eval_utils.py +1 -1
  47. localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_api_gateway.py +3 -3
  48. localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_aws_sdk.py +1 -1
  49. localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_batch.py +2 -2
  50. localstack/services/stepfunctions/asl/component/state/state_execution/state_task/state_task.py +1 -1
  51. localstack/services/stepfunctions/asl/eval/environment.py +6 -6
  52. localstack/services/stepfunctions/asl/eval/event/event_manager.py +1 -1
  53. localstack/services/stepfunctions/asl/eval/states.py +1 -1
  54. localstack/services/stepfunctions/asl/eval/variable_store.py +3 -3
  55. localstack/services/stepfunctions/asl/jsonata/jsonata.py +1 -1
  56. localstack/services/stepfunctions/asl/parse/asl_parser.py +1 -1
  57. localstack/services/stepfunctions/asl/parse/intrinsic/preprocessor.py +1 -1
  58. localstack/services/stepfunctions/asl/parse/preprocessor.py +14 -14
  59. localstack/services/stepfunctions/asl/static_analyser/intrinsic/variable_names_intrinsic_static_analyser.py +1 -1
  60. localstack/services/stepfunctions/asl/static_analyser/variable_references_static_analyser.py +2 -2
  61. localstack/services/stepfunctions/backend/alias.py +2 -2
  62. localstack/services/stepfunctions/backend/execution.py +2 -2
  63. localstack/services/stepfunctions/backend/state_machine.py +2 -2
  64. localstack/services/stepfunctions/mocking/mock_config.py +4 -4
  65. localstack/services/stepfunctions/provider.py +7 -7
  66. localstack/testing/pytest/cloudformation/fixtures.py +4 -4
  67. localstack/testing/pytest/fixtures.py +2 -2
  68. localstack/testing/pytest/marking.py +1 -1
  69. localstack/testing/pytest/stepfunctions/fixtures.py +4 -4
  70. localstack/testing/pytest/stepfunctions/utils.py +6 -6
  71. localstack/utils/analytics/metrics/counter.py +3 -3
  72. localstack/utils/analytics/metrics/registry.py +1 -1
  73. localstack/utils/scheduler.py +2 -2
  74. localstack/utils/testutil.py +1 -1
  75. localstack/version.py +2 -2
  76. {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev41.dist-info}/METADATA +1 -1
  77. {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev41.dist-info}/RECORD +85 -85
  78. localstack_core-4.7.1.dev41.dist-info/plux.json +1 -0
  79. localstack_core-4.7.1.dev40.dist-info/plux.json +0 -1
  80. {localstack_core-4.7.1.dev40.data → localstack_core-4.7.1.dev41.data}/scripts/localstack +0 -0
  81. {localstack_core-4.7.1.dev40.data → localstack_core-4.7.1.dev41.data}/scripts/localstack-supervisor +0 -0
  82. {localstack_core-4.7.1.dev40.data → localstack_core-4.7.1.dev41.data}/scripts/localstack.bat +0 -0
  83. {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev41.dist-info}/WHEEL +0 -0
  84. {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev41.dist-info}/entry_points.txt +0 -0
  85. {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev41.dist-info}/licenses/LICENSE.txt +0 -0
  86. {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev41.dist-info}/top_level.txt +0 -0
@@ -41,7 +41,7 @@ class StatesFunctionFormat(StatesFunction):
41
41
  # TODO: investigate behaviour for incorrect number of arguments in string format.
42
42
  self.argument_list.eval(env=env)
43
43
 
44
- values: list[Any] = list()
44
+ values: list[Any] = []
45
45
  for _ in range(self.argument_list.size):
46
46
  values.append(env.stack.pop())
47
47
  string_format: str = values.pop()
@@ -75,7 +75,7 @@ _DECLARATION_BY_VARIABLE_REFERENCE: Final[dict[VariableReference, str]] = {
75
75
  def get_intrinsic_functions_declarations(
76
76
  variable_references: set[VariableReference],
77
77
  ) -> VariableDeclarations:
78
- declarations: list[str] = list()
78
+ declarations: list[str] = []
79
79
  for variable_reference in variable_references:
80
80
  declaration: VariableDeclarations | None = _DECLARATION_BY_VARIABLE_REFERENCE.get(
81
81
  variable_reference
@@ -111,7 +111,7 @@ class Program(EvalComponent):
111
111
  program_state: ProgramState = env.program_state()
112
112
  if isinstance(program_state, ProgramError):
113
113
  exec_failed_event_details = select_from_typed_dict(
114
- typed_dict=ExecutionFailedEventDetails, obj=program_state.error or dict()
114
+ typed_dict=ExecutionFailedEventDetails, obj=program_state.error or {}
115
115
  )
116
116
  env.event_manager.add_event(
117
117
  context=env.event_history_context,
@@ -4,4 +4,4 @@ from localstack.services.stepfunctions.asl.component.state.state import CommonSt
4
4
 
5
5
  class States(Component):
6
6
  def __init__(self):
7
- self.states: dict[str, CommonStateField] = dict()
7
+ self.states: dict[str, CommonStateField] = {}
@@ -170,7 +170,7 @@ class ExecutionState(CommonStateField, abc.ABC):
170
170
  frame: Environment = env.open_frame()
171
171
  frame.states.reset(input_value=env.states.get_input())
172
172
  frame.stack = copy.deepcopy(env.stack)
173
- execution_outputs: list[Any] = list()
173
+ execution_outputs: list[Any] = []
174
174
  execution_exceptions: list[Exception | None] = [None]
175
175
  terminated_event = threading.Event()
176
176
 
@@ -65,7 +65,7 @@ class ItemReader(EvalComponent):
65
65
  if self.parargs:
66
66
  self.parargs.eval(env=env)
67
67
  else:
68
- env.stack.append(dict())
68
+ env.stack.append({})
69
69
 
70
70
  self.resource_eval.eval_resource(env=env)
71
71
 
@@ -59,9 +59,9 @@ class ResourceOutputTransformerCSV(ResourceOutputTransformer):
59
59
  )
60
60
  raise FailureEventException(failure_event=failure_event)
61
61
 
62
- transformed_outputs = list()
62
+ transformed_outputs = []
63
63
  for row in csv_reader_slice:
64
- transformed_output = dict()
64
+ transformed_output = {}
65
65
  for i, header in enumerate(headers):
66
66
  transformed_output[header] = row[i] if i < len(row) else ""
67
67
  transformed_outputs.append(
@@ -42,7 +42,7 @@ class BranchWorkerPool(BranchWorker.BranchWorkerComm):
42
42
  end_program_state: ProgramState = env.program_state()
43
43
  if isinstance(end_program_state, ProgramError):
44
44
  self._terminated_with_error = select_from_typed_dict(
45
- typed_dict=ExecutionFailedEventDetails, obj=end_program_state.error or dict()
45
+ typed_dict=ExecutionFailedEventDetails, obj=end_program_state.error or {}
46
46
  )
47
47
  self._termination_event.set()
48
48
  else:
@@ -67,7 +67,7 @@ class BranchesDecl(EvalComponent):
67
67
 
68
68
  branch_worker_pool = BranchWorkerPool(workers_num=len(self.programs))
69
69
 
70
- branch_workers: list[BranchWorker] = list()
70
+ branch_workers: list[BranchWorker] = []
71
71
  for program in self.programs:
72
72
  # Environment frame for this sub process.
73
73
  env_frame: Environment = env.open_inner_frame()
@@ -103,7 +103,7 @@ class BranchesDecl(EvalComponent):
103
103
  )
104
104
 
105
105
  # Collect the results and return.
106
- result_list = list()
106
+ result_list = []
107
107
 
108
108
  for worker in branch_workers:
109
109
  env_frame = worker.env
@@ -90,7 +90,7 @@ def to_payload_type(payload: Any) -> bytes | None:
90
90
  return payload
91
91
 
92
92
  if payload is None:
93
- str_value = to_json_str(dict())
93
+ str_value = to_json_str({})
94
94
  elif isinstance(payload, str):
95
95
  try:
96
96
  json.loads(payload)
@@ -168,7 +168,7 @@ class StateTaskServiceApiGateway(StateTaskServiceCallback):
168
168
 
169
169
  @staticmethod
170
170
  def _headers_of(parameters: TaskParameters) -> dict | None:
171
- headers = parameters.get("Headers", dict())
171
+ headers = parameters.get("Headers", {})
172
172
  if headers:
173
173
  for key in headers.keys():
174
174
  # TODO: the following check takes place at parse time.
@@ -239,8 +239,8 @@ class StateTaskServiceApiGateway(StateTaskServiceCallback):
239
239
  response_body = response.json()
240
240
  except JSONDecodeError:
241
241
  response_body = response.text
242
- if response_body == json.dumps(dict()):
243
- response_body = dict()
242
+ if response_body == json.dumps({}):
243
+ response_body = {}
244
244
 
245
245
  # since we are not using a case-insensitive dict, and we want to remove a header, for server
246
246
  # compatibility we should consider both casing variants
@@ -132,7 +132,7 @@ class StateTaskServiceAwsSdk(StateTaskServiceCallback):
132
132
  region=resource_runtime_part.region,
133
133
  state_credentials=state_credentials,
134
134
  )
135
- response = getattr(api_client, api_action)(**normalised_parameters) or dict()
135
+ response = getattr(api_client, api_action)(**normalised_parameters) or {}
136
136
  if response:
137
137
  response.pop("ResponseMetadata", None)
138
138
  env.stack.append(response)
@@ -71,12 +71,12 @@ class StateTaskServiceBatch(StateTaskServiceCallback):
71
71
  # Attaches to the ContainerOverrides environment variables the AWS managed flags.
72
72
  container_overrides = parameters.get("ContainerOverrides")
73
73
  if container_overrides is None:
74
- container_overrides = dict()
74
+ container_overrides = {}
75
75
  parameters["ContainerOverrides"] = container_overrides
76
76
 
77
77
  environment = container_overrides.get("Environment")
78
78
  if environment is None:
79
- environment = list()
79
+ environment = []
80
80
  container_overrides["Environment"] = environment
81
81
 
82
82
  environment.append(
@@ -51,7 +51,7 @@ class StateTask(ExecutionState, abc.ABC):
51
51
 
52
52
  def _eval_parameters(self, env: Environment) -> dict:
53
53
  # Eval raw parameters.
54
- parameters = dict()
54
+ parameters = {}
55
55
  if self.parargs is not None:
56
56
  self.parargs.eval(env=env)
57
57
  parameters = env.stack.pop()
@@ -57,8 +57,8 @@ class Environment:
57
57
  _frames: Final[list[Environment]]
58
58
  _is_frame: bool = False
59
59
 
60
- heap: dict[str, Any] = dict()
61
- stack: list[Any] = list()
60
+ heap: dict[str, Any] = {}
61
+ stack: list[Any] = []
62
62
  states: Final[States]
63
63
  variable_store: Final[VariableStore]
64
64
 
@@ -91,11 +91,11 @@ class Environment:
91
91
 
92
92
  self.mock_test_case = mock_test_case
93
93
 
94
- self._frames = list()
94
+ self._frames = []
95
95
  self._is_frame = False
96
96
 
97
- self.heap = dict()
98
- self.stack = list()
97
+ self.heap = {}
98
+ self.stack = []
99
99
  self.states = States(context=context)
100
100
  self.variable_store = variable_store or VariableStore()
101
101
 
@@ -148,7 +148,7 @@ class Environment:
148
148
  )
149
149
  frame.callback_pool_manager = env.callback_pool_manager
150
150
  frame.map_run_record_pool_manager = env.map_run_record_pool_manager
151
- frame.heap = dict()
151
+ frame.heap = {}
152
152
  frame._program_state = copy.deepcopy(env._program_state)
153
153
  return frame
154
154
 
@@ -66,7 +66,7 @@ class EventManager:
66
66
  def __init__(self, cloud_watch_logging_session: CloudWatchLoggingSession | None = None):
67
67
  self._mutex = threading.Lock()
68
68
  self._event_id_gen = EventIdGenerator()
69
- self._history_event_list = list()
69
+ self._history_event_list = []
70
70
  self._cloud_watch_logging_session = cloud_watch_logging_session
71
71
 
72
72
  def add_event(
@@ -143,7 +143,7 @@ class States:
143
143
  "result": _STATES_RESULT_PREFIX,
144
144
  "errorOutput": _STATES_ERROR_OUTPUT_PREFIX,
145
145
  }
146
- sub_states = dict()
146
+ sub_states = {}
147
147
  for variable_reference in variable_references:
148
148
  if not candidate_sub_states:
149
149
  break
@@ -55,8 +55,8 @@ class VariableStore:
55
55
  _variable_declarations_cache: VariableDeclarations | None
56
56
 
57
57
  def __init__(self):
58
- self._outer_scope = dict()
59
- self._inner_scope = dict()
58
+ self._outer_scope = {}
59
+ self._inner_scope = {}
60
60
  self._declaration_tracing = set()
61
61
  self._outer_variable_declaration_cache = None
62
62
  self._variable_declarations_cache = None
@@ -73,7 +73,7 @@ class VariableStore:
73
73
 
74
74
  # TODO: add typing when this available in service init.
75
75
  def get_assigned_variables(self) -> dict[str, str]:
76
- assigned_variables: dict[str, str] = dict()
76
+ assigned_variables: dict[str, str] = {}
77
77
  for traced_declaration_identifier in self._declaration_tracing:
78
78
  traced_declaration_value = self.get(traced_declaration_identifier)
79
79
  if isinstance(traced_declaration_value, str):
@@ -145,7 +145,7 @@ def extract_jsonata_variable_references(
145
145
  def encode_jsonata_variable_declarations(
146
146
  bindings: dict[VariableReference, Any],
147
147
  ) -> VariableDeclarations:
148
- declarations_parts: list[str] = list()
148
+ declarations_parts: list[str] = []
149
149
  for variable_reference, value in bindings.items():
150
150
  if isinstance(value, str):
151
151
  value_str_lit = f'"{value}"'
@@ -15,7 +15,7 @@ class SyntaxErrorListener(ErrorListener):
15
15
 
16
16
  def __init__(self):
17
17
  super().__init__()
18
- self.errors = list()
18
+ self.errors = []
19
19
 
20
20
  def syntaxError(self, recognizer, offending_symbol, line, column, message, exception):
21
21
  log_parts = [f"line {line}:{column}"]
@@ -85,7 +85,7 @@ class Preprocessor(ASLIntrinsicParserVisitor):
85
85
  return ArgumentLiteral(definition_value=bool_val)
86
86
 
87
87
  def visitFunc_arg_list(self, ctx: ASLIntrinsicParser.Func_arg_listContext) -> ArgumentList:
88
- arguments: list[Argument] = list()
88
+ arguments: list[Argument] = []
89
89
  for child in ctx.children:
90
90
  cmp: Component | None = self.visit(child)
91
91
  if isinstance(cmp, Argument):
@@ -318,7 +318,7 @@ LOG = logging.getLogger(__name__)
318
318
 
319
319
 
320
320
  class Preprocessor(ASLParserVisitor):
321
- _query_language_per_scope: list[QueryLanguage] = list()
321
+ _query_language_per_scope: list[QueryLanguage] = []
322
322
 
323
323
  def _get_current_query_language(self) -> QueryLanguage:
324
324
  return self._query_language_per_scope[-1]
@@ -660,7 +660,7 @@ class Preprocessor(ASLParserVisitor):
660
660
  self, ctx: ASLParser.Comparison_compositeContext
661
661
  ) -> ComparisonComposite:
662
662
  choice_op: ComparisonComposite.ChoiceOp = self.visit(ctx.choice_operator())
663
- rules: list[ChoiceRule] = list()
663
+ rules: list[ChoiceRule] = []
664
664
  for child in ctx.children[1:]:
665
665
  cmp: Component | None = self.visit(child)
666
666
  if not cmp:
@@ -746,7 +746,7 @@ class Preprocessor(ASLParserVisitor):
746
746
  )
747
747
 
748
748
  def visitChoices_decl(self, ctx: ASLParser.Choices_declContext) -> ChoicesDecl:
749
- rules: list[ChoiceRule] = list()
749
+ rules: list[ChoiceRule] = []
750
750
  for child in ctx.children:
751
751
  cmp: Component | None = self.visit(child)
752
752
  if not cmp:
@@ -966,7 +966,7 @@ class Preprocessor(ASLParserVisitor):
966
966
  return CSVHeaderLocation(csv_header_location_value=value)
967
967
 
968
968
  def visitCsv_headers_decl(self, ctx: ASLParser.Csv_headers_declContext) -> CSVHeaders:
969
- csv_headers: list[str] = list()
969
+ csv_headers: list[str] = []
970
970
  for child in ctx.children[3:-1]:
971
971
  maybe_str = is_production(pt=child, rule_index=ASLParser.RULE_string_literal)
972
972
  if maybe_str is not None:
@@ -1074,7 +1074,7 @@ class Preprocessor(ASLParserVisitor):
1074
1074
  return ResultWriter(resource=resource, parargs=parargs)
1075
1075
 
1076
1076
  def visitRetry_decl(self, ctx: ASLParser.Retry_declContext) -> RetryDecl:
1077
- retriers: list[RetrierDecl] = list()
1077
+ retriers: list[RetrierDecl] = []
1078
1078
  for child in ctx.children:
1079
1079
  cmp: Component | None = self.visit(child)
1080
1080
  if isinstance(cmp, RetrierDecl):
@@ -1092,7 +1092,7 @@ class Preprocessor(ASLParserVisitor):
1092
1092
  return self.visit(ctx.children[0])
1093
1093
 
1094
1094
  def visitError_equals_decl(self, ctx: ASLParser.Error_equals_declContext) -> ErrorEqualsDecl:
1095
- error_names: list[ErrorName] = list()
1095
+ error_names: list[ErrorName] = []
1096
1096
  for child in ctx.children:
1097
1097
  cmp = self.visit(child)
1098
1098
  if isinstance(cmp, ErrorName):
@@ -1146,7 +1146,7 @@ class Preprocessor(ASLParserVisitor):
1146
1146
  return JitterStrategyDecl(jitter_strategy=jitter_strategy)
1147
1147
 
1148
1148
  def visitCatch_decl(self, ctx: ASLParser.Catch_declContext) -> CatchDecl:
1149
- catchers: list[CatcherDecl] = list()
1149
+ catchers: list[CatcherDecl] = []
1150
1150
  for child in ctx.children:
1151
1151
  cmp: Component | None = self.visit(child)
1152
1152
  if isinstance(cmp, CatcherDecl):
@@ -1208,7 +1208,7 @@ class Preprocessor(ASLParserVisitor):
1208
1208
  return PayloadBindingValue(field=string_literal.literal_value, payload_value=payload_value)
1209
1209
 
1210
1210
  def visitPayload_arr_decl(self, ctx: ASLParser.Payload_arr_declContext) -> PayloadArr:
1211
- payload_values: list[PayloadValue] = list()
1211
+ payload_values: list[PayloadValue] = []
1212
1212
  for child in ctx.children:
1213
1213
  cmp: Component | None = self.visit(child)
1214
1214
  if isinstance(cmp, PayloadValue):
@@ -1216,7 +1216,7 @@ class Preprocessor(ASLParserVisitor):
1216
1216
  return PayloadArr(payload_values=payload_values)
1217
1217
 
1218
1218
  def visitPayload_tmpl_decl(self, ctx: ASLParser.Payload_tmpl_declContext) -> PayloadTmpl:
1219
- payload_bindings: list[PayloadBinding] = list()
1219
+ payload_bindings: list[PayloadBinding] = []
1220
1220
  for child in ctx.children:
1221
1221
  cmp: Component | None = self.visit(child)
1222
1222
  if isinstance(cmp, PayloadBinding):
@@ -1312,7 +1312,7 @@ class Preprocessor(ASLParserVisitor):
1312
1312
  def visitAssign_template_value_array(
1313
1313
  self, ctx: ASLParser.Assign_template_value_arrayContext
1314
1314
  ) -> AssignTemplateValueArray:
1315
- values: list[AssignTemplateValue] = list()
1315
+ values: list[AssignTemplateValue] = []
1316
1316
  for child in ctx.children:
1317
1317
  cmp: Component | None = self.visit(child)
1318
1318
  if isinstance(cmp, AssignTemplateValue):
@@ -1322,7 +1322,7 @@ class Preprocessor(ASLParserVisitor):
1322
1322
  def visitAssign_template_value_object(
1323
1323
  self, ctx: ASLParser.Assign_template_value_objectContext
1324
1324
  ) -> AssignTemplateValueObject:
1325
- bindings: list[AssignTemplateBinding] = list()
1325
+ bindings: list[AssignTemplateBinding] = []
1326
1326
  for child in ctx.children:
1327
1327
  cmp: Component | None = self.visit(child)
1328
1328
  if isinstance(cmp, AssignTemplateBinding):
@@ -1359,7 +1359,7 @@ class Preprocessor(ASLParserVisitor):
1359
1359
  def visitAssign_decl_body(
1360
1360
  self, ctx: ASLParser.Assign_decl_bodyContext
1361
1361
  ) -> list[AssignDeclBinding]:
1362
- bindings: list[AssignDeclBinding] = list()
1362
+ bindings: list[AssignDeclBinding] = []
1363
1363
  for child in ctx.children:
1364
1364
  cmp: Component | None = self.visit(child)
1365
1365
  if isinstance(cmp, AssignDeclBinding):
@@ -1414,7 +1414,7 @@ class Preprocessor(ASLParserVisitor):
1414
1414
  def visitJsonata_template_value_array(
1415
1415
  self, ctx: ASLParser.Jsonata_template_value_arrayContext
1416
1416
  ) -> JSONataTemplateValueArray:
1417
- values: list[JSONataTemplateValue] = list()
1417
+ values: list[JSONataTemplateValue] = []
1418
1418
  for child in ctx.children:
1419
1419
  cmp: Component | None = self.visit(child)
1420
1420
  if isinstance(cmp, JSONataTemplateValue):
@@ -1424,7 +1424,7 @@ class Preprocessor(ASLParserVisitor):
1424
1424
  def visitJsonata_template_value_object(
1425
1425
  self, ctx: ASLParser.Jsonata_template_value_objectContext
1426
1426
  ) -> JSONataTemplateValueObject:
1427
- bindings: list[JSONataTemplateBinding] = list()
1427
+ bindings: list[JSONataTemplateBinding] = []
1428
1428
  for child in ctx.children:
1429
1429
  cmp: Component | None = self.visit(child)
1430
1430
  if isinstance(cmp, JSONataTemplateBinding):
@@ -16,7 +16,7 @@ class VariableNamesIntrinsicStaticAnalyser(IntrinsicStaticAnalyser):
16
16
 
17
17
  def __init__(self):
18
18
  super().__init__()
19
- self._variable_names = list()
19
+ self._variable_names = []
20
20
 
21
21
  @staticmethod
22
22
  def process_and_get(definition: str) -> VariableNameList:
@@ -30,7 +30,7 @@ class VariableReferencesStaticAnalyser(StaticAnalyser):
30
30
 
31
31
  def __init__(self):
32
32
  super().__init__()
33
- self._fringe_state_names = list()
33
+ self._fringe_state_names = []
34
34
  self._variable_references = OrderedDict()
35
35
 
36
36
  def get_variable_references(self) -> VariableReferences:
@@ -54,7 +54,7 @@ class VariableReferencesStaticAnalyser(StaticAnalyser):
54
54
 
55
55
  def _put_variable_name(self, variable_name: VariableName) -> None:
56
56
  state_name = self._fringe_state_names[-1]
57
- variable_name_list: VariableNameList = self._variable_references.get(state_name, list())
57
+ variable_name_list: VariableNameList = self._variable_references.get(state_name, [])
58
58
  if variable_name in variable_name_list:
59
59
  return
60
60
  variable_name_list.append(variable_name)
@@ -88,8 +88,8 @@ class Alias:
88
88
 
89
89
  if routing_configuration_list:
90
90
  self._routing_configuration_list = routing_configuration_list
91
- self._state_machine_version_arns = list()
92
- self._execution_probability_distribution = list()
91
+ self._state_machine_version_arns = []
92
+ self._execution_probability_distribution = []
93
93
  for routing_configuration in routing_configuration_list:
94
94
  self._state_machine_version_arns.append(
95
95
  routing_configuration["stateMachineVersionArn"]
@@ -258,7 +258,7 @@ class Execution:
258
258
 
259
259
  def to_history_output(self) -> GetExecutionHistoryOutput:
260
260
  env = self.exec_worker.env
261
- event_history: HistoryEventList = list()
261
+ event_history: HistoryEventList = []
262
262
  if env is not None:
263
263
  # The execution has not started yet.
264
264
  event_history: HistoryEventList = env.event_manager.get_event_history()
@@ -323,7 +323,7 @@ class Execution:
323
323
 
324
324
  def publish_execution_status_change_event(self):
325
325
  input_value = (
326
- dict() if not self.input_data else to_json_str(self.input_data, separators=(",", ":"))
326
+ {} if not self.input_data else to_json_str(self.input_data, separators=(",", ":"))
327
327
  )
328
328
  output_value = (
329
329
  None if self.output is None else to_json_str(self.output, separators=(",", ":"))
@@ -154,7 +154,7 @@ class TagManager:
154
154
  self._tags.pop(key, None)
155
155
 
156
156
  def to_tag_list(self) -> TagList:
157
- tag_list = list()
157
+ tag_list = []
158
158
  for key, value in self._tags.items():
159
159
  tag_list.append(Tag(key=key, value=value))
160
160
  return tag_list
@@ -191,7 +191,7 @@ class StateMachineRevision(StateMachineInstance):
191
191
  tags,
192
192
  tracing_config,
193
193
  )
194
- self.versions = dict()
194
+ self.versions = {}
195
195
  self._version_number = 0
196
196
  self.tag_manager = TagManager()
197
197
  if tags:
@@ -56,7 +56,7 @@ class StateMockedResponses:
56
56
  ):
57
57
  self.state_name = state_name
58
58
  self.mocked_response_name = mocked_response_name
59
- self.mocked_responses = list()
59
+ self.mocked_responses = []
60
60
  last_range_end: int = -1
61
61
  mocked_responses_sorted = sorted(mocked_responses, key=lambda mr: mr.range_start)
62
62
  for mocked_response in mocked_responses_sorted:
@@ -87,7 +87,7 @@ class MockTestCase:
87
87
  ):
88
88
  self.state_machine_name = state_machine_name
89
89
  self.test_case_name = test_case_name
90
- self.state_mocked_responses = dict()
90
+ self.state_mocked_responses = {}
91
91
  for state_mocked_response in state_mocked_responses_list:
92
92
  state_name = state_mocked_response.state_name
93
93
  if state_name in self.state_mocked_responses:
@@ -151,7 +151,7 @@ def _mocked_responses_from_raw(
151
151
  raise RuntimeError(
152
152
  f"No definitions for mocked response '{mocked_response_name}' in the mock configuration file."
153
153
  )
154
- mocked_responses: list[MockedResponse] = list()
154
+ mocked_responses: list[MockedResponse] = []
155
155
  for raw_response_model_range, raw_response_model in raw_response_models.items():
156
156
  mocked_response: MockedResponse = _mocked_response_from_raw(
157
157
  raw_response_model_range=raw_response_model_range, raw_response_model=raw_response_model
@@ -187,7 +187,7 @@ def _mock_test_case_from_raw(
187
187
  f"No definitions for test case '{test_case_name}' and "
188
188
  f"state machine '{state_machine_name}' in the mock configuration file."
189
189
  )
190
- state_mocked_responses_list: list[StateMockedResponses] = list()
190
+ state_mocked_responses_list: list[StateMockedResponses] = []
191
191
  for state_name, mocked_response_name in test_case.root.items():
192
192
  state_mocked_responses = _state_mocked_responses_from_raw(
193
193
  state_name=state_name,
@@ -817,7 +817,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
817
817
  state_machine_clone = copy.deepcopy(unsafe_state_machine)
818
818
 
819
819
  if input is None:
820
- input_data = dict()
820
+ input_data = {}
821
821
  else:
822
822
  try:
823
823
  input_data = json.loads(input)
@@ -906,7 +906,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
906
906
  state_machine_clone = copy.deepcopy(unsafe_state_machine)
907
907
 
908
908
  if input is None:
909
- input_data = dict()
909
+ input_data = {}
910
910
  else:
911
911
  try:
912
912
  input_data = json.loads(input)
@@ -1097,7 +1097,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
1097
1097
  if not isinstance(state_machine_revision, StateMachineRevision):
1098
1098
  raise InvalidArn(f"Invalid arn: {state_machine_arn}")
1099
1099
 
1100
- state_machine_aliases: StateMachineAliasList = list()
1100
+ state_machine_aliases: StateMachineAliasList = []
1101
1101
  valid_token_found = next_token is None
1102
1102
 
1103
1103
  for alias in state_machine_revision.aliases:
@@ -1141,7 +1141,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
1141
1141
  if not isinstance(state_machine_revision, StateMachineRevision):
1142
1142
  raise InvalidArn(f"Invalid arn: {state_machine_arn}")
1143
1143
 
1144
- state_machine_version_items = list()
1144
+ state_machine_version_items = []
1145
1145
  for version_arn in state_machine_revision.versions.values():
1146
1146
  state_machine_version = state_machines[version_arn]
1147
1147
  if isinstance(state_machine_version, StateMachineVersion):
@@ -1237,7 +1237,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
1237
1237
  if (
1238
1238
  state_machine_revision := state_machines.get(state_machine_version.source_arn)
1239
1239
  ) and isinstance(state_machine_revision, StateMachineRevision):
1240
- referencing_alias_names: list[str] = list()
1240
+ referencing_alias_names: list[str] = []
1241
1241
  for alias in state_machine_revision.aliases:
1242
1242
  if alias.is_router_for(state_machine_version_arn=state_machine_version_arn):
1243
1243
  referencing_alias_names.append(alias.name)
@@ -1635,13 +1635,13 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
1635
1635
  state_machine_type: StateMachineType = request.get("type", StateMachineType.STANDARD)
1636
1636
  definition: str = request["definition"]
1637
1637
 
1638
- static_analysers = list()
1638
+ static_analysers = []
1639
1639
  if state_machine_type == StateMachineType.STANDARD:
1640
1640
  static_analysers.append(StaticAnalyser())
1641
1641
  else:
1642
1642
  static_analysers.append(ExpressStaticAnalyser())
1643
1643
 
1644
- diagnostics: ValidateStateMachineDefinitionDiagnosticList = list()
1644
+ diagnostics: ValidateStateMachineDefinitionDiagnosticList = []
1645
1645
  try:
1646
1646
  StepFunctionsProvider._validate_definition(
1647
1647
  definition=definition, static_analysers=static_analysers
@@ -111,8 +111,8 @@ def capture_per_resource_events(
111
111
 
112
112
 
113
113
  def _normalise_describe_change_set_output(value: DescribeChangeSetOutput) -> None:
114
- value.get("Changes", list()).sort(
115
- key=lambda change: change.get("ResourceChange", dict()).get("LogicalResourceId", "")
114
+ value.get("Changes", []).sort(
115
+ key=lambda change: change.get("ResourceChange", {}).get("LogicalResourceId", "")
116
116
  )
117
117
 
118
118
 
@@ -175,7 +175,7 @@ def capture_update_process(aws_client_no_retry, cleanups, capture_per_resource_e
175
175
  cleanups.append(
176
176
  lambda: call_safe(
177
177
  aws_client_no_retry.cloudformation.delete_change_set,
178
- kwargs=dict(ChangeSetName=change_set_id),
178
+ kwargs={"ChangeSetName": change_set_id},
179
179
  )
180
180
  )
181
181
 
@@ -206,7 +206,7 @@ def capture_update_process(aws_client_no_retry, cleanups, capture_per_resource_e
206
206
  # ensure stack deletion
207
207
  cleanups.append(
208
208
  lambda: call_safe(
209
- aws_client_no_retry.cloudformation.delete_stack, kwargs=dict(StackName=stack_id)
209
+ aws_client_no_retry.cloudformation.delete_stack, kwargs={"StackName": stack_id}
210
210
  )
211
211
  )
212
212
 
@@ -2729,10 +2729,10 @@ def clean_up(
2729
2729
  if rule_name:
2730
2730
  call_safe(events_client.delete_rule, kwargs=dict(Name=rule_name, Force=True, **kwargs))
2731
2731
  if bus_name:
2732
- call_safe(events_client.delete_event_bus, kwargs=dict(Name=bus_name))
2732
+ call_safe(events_client.delete_event_bus, kwargs={"Name": bus_name})
2733
2733
  if queue_url:
2734
2734
  sqs_client = aws_client.sqs
2735
- call_safe(sqs_client.delete_queue, kwargs=dict(QueueUrl=queue_url))
2735
+ call_safe(sqs_client.delete_queue, kwargs={"QueueUrl": queue_url})
2736
2736
  if log_group_name:
2737
2737
  logs_client = aws_client.logs
2738
2738
 
@@ -91,7 +91,7 @@ def enforce_single_aws_marker(items: list[pytest.Item]):
91
91
  if "tests/aws" not in item.fspath.dirname:
92
92
  continue
93
93
 
94
- aws_markers = list()
94
+ aws_markers = []
95
95
  for mark in item.iter_markers():
96
96
  if mark.name.startswith("aws_"):
97
97
  aws_markers.append(mark.name)