diff --git a/samcli/commands/build/command.py b/samcli/commands/build/command.py index 250ba01daf..3e2f050b62 100644 --- a/samcli/commands/build/command.py +++ b/samcli/commands/build/command.py @@ -53,7 +53,7 @@ \b Supported Runtimes ------------------ - 1. Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 using PIP\n + 1. Python 3.8, 3.9, 3.10, 3.11, 3.12 using PIP\n 2. Nodejs 20.x, 18.x, 16.x, 14.x, 12.x using NPM\n 3. Ruby 3.2 using Bundler\n 4. Java 8, Java 11, Java 17, Java 21 using Gradle and Maven\n diff --git a/samcli/lib/build/constants.py b/samcli/lib/build/constants.py index 35d6ff37ac..5c8b4ebb11 100644 --- a/samcli/lib/build/constants.py +++ b/samcli/lib/build/constants.py @@ -9,11 +9,14 @@ "nodejs6.10", "nodejs8.10", "nodejs10.x", + "nodejs12.x", + "nodejs14.x", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "python2.7", "python3.6", + "python3.7", "ruby2.5", "ruby2.7", } diff --git a/samcli/lib/build/workflow_config.py b/samcli/lib/build/workflow_config.py index 51db4425da..8a1e5f23ca 100644 --- a/samcli/lib/build/workflow_config.py +++ b/samcli/lib/build/workflow_config.py @@ -85,7 +85,6 @@ def get_selector( def get_layer_subfolder(build_workflow: str) -> str: subfolders_by_runtime = { - "python3.7": "python", "python3.8": "python", "python3.9": "python", "python3.10": "python", @@ -152,7 +151,6 @@ def get_workflow_config( } selectors_by_runtime = { - "python3.7": BasicWorkflowSelector(PYTHON_PIP_CONFIG), "python3.8": BasicWorkflowSelector(PYTHON_PIP_CONFIG), "python3.9": BasicWorkflowSelector(PYTHON_PIP_CONFIG), "python3.10": BasicWorkflowSelector(PYTHON_PIP_CONFIG), diff --git a/samcli/lib/init/local_manifest.json b/samcli/lib/init/local_manifest.json index d1e7b199fa..2f706700a2 100644 --- a/samcli/lib/init/local_manifest.json +++ b/samcli/lib/init/local_manifest.json @@ -122,15 +122,5 @@ "packageType": "Zip", "useCaseName": "Hello World Example" } - ], - "python3.7": [ - { - "directory": "template/cookiecutter-aws-sam-hello-python", - "displayName": "Hello World Example", - "dependencyManager": "pip", - "appTemplate": "hello-world", - "packageType": "Zip", - "useCaseName": "Hello World Example" - } ] } \ No newline at end of file diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/README.md b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/README.md index 25099da191..ed6ed6af1f 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/README.md +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/README.md @@ -10,7 +10,6 @@ A cookiecutter template to create a Python Hello world boilerplate using [Server Generate a boilerplate template in your current project directory using the following syntax: -* **Python 3.7**: `sam init --runtime python3.7` * **Python 3.8**: `sam init --runtime python3.8` * **Python 3.9**: `sam init --runtime python3.9` diff --git a/samcli/lib/providers/sam_stack_provider.py b/samcli/lib/providers/sam_stack_provider.py index 0f9b174f95..d27ad19a8f 100644 --- a/samcli/lib/providers/sam_stack_provider.py +++ b/samcli/lib/providers/sam_stack_provider.py @@ -349,9 +349,9 @@ def normalize_resource_path(stack_file_path: str, path: str) -> str: * symlinks on Windows might not work properly. https://stackoverflow.com/questions/43333640/python-os-path-realpath-for-symlink-in-windows - For example, using Python 3.7, realpath() is a no-op (same as abspath): + For example, using Python 3.8, realpath() is a no-op (same as abspath): ``` - Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32 + Python 3.8.8 (tags/v3.8.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.symlink('some\\path', 'link1') diff --git a/samcli/lib/utils/architecture.py b/samcli/lib/utils/architecture.py index 310a429d3f..1332bbb283 100644 --- a/samcli/lib/utils/architecture.py +++ b/samcli/lib/utils/architecture.py @@ -18,7 +18,6 @@ "nodejs16.x": [ARM64, X86_64], "nodejs18.x": [ARM64, X86_64], "nodejs20.x": [ARM64, X86_64], - "python3.7": [X86_64], "python3.8": [ARM64, X86_64], "python3.9": [ARM64, X86_64], "python3.10": [ARM64, X86_64], diff --git a/samcli/local/common/runtime_template.py b/samcli/local/common/runtime_template.py index aadcebdb6c..df569fd854 100644 --- a/samcli/local/common/runtime_template.py +++ b/samcli/local/common/runtime_template.py @@ -16,7 +16,7 @@ RUNTIME_DEP_TEMPLATE_MAPPING = { "python": [ { - "runtimes": ["python3.12", "python3.11", "python3.10", "python3.9", "python3.8", "python3.7"], + "runtimes": ["python3.12", "python3.11", "python3.10", "python3.9", "python3.8"], "dependency_manager": "pip", "init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-python"), "build": True, @@ -121,7 +121,6 @@ def get_local_lambda_images_location(mapping, runtime): "python3.10", "python3.9", "python3.8", - "python3.7", # ruby runtimes in descending order "ruby3.2", ] @@ -145,7 +144,6 @@ def get_local_lambda_images_location(mapping, runtime): "python3.10": "amazon/python3.10-base", "python3.9": "amazon/python3.9-base", "python3.8": "amazon/python3.8-base", - "python3.7": "amazon/python3.7-base", "ruby3.2": "amazon/ruby3.2-base", } @@ -160,7 +158,6 @@ def get_local_lambda_images_location(mapping, runtime): "java11": "Java8", "java17": "Java8", "java21": "Java8", - "python3.7": "Python36", "python3.8": "Python36", "python3.9": "Python36", "python3.10": "Python36", diff --git a/samcli/local/docker/lambda_debug_settings.py b/samcli/local/docker/lambda_debug_settings.py index 44ce87c2e1..b98906c8aa 100644 --- a/samcli/local/docker/lambda_debug_settings.py +++ b/samcli/local/docker/lambda_debug_settings.py @@ -159,10 +159,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime **_container_env_vars, }, ), - Runtime.python37.value: lambda: DebugSettings( - entry + ["/var/lang/bin/python3.7"] + debug_args_list + ["/var/runtime/bootstrap"], - container_env_vars=_container_env_vars, - ), Runtime.python38.value: lambda: DebugSettings( entry + ["/var/lang/bin/python3.8"] + debug_args_list + ["/var/runtime/bootstrap.py"], container_env_vars=_container_env_vars, diff --git a/samcli/local/docker/lambda_image.py b/samcli/local/docker/lambda_image.py index 8500872989..100108a297 100644 --- a/samcli/local/docker/lambda_image.py +++ b/samcli/local/docker/lambda_image.py @@ -36,7 +36,6 @@ class Runtime(Enum): nodejs16x = "nodejs16.x" nodejs18x = "nodejs18.x" nodejs20x = "nodejs20.x" - python37 = "python3.7" python38 = "python3.8" python39 = "python3.9" python310 = "python3.10" @@ -79,7 +78,7 @@ def get_image_name_tag(cls, runtime: str, architecture: str) -> str: Returns ------- str - Image name and tag for the runtime's base image, like `python:3.7` or `provided:al2` + Image name and tag for the runtime's base image, like `python:3.12` or `provided:al2` """ runtime_image_tag = "" if runtime == cls.provided.value: @@ -166,7 +165,7 @@ def build(self, runtime, packagetype, image, layers, architecture, stream=None, if self.invoke_images: base_image = self.invoke_images.get(function_name, self.invoke_images.get(None)) if not base_image: - # Gets the ECR image format like `python:3.7` or `nodejs:16-x86_64` + # Gets the ECR image format like `python:3.12` or `nodejs:16-x86_64` runtime_only_number = re.split("[:-]", runtime_image_tag)[1] tag_prefix = f"{runtime_only_number}-" base_image = f"{self._INVOKE_REPO_PREFIX}/{runtime_image_tag}" @@ -262,7 +261,7 @@ def _generate_docker_image_version(layers, runtime_image_tag): List of the layers runtime_image_tag str - Runtime version format to generate image name and tag (including architecture, e.g. "python:3.7-x86_64") + Runtime version format to generate image name and tag (including architecture, e.g. "python:3.12-x86_64") Returns ------- diff --git a/schema/samcli.json b/schema/samcli.json index b9a5560b9d..96e1c6b5ed 100644 --- a/schema/samcli.json +++ b/schema/samcli.json @@ -23,7 +23,7 @@ "properties": { "parameters": { "title": "Parameters for the init command", - "description": "Available parameters for the init command:\n* no_interactive:\nDisable interactive prompting for init parameters. (fail if any required values are missing)\n* architecture:\nArchitectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']\n* location:\nTemplate location (git, mercurial, http(s), zip, path).\n* runtime:\nLambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2\n* package_type:\nLambda deployment package type.\n\nPackage Types: Zip, Image\n* base_image:\nLambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base\n* dependency_manager:\nDependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip\n* output_dir:\nDirectory to initialize AWS SAM application.\n* name:\nName of AWS SAM Application.\n* app_template:\nIdentifier of the managed application template to be used. Alternatively, run '$sam init' without options for an interactive workflow.\n* no_input:\nDisable Cookiecutter prompting and accept default values defined in the cookiecutter config.\n* extra_context:\nOverride custom parameters in the template's cookiecutter.json configuration e.g. {\"customParam1\": \"customValue1\", \"customParam2\":\"customValue2\"}\n* tracing:\nEnable AWS X-Ray tracing for application.\n* application_insights:\nEnable CloudWatch Application Insights monitoring for application.\n* structured_logging:\nEnable Structured Logging for application.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* save_params:\nSave the parameters provided via the command line to the configuration file.", + "description": "Available parameters for the init command:\n* no_interactive:\nDisable interactive prompting for init parameters. (fail if any required values are missing)\n* architecture:\nArchitectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']\n* location:\nTemplate location (git, mercurial, http(s), zip, path).\n* runtime:\nLambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.12, python3.11, python3.10, ruby3.2\n* package_type:\nLambda deployment package type.\n\nPackage Types: Zip, Image\n* base_image:\nLambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base\n* dependency_manager:\nDependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip\n* output_dir:\nDirectory to initialize AWS SAM application.\n* name:\nName of AWS SAM Application.\n* app_template:\nIdentifier of the managed application template to be used. Alternatively, run '$sam init' without options for an interactive workflow.\n* no_input:\nDisable Cookiecutter prompting and accept default values defined in the cookiecutter config.\n* extra_context:\nOverride custom parameters in the template's cookiecutter.json configuration e.g. {\"customParam1\": \"customValue1\", \"customParam2\":\"customValue2\"}\n* tracing:\nEnable AWS X-Ray tracing for application.\n* application_insights:\nEnable CloudWatch Application Insights monitoring for application.\n* structured_logging:\nEnable Structured Logging for application.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* save_params:\nSave the parameters provided via the command line to the configuration file.", "type": "object", "properties": { "no_interactive": { @@ -48,7 +48,7 @@ "runtime": { "title": "runtime", "type": "string", - "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2", + "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.12, python3.11, python3.10, ruby3.2", "enum": [ "dotnet6", "go1.x", @@ -66,7 +66,6 @@ "python3.10", "python3.11", "python3.12", - "python3.7", "python3.8", "python3.9", "ruby3.2" @@ -84,7 +83,7 @@ "base_image": { "title": "base_image", "type": "string", - "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base", + "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base", "enum": [ "amazon/dotnet6-base", "amazon/go-provided.al2-base", @@ -101,7 +100,6 @@ "amazon/python3.10-base", "amazon/python3.11-base", "amazon/python3.12-base", - "amazon/python3.7-base", "amazon/python3.8-base", "amazon/python3.9-base", "amazon/ruby3.2-base" diff --git a/tests/end_to_end/test_runtimes_e2e.py b/tests/end_to_end/test_runtimes_e2e.py index 84670913b5..bd342b8ca3 100644 --- a/tests/end_to_end/test_runtimes_e2e.py +++ b/tests/end_to_end/test_runtimes_e2e.py @@ -70,7 +70,7 @@ def validate(self, command_result: CommandResult): ("runtime", "dependency_manager"), [ ("go1.x", "mod"), - ("python3.7", "pip"), + ("python3.11", "pip"), ], ) class TestHelloWorldDefaultEndToEnd(EndToEndBase): @@ -104,7 +104,7 @@ def test_hello_world_default_workflow(self): ("runtime", "dependency_manager"), [ ("go1.x", "mod"), - ("python3.7", "pip"), + ("python3.11", "pip"), ], ) class TestHelloWorldZipPackagePermissionsEndToEnd(EndToEndBase): @@ -142,7 +142,7 @@ def test_hello_world_workflow(self): ("runtime", "dependency_manager"), [ ("go1.x", "mod"), - ("python3.7", "pip"), + ("python3.11", "pip"), ], ) class TestHelloWorldDefaultSyncEndToEnd(EndToEndBase): diff --git a/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml b/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml index 41ae90f481..603ea78b92 100644 --- a/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_any_method_in_swagger.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: SimpleCase: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml index 230311846b..9eb395992d 100644 --- a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint.yaml @@ -15,7 +15,7 @@ Resources: Method: get RestApiId: Ref: ApiGatewayApi - Runtime: python3.7 + Runtime: python3.11 Handler: index.handler InlineCode: |- def handler(event, context): diff --git a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml index 8d4d18a9ba..1bfe761c87 100644 --- a/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_disable_api_execute_endpoint_openapi_3.yaml @@ -16,7 +16,7 @@ Resources: Method: get RestApiId: Ref: ApiGatewayApi - Runtime: python3.7 + Runtime: python3.11 Handler: index.handler InlineCode: |- def handler(event, context): diff --git a/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml b/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml index 354eeaf761..87339ec1d3 100644 --- a/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml +++ b/tests/functional/commands/validate/lib/models/api_with_fail_on_warnings.yaml @@ -15,7 +15,7 @@ Resources: Method: get RestApiId: Ref: ApiGatewayApi - Runtime: python3.7 + Runtime: python3.11 Handler: index.handler InlineCode: | def handler(event, context): diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api.yaml index 4cc0011f1b..d9cfe8b34d 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: SimpleCase: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml index ad44d20d14..b8e57b5ed5 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api_default_path.yaml @@ -5,7 +5,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: HttpApiANYdefault: Type: HttpApi @@ -18,7 +18,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: HttpApiANYhello: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml index 7c69c7a573..100b775cab 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api_minimum.yaml @@ -6,7 +6,7 @@ Resources: Properties: Handler: index.handler CodeUri: s3://bucket/key - Runtime: python3.7 + Runtime: python3.11 Events: Api: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml b/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml index e4b15ff100..c09c9549f0 100644 --- a/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml +++ b/tests/functional/commands/validate/lib/models/explicit_http_api_with_name.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: SimpleCase: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/function_string_memorysize.yaml b/tests/functional/commands/validate/lib/models/function_string_memorysize.yaml index f9ee1a5060..6d519e1f75 100644 --- a/tests/functional/commands/validate/lib/models/function_string_memorysize.yaml +++ b/tests/functional/commands/validate/lib/models/function_string_memorysize.yaml @@ -4,5 +4,5 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler - Runtime: python3.7 + Runtime: python3.11 MemorySize: '700' diff --git a/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml b/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml index d8efbc4b45..b66da71137 100644 --- a/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_disabled_traffic_hook.yaml @@ -11,7 +11,7 @@ Resources: Handler: lambda.lambda_handler Role: Fn::Sub: arn:${AWS::Partition}:iam::${AWS::AccountId}:role/lambda-role - Runtime: python3.7 + Runtime: python3.11 CodeUri: s3://bucket/key AutoPublishAlias: live DeploymentPreference: @@ -34,7 +34,7 @@ Resources: Handler: hook.lambda_handler Role: Fn::Sub: arn:${AWS::Partition}:iam::${AWS::AccountId}:role/lambda-role - Runtime: python3.7 + Runtime: python3.11 CodeUri: s3://bucket/key FunctionName: CodeDeployHook_preTrafficHook AutoPublishAlias: live diff --git a/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml b/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml index 2f5cd975c4..958b615d32 100644 --- a/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_globals_role_path.yaml @@ -16,5 +16,5 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.world - Runtime: python3.7 + Runtime: python3.11 RolePath: /foo/bar diff --git a/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml b/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml index 9e19111464..9aa7311d5c 100644 --- a/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_custom_iam_auth.yaml @@ -6,7 +6,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: HelloAWSIAMAuth: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml b/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml index 42902c2748..eed170957a 100644 --- a/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_def_uri.yaml @@ -23,7 +23,7 @@ Resources: Function: Type: AWS::Serverless::Function Properties: - Runtime: python3.7 + Runtime: python3.11 Handler: index.handler CodeUri: s3://bucket/key Events: diff --git a/tests/functional/commands/validate/lib/models/http_api_description.yaml b/tests/functional/commands/validate/lib/models/http_api_description.yaml index 6497698da1..c821363c3a 100644 --- a/tests/functional/commands/validate/lib/models/http_api_description.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_description.yaml @@ -11,7 +11,7 @@ Resources: Function: Type: AWS::Serverless::Function Properties: - Runtime: python3.7 + Runtime: python3.11 Handler: index.handler CodeUri: s3://bucket/key Events: diff --git a/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml b/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml index 8eef0385c0..8b3c793fc4 100644 --- a/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_existing_openapi_conditions.yaml @@ -10,7 +10,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: Basic: # integration exists Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml b/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml index 84092f5eea..2cfc36a657 100644 --- a/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_global_iam_auth_enabled.yaml @@ -8,7 +8,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: # The following events use the implicit AWS::Serverless::HttpApi called "ServerlessHttpApi". # The Iam Authorizer of the implicit AWS::Serverless::HttpApi is enabled using the global above. diff --git a/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml b/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml index 4e3b0c74dd..96d1e418ad 100644 --- a/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_lambda_auth.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: Basic: # integration exists Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml b/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml index da9f9640ed..accb7d6792 100644 --- a/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_lambda_auth_full.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: Basic: # integration exists Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_lambda_auth_with_permissions_resource.yaml b/tests/functional/commands/validate/lib/models/http_api_lambda_auth_with_permissions_resource.yaml index 463b09d869..c269f5a92e 100644 --- a/tests/functional/commands/validate/lib/models/http_api_lambda_auth_with_permissions_resource.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_lambda_auth_with_permissions_resource.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: Basic: Type: HttpApi diff --git a/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml b/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml index 1daba52881..1b0a1cdfe2 100644 --- a/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_local_iam_auth_enabled.yaml @@ -8,7 +8,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: # The following events use the defined AWS::Serverless::HttpApi, MyDefaultIamAuthHttpApi, further down. # This HttpApi has Iam auth enabled AND set as the default. diff --git a/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml b/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml index f52183c53e..5d4df43909 100644 --- a/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml +++ b/tests/functional/commands/validate/lib/models/http_api_multiple_authorizers.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi - Runtime: python3.7 + Runtime: python3.11 Events: HelloGet: Type: HttpApi diff --git a/tests/integration/buildcmd/test_build_cmd.py b/tests/integration/buildcmd/test_build_cmd.py index d86d5642a6..527fd76e93 100644 --- a/tests/integration/buildcmd/test_build_cmd.py +++ b/tests/integration/buildcmd/test_build_cmd.py @@ -99,8 +99,10 @@ class TestBuildCommand_PythonFunctions_Images(BuildIntegBase): FUNCTION_LOGICAL_ID_IMAGE = "ImageFunction" - @parameterized.expand([("3.7", False), ("3.8", False), ("3.9", False)]) + @parameterized.expand([("3.8", False), ("3.9", False), ("3.10", False), ("3.11", False), ("3.12", False)]) def test_with_default_requirements(self, runtime, use_container): + if IS_WINDOWS and not runtime_supported_by_docker(f"python{runtime}"): + self.skipTest(RUNTIME_NOT_SUPPORTED_BY_DOCKER_MSG) _tag = uuid4().hex overrides = { "Runtime": runtime, @@ -125,7 +127,15 @@ def test_with_default_requirements(self, runtime, use_container): self.built_template, self.FUNCTION_LOGICAL_ID_IMAGE, self._make_parameter_override_arg(overrides), expected ) - @parameterized.expand([("3.7", False), ("3.8", False), ("3.9", False)]) + @parameterized.expand( + [ + ("3.8", False), + ("3.9", False), + ("3.10", False), + ("3.11", False), + ("3.12", False), + ] + ) def test_with_dockerfile_extension(self, runtime, use_container): _tag = uuid4().hex overrides = { @@ -198,11 +208,16 @@ class TestBuildCommand_PythonFunctions_ImagesWithSharedCode(BuildIntegBase): @parameterized.expand( [ - *[(runtime, "feature_phi/Dockerfile", {"phi": "1.62"}) for runtime in ["3.7", "3.8", "3.9"]], - *[(runtime, "feature_pi/Dockerfile", {"pi": "3.14"}) for runtime in ["3.7", "3.8", "3.9"]], + *[ + (runtime, "feature_phi/Dockerfile", {"phi": "1.62"}) + for runtime in ["3.8", "3.9", "3.10", "3.11", "3.12"] + ], + *[(runtime, "feature_pi/Dockerfile", {"pi": "3.14"}) for runtime in ["3.8", "3.9", "3.10", "3.11", "3.12"]], ] ) def test_with_default_requirements(self, runtime, dockerfile, expected): + if IS_WINDOWS and not runtime_supported_by_docker(f"python{runtime}"): + self.skipTest(RUNTIME_NOT_SUPPORTED_BY_DOCKER_MSG) _tag = uuid4().hex overrides = { "Runtime": runtime, @@ -311,7 +326,7 @@ class TestSkipBuildingFunctionsWithLocalImageUri(BuildIntegBase): FUNCTION_LOGICAL_ID_IMAGE = "ImageFunction" - @parameterized.expand(["3.7", "3.8", "3.9"]) + @parameterized.expand(["3.8", "3.9", "3.10", "3.11", "3.12"]) def test_with_default_requirements(self, runtime): _tag = uuid4().hex image_uri = f"func:{_tag}" @@ -450,14 +465,16 @@ def _validate_skipped_built_function( "prop", ), [ - ("template.yaml", "Function", True, "python3.7", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.8", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.9", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.10", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.11", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.12", "Python", False, "CodeUri"), - ("template.yaml", "Function", True, "python3.7", "PythonPEP600", False, "CodeUri"), ("template.yaml", "Function", True, "python3.8", "PythonPEP600", False, "CodeUri"), + ("template.yaml", "Function", True, "python3.9", "PythonPEP600", False, "CodeUri"), + ("template.yaml", "Function", True, "python3.10", "PythonPEP600", False, "CodeUri"), + ("template.yaml", "Function", True, "python3.11", "PythonPEP600", False, "CodeUri"), + ("template.yaml", "Function", True, "python3.12", "PythonPEP600", False, "CodeUri"), ], ) class TestBuildCommand_PythonFunctions_WithoutDocker(BuildIntegPythonBase): @@ -490,7 +507,6 @@ def test_with_default_requirements(self): "prop", ), [ - ("template.yaml", "Function", True, "python3.7", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.8", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.9", "Python", False, "CodeUri"), ("template.yaml", "Function", True, "python3.10", "Python", False, "CodeUri"), @@ -606,20 +622,16 @@ class TestBuildCommand_PythonFunctions_With_Specified_Architecture(BuildIntegPyt @parameterized.expand( [ - ("python3.7", "Python", False, "x86_64"), ("python3.8", "Python", False, "x86_64"), ("python3.9", "Python", False, "x86_64"), ("python3.10", "Python", False, "x86_64"), ("python3.11", "Python", False, "x86_64"), ("python3.12", "Python", False, "x86_64"), - # numpy 1.20.3 (in PythonPEP600/requirements.txt) only support python 3.7+ - ("python3.7", "PythonPEP600", False, "x86_64"), ("python3.8", "PythonPEP600", False, "x86_64"), ("python3.9", "PythonPEP600", False, "x86_64"), ("python3.10", "PythonPEP600", False, "x86_64"), ("python3.11", "PythonPEP600", False, "x86_64"), ("python3.12", "PythonPEP600", False, "x86_64"), - ("python3.7", "Python", "use_container", "x86_64"), ("python3.8", "Python", "use_container", "x86_64"), ("python3.9", "Python", "use_container", "x86_64"), ("python3.10", "Python", "use_container", "x86_64"), @@ -1480,7 +1492,7 @@ class TestBuildCommand_SingleFunctionBuilds(BuildIntegBase): } def test_function_not_found(self): - overrides = {"Runtime": "python3.7", "CodeUri": "Python", "Handler": "main.handler"} + overrides = {"Runtime": "python3.11", "CodeUri": "Python", "Handler": "main.handler"} cmdlist = self.get_command_list(parameter_overrides=overrides, function_identifier="FunctionNotInTemplate") process_execute = run_command(cmdlist, cwd=self.working_dir) @@ -1490,10 +1502,10 @@ def test_function_not_found(self): @parameterized.expand( [ - ("python3.7", False, "FunctionOne"), - ("python3.7", "use_container", "FunctionOne"), - ("python3.7", False, "FunctionTwo"), - ("python3.7", "use_container", "FunctionTwo"), + ("python3.11", False, "FunctionOne"), + ("python3.11", "use_container", "FunctionOne"), + ("python3.11", False, "FunctionTwo"), + ("python3.11", "use_container", "FunctionTwo"), ] ) def test_build_single_function(self, runtime, use_container, function_identifier): @@ -1559,7 +1571,7 @@ class TestBuildCommand_ExcludeResources(BuildIntegBase): ] ) def test_build_without_resources(self, excluded_resources, function_identifier): - overrides = {"Runtime": "python3.7", "CodeUri": "Python", "Handler": "main.handler"} + overrides = {"Runtime": "python3.12", "CodeUri": "Python", "Handler": "main.handler"} cmdlist = self.get_command_list( parameter_overrides=overrides, function_identifier=function_identifier, exclude=excluded_resources ) @@ -1595,10 +1607,10 @@ class TestBuildCommand_LayerBuilds(BuildIntegBase): @parameterized.expand( [ - ("python3.7", False, "LayerOne", "ContentUri"), - ("python3.7", "use_container", "LayerOne", "ContentUri"), - ("python3.7", False, "LambdaLayerOne", "Content"), - ("python3.7", "use_container", "LambdaLayerOne", "Content"), + ("python3.12", False, "LayerOne", "ContentUri"), + ("python3.12", "use_container", "LayerOne", "ContentUri"), + ("python3.12", False, "LambdaLayerOne", "Content"), + ("python3.12", "use_container", "LambdaLayerOne", "Content"), ] ) def test_build_single_layer(self, runtime, use_container, layer_identifier, content_property): @@ -1775,7 +1787,7 @@ def test_build_layer_with_makefile_with_fake_build_architecture(self): # Build should still succeed self.assertEqual(command_result.process.returncode, 0) - @parameterized.expand([("python3.7", False, "LayerTwo"), ("python3.7", "use_container", "LayerTwo")]) + @parameterized.expand([("python3.12", False, "LayerTwo"), ("python3.12", "use_container", "LayerTwo")]) def test_build_fails_with_missing_metadata(self, runtime, use_container, layer_identifier): if use_container and (SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD): self.skipTest(SKIP_DOCKER_MESSAGE) @@ -1803,7 +1815,7 @@ def test_function_build_succeeds_with_referenced_layer(self, use_container): command_result = run_command(cmdlist, cwd=self.working_dir) self.assertEqual(command_result.process.returncode, 0) - @parameterized.expand([("python3.7", False), ("python3.7", "use_container")]) + @parameterized.expand([("python3.12", False), ("python3.12", "use_container")]) def test_build_function_and_layer(self, runtime, use_container): if use_container and (SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD): self.skipTest(SKIP_DOCKER_MESSAGE) @@ -1838,7 +1850,7 @@ def test_build_function_and_layer(self, runtime, use_container): self.verify_docker_container_cleanedup(runtime) self.verify_pulled_image(runtime) - @parameterized.expand([("python3.7", False), ("python3.7", "use_container")]) + @parameterized.expand([("python3.12", False), ("python3.12", "use_container")]) def test_build_function_with_dependent_layer(self, runtime, use_container): if use_container and (SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD): self.skipTest(SKIP_DOCKER_MESSAGE) @@ -2179,7 +2191,7 @@ def test_dedup_build(self): overrides = { "Function1Handler": "main.first_function_handler", "Function2Handler": "main.second_function_handler", - "FunctionRuntime": "3.7", + "FunctionRuntime": "3.11", "DockerFile": "Dockerfile", "Tag": f"{random.randint(1,100)}", } @@ -2366,10 +2378,10 @@ def test_repeated_cached_build_hits_cache(self, use_container): parameter_overrides = { "LayerContentUri": "PyLayer", - "LayerBuildMethod": "python3.7", + "LayerBuildMethod": "python3.12", "CodeUri": "Python", "Handler": "main.handler", - "Runtime": "python3.7", + "Runtime": "python3.12", "LayerMakeContentUri": "PyLayerMake", } @@ -2518,8 +2530,8 @@ def test_inline_not_built(self, use_container): self._verify_built_artifact(self.default_build_dir) if use_container: - self.verify_docker_container_cleanedup("python3.7") - self.verify_pulled_image("python3.7") + self.verify_docker_container_cleanedup("python3.12") + self.verify_pulled_image("python3.12") def _verify_built_artifact(self, build_dir): self.assertTrue(build_dir.exists(), "Build directory should be created") @@ -2567,8 +2579,8 @@ def test_json_env_vars_passed(self, use_container, env_vars_file): self._verify_built_env_var(self.default_build_dir) if use_container: - self.verify_docker_container_cleanedup("python3.7") - self.verify_pulled_image("python3.7") + self.verify_docker_container_cleanedup("python3.12") + self.verify_pulled_image("python3.12") @staticmethod def get_env_file(filename): @@ -2615,8 +2627,8 @@ def test_inline_env_vars_passed(self, use_container, inline_env_var): self._verify_built_env_var(self.default_build_dir) if use_container: - self.verify_docker_container_cleanedup("python3.7") - self.verify_pulled_image("python3.7") + self.verify_docker_container_cleanedup("python3.12") + self.verify_pulled_image("python3.12") def _verify_built_env_var(self, build_dir): self.assertTrue(build_dir.exists(), "Build directory should be created") @@ -2665,7 +2677,7 @@ def test_nested_build(self, use_container, cached, parallel): Build template above and verify that each function call returns as expected """ overrides = { - "Runtime": "python3.7", + "Runtime": "python3.11", "CodeUri": "../Python", # root stack is one level deeper than the code "ChildStackCodeUri": "./Python", # chidl stack is in the same folder as the code "LocalNestedFuncHandler": "main.handler", @@ -2880,7 +2892,7 @@ def test_nested_build(self, use_container, cached, parallel): Build template above and verify that each function call returns as expected """ overrides = { - "Runtime": "3.7", + "Runtime": "3.11", "DockerFile": "Dockerfile", "Tag": f"{random.randint(1,100)}", "LocalNestedFuncHandler": "main.handler", @@ -2932,7 +2944,7 @@ class TestBuildWithCustomBuildImage(BuildIntegBase): @parameterized.expand( [ ("use_container", None), - ("use_container", "amazon/aws-sam-cli-build-image-python3.7:latest"), + ("use_container", "public.ecr.aws/sam/build-python3.11:latest-x86_64"), ] ) def test_custom_build_image_succeeds(self, use_container, build_image): @@ -2949,10 +2961,10 @@ def test_custom_build_image_succeeds(self, use_container, build_image): self._verify_right_image_pulled(build_image, process_stderr) self._verify_build_succeeds(self.default_build_dir) - self.verify_docker_container_cleanedup("python3.7") + self.verify_docker_container_cleanedup("python3.12") def _verify_right_image_pulled(self, build_image, process_stderr): - image_name = build_image if build_image is not None else "public.ecr.aws/sam/build-python3.7:latest" + image_name = build_image if build_image is not None else "public.ecr.aws/sam/build-python3.11:latest-x86_64" processed_name = bytes(image_name, encoding="utf-8") self.assertIn( processed_name, diff --git a/tests/integration/local/invoke/test_integrations_cli.py b/tests/integration/local/invoke/test_integrations_cli.py index 3c33a25cea..43dd385c1a 100644 --- a/tests/integration/local/invoke/test_integrations_cli.py +++ b/tests/integration/local/invoke/test_integrations_cli.py @@ -31,7 +31,7 @@ (Path("nested-templates/template-parent.yaml"),), ], ) -class TestSamPython37HelloWorldIntegration(InvokeIntegBase): +class TestSamPythonHelloWorldIntegration(InvokeIntegBase): @pytest.mark.flaky(reruns=3) def test_invoke_returncode_is_zero(self): command_list = InvokeIntegBase.get_command_list( @@ -242,7 +242,7 @@ def test_invoke_with_invoke_image_provided(self): "HelloWorldServerlessFunction", template_path=self.template_path, event_path=self.event_path, - invoke_image="amazon/aws-sam-cli-emulation-image-python3.7", + invoke_image="public.ecr.aws/lambda/python:3.11-x86_64", ) process = Popen(command_list, stdout=PIPE) @@ -479,7 +479,7 @@ def test_sam_template_file_env_var_set(self): @pytest.mark.flaky(reruns=3) @pytest.mark.timeout(timeout=TIMEOUT, method="thread") def test_skip_pull_image_in_env_var(self): - docker.from_env().api.pull("lambci/lambda:python3.7") + docker.from_env().api.pull("public.ecr.aws/lambda/python:3.11-x86_64") command_list = InvokeIntegBase.get_command_list( "HelloWorldLambdaFunction", template_path=self.template_path, event_path=self.event_path diff --git a/tests/integration/local/start_api/test_start_api.py b/tests/integration/local/start_api/test_start_api.py index 8381087313..0c5f5e1cd5 100644 --- a/tests/integration/local/start_api/test_start_api.py +++ b/tests/integration/local/start_api/test_start_api.py @@ -2478,7 +2478,7 @@ class TestWatchingTemplateChangesLambdaFunctionCodeUriChanged(WritableStartApiIn Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -2496,7 +2496,7 @@ class TestWatchingTemplateChangesLambdaFunctionCodeUriChanged(WritableStartApiIn Type: AWS::Serverless::Function Properties: Handler: main2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: dir Timeout: 600 Events: @@ -2576,7 +2576,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.EAGER.value build_before_invoke = True @@ -2668,7 +2668,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.EAGER.value build_before_invoke = True @@ -2783,7 +2783,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.LAZY.value build_before_invoke = True @@ -2884,7 +2884,7 @@ class TestWatchingTemplateChangesLambdaFunctionCodeUriChangedLazyContainers(Writ Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -2902,7 +2902,7 @@ class TestWatchingTemplateChangesLambdaFunctionCodeUriChangedLazyContainers(Writ Type: AWS::Serverless::Function Properties: Handler: main2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: dir Timeout: 600 Events: @@ -3010,7 +3010,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.LAZY.value build_before_invoke = True diff --git a/tests/integration/local/start_lambda/test_start_lambda.py b/tests/integration/local/start_lambda/test_start_lambda.py index fcf740a4d5..b3d194cd2c 100644 --- a/tests/integration/local/start_lambda/test_start_lambda.py +++ b/tests/integration/local/start_lambda/test_start_lambda.py @@ -260,19 +260,8 @@ def test_lambda_function_raised_error(self, use_full_path): ) response_data = json.loads(response.get("Payload").read().decode("utf-8")) - print(response_data) - - self.assertEqual( - response_data, - { - "errorMessage": "Lambda is raising an exception", - "errorType": "Exception", - "stackTrace": [ - ' File "/var/task/main.py", line 51, in raise_exception\n raise Exception("Lambda is raising an exception")\n' - ], - }, - ) - self.assertEqual(response.get("FunctionError"), "Unhandled") + self.assertEqual(response_data.get("errorMessage"), "Lambda is raising an exception") + self.assertEqual(response_data.get("errorType"), "Exception") self.assertEqual(response.get("StatusCode"), 200) @parameterized.expand([("False"), ("True")]) @@ -661,7 +650,7 @@ class TestWatchingTemplateChangesNewLambdaFunctionAdded(WatchWarmContainersInteg Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -674,7 +663,7 @@ class TestWatchingTemplateChangesNewLambdaFunctionAdded(WatchWarmContainersInteg Type: AWS::Serverless::Function Properties: Handler: main.handler2 - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -764,7 +753,7 @@ class TestWatchingTemplateChangesLambdaFunctionRemoved(WatchWarmContainersIntegB Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -777,7 +766,7 @@ class TestWatchingTemplateChangesLambdaFunctionRemoved(WatchWarmContainersIntegB Type: AWS::Serverless::Function Properties: Handler: main.handler2 - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -867,7 +856,7 @@ class TestWatchingTemplateChangesLambdaFunctionChangeCodeUri(WatchWarmContainers Type: AWS::Serverless::Function Properties: Handler: main2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: dir Timeout: 600 Events: @@ -962,7 +951,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.EAGER.value build_before_invoke = True @@ -1068,7 +1057,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.EAGER.value build_before_invoke = True @@ -1211,7 +1200,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.LAZY.value build_before_invoke = True @@ -1277,7 +1266,7 @@ class TestWatchingTemplateChangesNewLambdaFunctionAddedLazyContainer(WatchWarmCo Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -1290,7 +1279,7 @@ class TestWatchingTemplateChangesNewLambdaFunctionAddedLazyContainer(WatchWarmCo Type: AWS::Serverless::Function Properties: Handler: main.handler2 - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -1380,7 +1369,7 @@ class TestWatchingTemplateChangesLambdaFunctionRemovedLazyContainers(WatchWarmCo Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -1393,7 +1382,7 @@ class TestWatchingTemplateChangesLambdaFunctionRemovedLazyContainers(WatchWarmCo Type: AWS::Serverless::Function Properties: Handler: main.handler2 - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -1483,7 +1472,7 @@ class TestWatchingTemplateChangesLambdaFunctionChangeCodeUriLazyContainer(WatchW Type: AWS::Serverless::Function Properties: Handler: main2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: dir Timeout: 600 Events: @@ -1606,7 +1595,7 @@ def handler(event, context): def handler(event, context): return {"statusCode": 200, "body": json.dumps({"hello": "world2"})}""" - docker_file_content = """FROM public.ecr.aws/lambda/python:3.7 + docker_file_content = """FROM public.ecr.aws/lambda/python:3.11 COPY main.py ./""" container_mode = ContainersInitializationMode.LAZY.value build_before_invoke = True diff --git a/tests/integration/package/package_integ_base.py b/tests/integration/package/package_integ_base.py index 980f36856e..2f373812f9 100644 --- a/tests/integration/package/package_integ_base.py +++ b/tests/integration/package/package_integ_base.py @@ -25,8 +25,8 @@ def setUpClass(cls): Our integration tests use S3 bucket and ECR Repo to run several tests. Given that S3 objects are eventually consistent and we are using same bucket for lot of integration tests, we want to have multiple buckets to reduce - transient failures. In order to achieve this we created 3 buckets one for each python version we support (3.7, - 3.8 and 3.9). Tests running for respective python version will use respective bucket. + transient failures. In order to achieve this we created 3 buckets one for each python version we support (3.8, + and 3.9). Tests running for respective python version will use respective bucket. AWS_S3 will point to a new environment variable AWS_S3_36 or AWS_S3_37 or AWS_S3_38. This is controlled by Appveyor. These environment variables will hold bucket name to run integration tests. Eg: diff --git a/tests/integration/sync/sync_integ_base.py b/tests/integration/sync/sync_integ_base.py index 7797bf11c7..95a3932da0 100644 --- a/tests/integration/sync/sync_integ_base.py +++ b/tests/integration/sync/sync_integ_base.py @@ -36,9 +36,7 @@ def setUpClass(cls) -> None: original_test_data_path = Path(__file__).resolve().parents[1].joinpath("testdata", "sync") cls.test_data_path = Path(tempfile.mkdtemp()) - # since dirs_exist_ok=True only supported after py3.7, first delete the parent folder and run copytree after - shutil.rmtree(cls.test_data_path) - shutil.copytree(original_test_data_path, cls.test_data_path) + shutil.copytree(original_test_data_path, cls.test_data_path, dirs_exist_ok=True) @classmethod def tearDownClass(cls) -> None: diff --git a/tests/integration/sync/test_sync_infra.py b/tests/integration/sync/test_sync_infra.py index 53bf5fb763..8fccabede8 100644 --- a/tests/integration/sync/test_sync_infra.py +++ b/tests/integration/sync/test_sync_infra.py @@ -43,9 +43,7 @@ def setUp(self): original_test_data_path = Path(__file__).resolve().parents[1].joinpath("testdata", "sync") self.test_data_path = Path(tempfile.mkdtemp()) - # since dirs_exist_ok=True only supported after py3.7, first delete the parent folder and run copytree after - shutil.rmtree(self.test_data_path) - shutil.copytree(original_test_data_path, self.test_data_path) + shutil.copytree(original_test_data_path, self.test_data_path, dirs_exist_ok=True) self.parameter_overrides = {"HelloWorldLayerName": f"HelloWorldLayer-{uuid.uuid4().hex}"[:140]} diff --git a/tests/integration/testdata/buildcmd/PyLayer/requirements.txt b/tests/integration/testdata/buildcmd/PyLayer/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/PyLayer/requirements.txt +++ b/tests/integration/testdata/buildcmd/PyLayer/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/PyLayerMake/requirements.txt b/tests/integration/testdata/buildcmd/PyLayerMake/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/PyLayerMake/requirements.txt +++ b/tests/integration/testdata/buildcmd/PyLayerMake/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/PythonImage/requirements.txt b/tests/integration/testdata/buildcmd/PythonImage/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/PythonImage/requirements.txt +++ b/tests/integration/testdata/buildcmd/PythonImage/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/PythonImagesWithSharedCode/requirements.txt b/tests/integration/testdata/buildcmd/PythonImagesWithSharedCode/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/PythonImagesWithSharedCode/requirements.txt +++ b/tests/integration/testdata/buildcmd/PythonImagesWithSharedCode/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt b/tests/integration/testdata/buildcmd/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt index 141927094f..d2278d8b39 100644 --- a/tests/integration/testdata/buildcmd/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt +++ b/tests/integration/testdata/buildcmd/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt @@ -1 +1,2 @@ -numpy<1.20.4 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' diff --git a/tests/integration/testdata/buildcmd/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt b/tests/integration/testdata/buildcmd/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt index 141927094f..9916988520 100644 --- a/tests/integration/testdata/buildcmd/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt +++ b/tests/integration/testdata/buildcmd/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt @@ -1 +1,2 @@ -numpy<1.20.4 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/base-dir/ChildStackX/ChildStackY/template.yaml b/tests/integration/testdata/buildcmd/base-dir/ChildStackX/ChildStackY/template.yaml index c87a76fc2e..23449b30f7 100644 --- a/tests/integration/testdata/buildcmd/base-dir/ChildStackX/ChildStackY/template.yaml +++ b/tests/integration/testdata/buildcmd/base-dir/ChildStackX/ChildStackY/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a_2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: ChildStackX/ChildStackY/FunctionA Timeout: 600 @@ -18,4 +18,4 @@ Resources: Description: Layer description ContentUri: ChildStackX/ChildStackY/MyLayerVersion CompatibleRuntimes: - - python3.7 \ No newline at end of file + - python3.11 \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/base-dir/ChildStackX/template.yaml b/tests/integration/testdata/buildcmd/base-dir/ChildStackX/template.yaml index 14d70104d4..d22b25d62e 100644 --- a/tests/integration/testdata/buildcmd/base-dir/ChildStackX/template.yaml +++ b/tests/integration/testdata/buildcmd/base-dir/ChildStackX/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_b.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: ChildStackX/FunctionB Timeout: 600 diff --git a/tests/integration/testdata/buildcmd/base-dir/template/template.yaml b/tests/integration/testdata/buildcmd/base-dir/template/template.yaml index 5b97b03bd7..eb78ec920f 100644 --- a/tests/integration/testdata/buildcmd/base-dir/template/template.yaml +++ b/tests/integration/testdata/buildcmd/base-dir/template/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 diff --git a/tests/integration/testdata/buildcmd/build_image_function.yaml b/tests/integration/testdata/buildcmd/build_image_function.yaml index 5f335b9574..26e643d483 100644 --- a/tests/integration/testdata/buildcmd/build_image_function.yaml +++ b/tests/integration/testdata/buildcmd/build_image_function.yaml @@ -12,4 +12,4 @@ Resources: Properties: CodeUri: Python Handler: main.handler - Runtime: python3.7 \ No newline at end of file + Runtime: python3.11 \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_function_construct_with_skip_build_metadata.json b/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_function_construct_with_skip_build_metadata.json index 7021b71865..5c6882c36a 100644 --- a/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_function_construct_with_skip_build_metadata.json +++ b/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_function_construct_with_skip_build_metadata.json @@ -82,7 +82,7 @@ ] }, "Handler": "main.handler", - "Runtime": "python3.7", + "Runtime": "python3.11", "Timeout": 120 }, "DependsOn": [ diff --git a/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_zip_image_functions.json b/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_zip_image_functions.json index c5057789d5..889742b311 100644 --- a/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_zip_image_functions.json +++ b/tests/integration/testdata/buildcmd/cdk_v1_synthesized_template_zip_image_functions.json @@ -82,7 +82,7 @@ ] }, "Handler": "main.handler", - "Runtime": "python3.7", + "Runtime": "python3.11", "Timeout": "30" }, "DependsOn": [ diff --git a/tests/integration/testdata/buildcmd/cdk_v2_synthesized_template_function_construct_with_skip_build_metadata.json b/tests/integration/testdata/buildcmd/cdk_v2_synthesized_template_function_construct_with_skip_build_metadata.json index a1314c468f..200b0aaa08 100644 --- a/tests/integration/testdata/buildcmd/cdk_v2_synthesized_template_function_construct_with_skip_build_metadata.json +++ b/tests/integration/testdata/buildcmd/cdk_v2_synthesized_template_function_construct_with_skip_build_metadata.json @@ -50,7 +50,7 @@ ] }, "Handler": "main.handler", - "Runtime": "python3.7", + "Runtime": "python3.11", "Timeout": 120 }, "DependsOn": [ diff --git a/tests/integration/testdata/buildcmd/container_env_vars_template.yml b/tests/integration/testdata/buildcmd/container_env_vars_template.yml index fedf57c4bc..efc0dd16df 100644 --- a/tests/integration/testdata/buildcmd/container_env_vars_template.yml +++ b/tests/integration/testdata/buildcmd/container_env_vars_template.yml @@ -12,6 +12,6 @@ Resources: Properties: CodeUri: PythonContainerEnvVars Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 Metadata: BuildMethod: makefile \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/dedup-functions-makefile-template.yaml b/tests/integration/testdata/buildcmd/dedup-functions-makefile-template.yaml index aea9b21a4e..299ee56ef5 100644 --- a/tests/integration/testdata/buildcmd/dedup-functions-makefile-template.yaml +++ b/tests/integration/testdata/buildcmd/dedup-functions-makefile-template.yaml @@ -12,7 +12,7 @@ Resources: Properties: CodeUri: ProvidedWithMultipleFunctions Handler: first_function.handler - Runtime: python3.7 + Runtime: python3.11 Metadata: BuildMethod: makefile HelloMarsFunction: @@ -20,6 +20,6 @@ Resources: Properties: CodeUri: ProvidedWithMultipleFunctions Handler: second_function.handler - Runtime: python3.7 + Runtime: python3.11 Metadata: BuildMethod: makefile diff --git a/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/ChildStackY/template.yaml b/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/ChildStackY/template.yaml index ec8c55d59a..0327e6a89d 100644 --- a/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/ChildStackY/template.yaml +++ b/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/ChildStackY/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a_2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 @@ -18,4 +18,4 @@ Resources: Description: Layer description ContentUri: MyLayerVersion CompatibleRuntimes: - - python3.7 \ No newline at end of file + - python3.11 \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/template.yaml b/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/template.yaml index d67b05390f..fa24b839e1 100644 --- a/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/template.yaml +++ b/tests/integration/testdata/buildcmd/deep-nested/ChildStackX/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_b.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionB Timeout: 600 diff --git a/tests/integration/testdata/buildcmd/deep-nested/template-with-symlink.yaml b/tests/integration/testdata/buildcmd/deep-nested/template-with-symlink.yaml index 7810af17f9..07eb6df599 100644 --- a/tests/integration/testdata/buildcmd/deep-nested/template-with-symlink.yaml +++ b/tests/integration/testdata/buildcmd/deep-nested/template-with-symlink.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 diff --git a/tests/integration/testdata/buildcmd/deep-nested/template.yaml b/tests/integration/testdata/buildcmd/deep-nested/template.yaml index 4dbd1e5de9..60d1607689 100644 --- a/tests/integration/testdata/buildcmd/deep-nested/template.yaml +++ b/tests/integration/testdata/buildcmd/deep-nested/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 diff --git a/tests/integration/testdata/buildcmd/inline_template.yaml b/tests/integration/testdata/buildcmd/inline_template.yaml index ee4ab19012..b71ad801eb 100644 --- a/tests/integration/testdata/buildcmd/inline_template.yaml +++ b/tests/integration/testdata/buildcmd/inline_template.yaml @@ -12,10 +12,10 @@ Resources: Properties: CodeUri: Python Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 InlineCodeFunction: Type: AWS::Serverless::Function Properties: InlineCode: "def handler(): pass" Handler: index.handler - Runtime: python3.7 \ No newline at end of file + Runtime: python3.11 \ No newline at end of file diff --git a/tests/integration/testdata/buildcmd/layers-functions-template.yaml b/tests/integration/testdata/buildcmd/layers-functions-template.yaml index 36810c782f..17eab33cee 100644 --- a/tests/integration/testdata/buildcmd/layers-functions-template.yaml +++ b/tests/integration/testdata/buildcmd/layers-functions-template.yaml @@ -48,7 +48,7 @@ Resources: Description: Layer one ContentUri: !Ref LayerContentUri CompatibleRuntimes: - - python3.7 + - python3.11 Metadata: BuildMethod: !Ref LayerBuildMethod @@ -58,7 +58,7 @@ Resources: Description: Lambda Layer one Content: !Ref LayerContentUri CompatibleRuntimes: - - python3.7 + - python3.11 Metadata: BuildMethod: !Ref LayerBuildMethod @@ -68,7 +68,7 @@ Resources: Description: Layer two ContentUri: !Ref LayerContentUri CompatibleRuntimes: - - python3.7 + - python3.11 LayerWithMakefile: Type: AWS::Serverless::LayerVersion @@ -76,7 +76,7 @@ Resources: Description: Layer three ContentUri: !Ref LayerMakeContentUri CompatibleRuntimes: - - python3.7 + - python3.11 Metadata: BuildMethod: !Ref LayerBuildMethod diff --git a/tests/integration/testdata/buildcmd/template_cfn_function_flagged_to_skip_build.yaml b/tests/integration/testdata/buildcmd/template_cfn_function_flagged_to_skip_build.yaml index 0d914a47cb..9abe4dd7eb 100644 --- a/tests/integration/testdata/buildcmd/template_cfn_function_flagged_to_skip_build.yaml +++ b/tests/integration/testdata/buildcmd/template_cfn_function_flagged_to_skip_build.yaml @@ -6,7 +6,7 @@ Resources: Type: AWS::Lambda::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 Code: Python Timeout: 600 @@ -14,7 +14,7 @@ Resources: Type: AWS::Lambda::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 Code: PreBuiltPython Timeout: 600 Metadata: diff --git a/tests/integration/testdata/buildcmd/template_function_flagged_to_skip_build.yaml b/tests/integration/testdata/buildcmd/template_function_flagged_to_skip_build.yaml index c45159e755..52ab5a4359 100644 --- a/tests/integration/testdata/buildcmd/template_function_flagged_to_skip_build.yaml +++ b/tests/integration/testdata/buildcmd/template_function_flagged_to_skip_build.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: Python Timeout: 600 @@ -15,7 +15,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: PreBuiltPython Timeout: 600 Metadata: diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend/my_layer_code/requirements.txt b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend/my_layer_code/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend/my_layer_code/requirements.txt +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend/my_layer_code/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code/requirements.txt b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code/requirements.txt +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_container_windows/my_layer_code/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/my_layer_code/requirements.txt b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/my_layer_code/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/my_layer_code/requirements.txt +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_local_backend_windows/my_layer_code/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/my_layer_code/requirements.txt b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/my_layer_code/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/my_layer_code/requirements.txt +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend/my_layer_code/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/my_layer_code/requirements.txt b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/my_layer_code/requirements.txt index ce4af48039..d5d7b17f51 100644 --- a/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/my_layer_code/requirements.txt +++ b/tests/integration/testdata/buildcmd/terraform/zip_based_lambda_functions_s3_backend_windows/my_layer_code/requirements.txt @@ -1,7 +1,8 @@ # These are some hard packages to build. Using them here helps us verify that building works on various platforms # NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600) -numpy<1.20.3 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' # `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container. # Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29 # cryptography~=2.4 diff --git a/tests/integration/testdata/delete/aws-serverless-function-retain.yaml b/tests/integration/testdata/delete/aws-serverless-function-retain.yaml index ae857aa196..a183c4151f 100644 --- a/tests/integration/testdata/delete/aws-serverless-function-retain.yaml +++ b/tests/integration/testdata/delete/aws-serverless-function-retain.yaml @@ -13,7 +13,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 DeletionPolicy: Retain diff --git a/tests/integration/testdata/invoke/template-pseudo-params.yaml b/tests/integration/testdata/invoke/template-pseudo-params.yaml index db92b20a58..67211d9eb8 100644 --- a/tests/integration/testdata/invoke/template-pseudo-params.yaml +++ b/tests/integration/testdata/invoke/template-pseudo-params.yaml @@ -56,7 +56,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.intrinsics_handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Environment: diff --git a/tests/integration/testdata/invoke/template.yml b/tests/integration/testdata/invoke/template.yml index f070cf5e55..30ab827a5d 100644 --- a/tests/integration/testdata/invoke/template.yml +++ b/tests/integration/testdata/invoke/template.yml @@ -137,7 +137,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.raise_exception - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 diff --git a/tests/integration/testdata/package/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt b/tests/integration/testdata/package/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt index 141927094f..d2278d8b39 100644 --- a/tests/integration/testdata/package/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt +++ b/tests/integration/testdata/package/asset.6598609927b272b36fdf01072092f9851ddcd1b41ba294f736ce77091f5cc456/requirements.txt @@ -1 +1,2 @@ -numpy<1.20.4 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' diff --git a/tests/integration/testdata/package/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt b/tests/integration/testdata/package/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt index 141927094f..d2278d8b39 100644 --- a/tests/integration/testdata/package/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt +++ b/tests/integration/testdata/package/asset.b998895901bf33127f2c9dce715854f8b35aa73fb7eb5245ba9721580bbe5837/requirements.txt @@ -1 +1,2 @@ -numpy<1.20.4 +numpy<1.20.3; python_version < '3.10' +numpy==1.26.4; python_version >= '3.10' diff --git a/tests/integration/testdata/package/aws-lambda-layerversion.yaml b/tests/integration/testdata/package/aws-lambda-layerversion.yaml index 70315e8360..f4145f06f3 100644 --- a/tests/integration/testdata/package/aws-lambda-layerversion.yaml +++ b/tests/integration/testdata/package/aws-lambda-layerversion.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Lambda::LayerVersion Properties: CompatibleRuntimes: - - python3.7 + - python3.11 Content: "." Description: My layer LayerName: my-layer diff --git a/tests/integration/testdata/package/aws-serverless-function-cdk.yaml b/tests/integration/testdata/package/aws-serverless-function-cdk.yaml index 34216cce16..991c2c279f 100644 --- a/tests/integration/testdata/package/aws-serverless-function-cdk.yaml +++ b/tests/integration/testdata/package/aws-serverless-function-cdk.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Metadata: diff --git a/tests/integration/testdata/package/aws-serverless-function-codedeploy-condition-warning.yaml b/tests/integration/testdata/package/aws-serverless-function-codedeploy-condition-warning.yaml index 717a0e440a..65a499d8cb 100644 --- a/tests/integration/testdata/package/aws-serverless-function-codedeploy-condition-warning.yaml +++ b/tests/integration/testdata/package/aws-serverless-function-codedeploy-condition-warning.yaml @@ -9,7 +9,7 @@ Resources: Condition: true Properties: Handler: lambda.lambda_handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: s3://bucket/key DeploymentPreference: Type: Linear10PercentEvery1Minute diff --git a/tests/integration/testdata/package/aws-serverless-function-codedeploy-warning.yaml b/tests/integration/testdata/package/aws-serverless-function-codedeploy-warning.yaml index cb0dd9fb95..17b9d5b5e9 100644 --- a/tests/integration/testdata/package/aws-serverless-function-codedeploy-warning.yaml +++ b/tests/integration/testdata/package/aws-serverless-function-codedeploy-warning.yaml @@ -9,7 +9,7 @@ Resources: Properties: Handler: lambda.lambda_handler Role: arn:aws:iam::123456789999:role/lambda-role - Runtime: python3.7 + Runtime: python3.11 CodeUri: s3://bucket/key AutoPublishAlias: live DeploymentPreference: @@ -29,7 +29,7 @@ Resources: Properties: Handler: hook.lambda_handler Role: arn:aws:iam::123456789999:role/lambda-role - Runtime: python3.7 + Runtime: python3.11 CodeUri: s3://bucket/key FunctionName: 'CodeDeployHook_preTrafficHook' AutoPublishAlias: live diff --git a/tests/integration/testdata/package/aws-serverless-function-with-code-signing.yaml b/tests/integration/testdata/package/aws-serverless-function-with-code-signing.yaml index a6830793b4..0e36dbe123 100644 --- a/tests/integration/testdata/package/aws-serverless-function-with-code-signing.yaml +++ b/tests/integration/testdata/package/aws-serverless-function-with-code-signing.yaml @@ -18,7 +18,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 CodeSigningConfigArn: !Ref HelloWorldFunctionCodeSigningConfig diff --git a/tests/integration/testdata/package/aws-serverless-function.yaml b/tests/integration/testdata/package/aws-serverless-function.yaml index 4beab4e506..0721ff5b20 100644 --- a/tests/integration/testdata/package/aws-serverless-function.yaml +++ b/tests/integration/testdata/package/aws-serverless-function.yaml @@ -13,6 +13,6 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 diff --git a/tests/integration/testdata/package/aws-serverless-inline.yaml b/tests/integration/testdata/package/aws-serverless-inline.yaml index b21dbf817a..27e7df3598 100644 --- a/tests/integration/testdata/package/aws-serverless-inline.yaml +++ b/tests/integration/testdata/package/aws-serverless-inline.yaml @@ -11,4 +11,4 @@ Resources: print(event) return {'body': 'Hello World 2!', 'statusCode': 200} Handler: index.handler - Runtime: python3.7 + Runtime: python3.11 diff --git a/tests/integration/testdata/package/aws-serverlessrepo-application.yaml b/tests/integration/testdata/package/aws-serverlessrepo-application.yaml index e96d5835d2..39bcd47033 100644 --- a/tests/integration/testdata/package/aws-serverlessrepo-application.yaml +++ b/tests/integration/testdata/package/aws-serverlessrepo-application.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 diff --git a/tests/integration/testdata/package/aws-serverlessrepo-application_regression.yaml b/tests/integration/testdata/package/aws-serverlessrepo-application_regression.yaml index 87917571ae..efea552101 100644 --- a/tests/integration/testdata/package/aws-serverlessrepo-application_regression.yaml +++ b/tests/integration/testdata/package/aws-serverlessrepo-application_regression.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Metadata: diff --git a/tests/integration/testdata/package/cdk_v1_synthesized_template_level3_nested_zip_functions.json b/tests/integration/testdata/package/cdk_v1_synthesized_template_level3_nested_zip_functions.json index f7ac52df84..10f1db8975 100644 --- a/tests/integration/testdata/package/cdk_v1_synthesized_template_level3_nested_zip_functions.json +++ b/tests/integration/testdata/package/cdk_v1_synthesized_template_level3_nested_zip_functions.json @@ -82,7 +82,7 @@ ] }, "Handler": "main.handler", - "Runtime": "python3.7" + "Runtime": "python3.11" }, "DependsOn": [ "RandomCitiesFunctionServiceRole4EFB1CF5" diff --git a/tests/integration/testdata/package/cdk_v1_synthesized_template_zip_functions.json b/tests/integration/testdata/package/cdk_v1_synthesized_template_zip_functions.json index f9960f41b3..87b5a021e3 100644 --- a/tests/integration/testdata/package/cdk_v1_synthesized_template_zip_functions.json +++ b/tests/integration/testdata/package/cdk_v1_synthesized_template_zip_functions.json @@ -82,7 +82,7 @@ ] }, "Handler": "main.handler", - "Runtime": "python3.7" + "Runtime": "python3.11" }, "DependsOn": [ "RandomCitiesFunctionServiceRole4EFB1CF5" diff --git a/tests/integration/testdata/package/deep-nested/ChildStackX/ChildStackY/template.yaml b/tests/integration/testdata/package/deep-nested/ChildStackX/ChildStackY/template.yaml index ec8c55d59a..0327e6a89d 100644 --- a/tests/integration/testdata/package/deep-nested/ChildStackX/ChildStackY/template.yaml +++ b/tests/integration/testdata/package/deep-nested/ChildStackX/ChildStackY/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a_2.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 @@ -18,4 +18,4 @@ Resources: Description: Layer description ContentUri: MyLayerVersion CompatibleRuntimes: - - python3.7 \ No newline at end of file + - python3.11 \ No newline at end of file diff --git a/tests/integration/testdata/package/deep-nested/ChildStackX/template.yaml b/tests/integration/testdata/package/deep-nested/ChildStackX/template.yaml index d67b05390f..fa24b839e1 100644 --- a/tests/integration/testdata/package/deep-nested/ChildStackX/template.yaml +++ b/tests/integration/testdata/package/deep-nested/ChildStackX/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_b.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionB Timeout: 600 diff --git a/tests/integration/testdata/package/deep-nested/template.yaml b/tests/integration/testdata/package/deep-nested/template.yaml index 4dbd1e5de9..60d1607689 100644 --- a/tests/integration/testdata/package/deep-nested/template.yaml +++ b/tests/integration/testdata/package/deep-nested/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 diff --git a/tests/integration/testdata/package/stackset/template.yaml b/tests/integration/testdata/package/stackset/template.yaml index 47e141019e..0e5d9bb4db 100644 --- a/tests/integration/testdata/package/stackset/template.yaml +++ b/tests/integration/testdata/package/stackset/template.yaml @@ -7,7 +7,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main_a.handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: FunctionA Timeout: 600 diff --git a/tests/integration/testdata/start_api/cfn-http-api-with-normal-and-default-routes.yaml b/tests/integration/testdata/start_api/cfn-http-api-with-normal-and-default-routes.yaml index 08512893f2..8585177648 100644 --- a/tests/integration/testdata/start_api/cfn-http-api-with-normal-and-default-routes.yaml +++ b/tests/integration/testdata/start_api/cfn-http-api-with-normal-and-default-routes.yaml @@ -13,7 +13,7 @@ Resources: Fn::GetAtt: - HelloWorldFunctionRole - Arn - Runtime: python3.7 + Runtime: python3.11 Tags: - Key: lambda:createdBy Value: SAM @@ -57,7 +57,7 @@ Resources: Fn::GetAtt: - HelloWorldFunctionRole2 - Arn - Runtime: python3.7 + Runtime: python3.11 Tags: - Key: lambda:createdBy Value: SAM diff --git a/tests/integration/testdata/start_api/cfn-http-api-with-swagger-body.yaml b/tests/integration/testdata/start_api/cfn-http-api-with-swagger-body.yaml index c092b2db3d..99392c7fc5 100644 --- a/tests/integration/testdata/start_api/cfn-http-api-with-swagger-body.yaml +++ b/tests/integration/testdata/start_api/cfn-http-api-with-swagger-body.yaml @@ -13,7 +13,7 @@ Resources: Fn::GetAtt: - HelloWorldFunctionRole - Arn - Runtime: python3.7 + Runtime: python3.11 Tags: - Key: lambda:createdBy Value: SAM diff --git a/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-default-route.yaml b/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-default-route.yaml index 3da4083175..119ce9408b 100644 --- a/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-default-route.yaml +++ b/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-default-route.yaml @@ -13,7 +13,7 @@ Resources: Fn::GetAtt: - HelloWorldFunctionRole - Arn - Runtime: python3.7 + Runtime: python3.11 Tags: - Key: lambda:createdBy Value: SAM diff --git a/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-one-route.yaml b/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-one-route.yaml index bfdcdd15c6..40207640d7 100644 --- a/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-one-route.yaml +++ b/tests/integration/testdata/start_api/cfn-quick-created-http-api-with-one-route.yaml @@ -13,7 +13,7 @@ Resources: Fn::GetAtt: - HelloWorldFunctionRole - Arn - Runtime: python3.7 + Runtime: python3.11 Tags: - Key: lambda:createdBy Value: SAM diff --git a/tests/integration/testdata/start_api/swagger-template-http-api.yaml b/tests/integration/testdata/start_api/swagger-template-http-api.yaml index 371e800f0d..5993c2fdcd 100644 --- a/tests/integration/testdata/start_api/swagger-template-http-api.yaml +++ b/tests/integration/testdata/start_api/swagger-template-http-api.yaml @@ -110,7 +110,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.echo_event_handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: @@ -127,7 +127,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: main.echo_event_handler - Runtime: python3.7 + Runtime: python3.11 CodeUri: . Timeout: 600 Events: diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json index 501f219ab5..fb2276fdda 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions.json @@ -42,10 +42,10 @@ } }, "CompatibleRuntimes": [ - "python3.7", "python3.8", "python3.9", - "python3.11" + "python3.11", + "python3.12" ] }, "Metadata": { diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json index 1efd11e775..3e791a6c77 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_level3_nested_zip_functions_after.json @@ -42,10 +42,10 @@ } }, "CompatibleRuntimes": [ - "python3.7", "python3.8", "python3.9", - "python3.11" + "python3.11", + "python3.12" ] }, "Metadata": { diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json index 5eb15f6c79..1e3018c8dd 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions.json @@ -42,10 +42,10 @@ } }, "CompatibleRuntimes": [ - "python3.7", "python3.8", "python3.9", - "python3.11" + "python3.11", + "python3.12" ] }, "Metadata": { diff --git a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json index 6aead65356..6fdae972ec 100644 --- a/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json +++ b/tests/integration/testdata/sync/infra/cdk/cdk_v1_synthesized_template_zip_functions_after.json @@ -42,10 +42,10 @@ } }, "CompatibleRuntimes": [ - "python3.7", "python3.8", "python3.9", - "python3.11" + "python3.11", + "python3.12" ] }, "Metadata": { diff --git a/tests/integration/validate/test_validate_command.py b/tests/integration/validate/test_validate_command.py index cfd47d0e6e..542d5184b3 100644 --- a/tests/integration/validate/test_validate_command.py +++ b/tests/integration/validate/test_validate_command.py @@ -145,11 +145,10 @@ def test_lint_supported_runtimes(self): "provided", "provided.al2", "provided.al2023", - "ruby3.2", - "python3.7", "python3.8", "python3.9", "python3.10", + "ruby3.2", ] i = 0 for runtime in supported_runtimes: diff --git a/tests/smoke/templates/sar/aws-deployment-framework-template.yaml b/tests/smoke/templates/sar/aws-deployment-framework-template.yaml index a360111874..58336b05ef 100644 --- a/tests/smoke/templates/sar/aws-deployment-framework-template.yaml +++ b/tests/smoke/templates/sar/aws-deployment-framework-template.yaml @@ -106,7 +106,7 @@ Resources: Resource: Fn::Sub: arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/deployment_account_id Version: '2012-10-17' - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function BootstrapTemplatesBucket: @@ -452,7 +452,7 @@ Resources: Fn::GetAtt: - LambdaRole - Arn - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function CrossRegionBucketHandler: @@ -480,7 +480,7 @@ Resources: - Fn::Sub: arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/shared_modules_bucket - Fn::Sub: arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/deployment_account_region Version: '2012-10-17' - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function DeploymentAccount: @@ -544,7 +544,7 @@ Resources: Fn::GetAtt: - LambdaRole - Arn - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function InitialCommit: @@ -593,7 +593,7 @@ Resources: - CodeCommitRepository - Arn Version: '2012-10-17' - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function LambdaLayerVersion: @@ -707,7 +707,7 @@ Resources: Fn::GetAtt: - LambdaRole - Arn - Runtime: python3.7 + Runtime: python3.11 Timeout: 900 Type: AWS::Serverless::Function Organization: @@ -738,7 +738,7 @@ Resources: Effect: Allow Resource: arn:aws:iam::*:role/aws-service-role/* Version: '2012-10-17' - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function OrganizationUnitHandler: @@ -758,7 +758,7 @@ Resources: Effect: Allow Resource: '*' Version: '2012-10-17' - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function RoleStackDeploymentFunction: @@ -786,7 +786,7 @@ Resources: Fn::GetAtt: - LambdaRole - Arn - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function SharedModulesBucket: @@ -858,7 +858,7 @@ Resources: Fn::GetAtt: - LambdaRole - Arn - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function StateMachine: @@ -1012,7 +1012,7 @@ Resources: Fn::GetAtt: - LambdaRole - Arn - Runtime: python3.7 + Runtime: python3.11 Timeout: 300 Type: AWS::Serverless::Function Transform: AWS::Serverless-2016-10-31 diff --git a/tests/smoke/templates/sar/lambda-to-slack-template.yaml b/tests/smoke/templates/sar/lambda-to-slack-template.yaml index 4d4034dbd9..75e79ca275 100644 --- a/tests/smoke/templates/sar/lambda-to-slack-template.yaml +++ b/tests/smoke/templates/sar/lambda-to-slack-template.yaml @@ -27,7 +27,7 @@ Resources: Ref: LogLevel SLACK_URL: Ref: SlackUrl - Runtime: python3.7 + Runtime: python3.11 Timeout: 60 Tracing: Active CodeUri: diff --git a/tests/smoke/templates/sar/serverless-cognito-template.yaml b/tests/smoke/templates/sar/serverless-cognito-template.yaml index d4ce0fd598..74084c122a 100644 --- a/tests/smoke/templates/sar/serverless-cognito-template.yaml +++ b/tests/smoke/templates/sar/serverless-cognito-template.yaml @@ -5,7 +5,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: lambda.handler - Runtime: python3.7 + Runtime: python3.11 Policies: - AmazonCognitoPowerUser - AmazonDynamoDBFullAccess diff --git a/tests/smoke/templates/sar/sns-subscription-filter-policy-string-template.yaml b/tests/smoke/templates/sar/sns-subscription-filter-policy-string-template.yaml index 7747ad6e49..d511a54107 100644 --- a/tests/smoke/templates/sar/sns-subscription-filter-policy-string-template.yaml +++ b/tests/smoke/templates/sar/sns-subscription-filter-policy-string-template.yaml @@ -55,7 +55,7 @@ Resources: Effect: Allow Resource: - Fn::Sub: ${TopicArn} - Runtime: python3.7 + Runtime: python3.11 Timeout: 5 Tracing: Active Type: AWS::Serverless::Function diff --git a/tests/smoke/templates/sar/vpc-import-value.yaml b/tests/smoke/templates/sar/vpc-import-value.yaml index af9aaebdff..47f8dda038 100644 --- a/tests/smoke/templates/sar/vpc-import-value.yaml +++ b/tests/smoke/templates/sar/vpc-import-value.yaml @@ -14,7 +14,7 @@ Resources: Bucket: <%REPO_BUCKET%> Key: a44a03c9-ccb1-4ddc-b196-8e2c9fdeec35 Handler: app.lambda_handler - Runtime: python3.7 + Runtime: python3.11 Layers: - Ref: LayerArn VpcConfig: diff --git a/tests/unit/commands/deploy/test_auth_utils.py b/tests/unit/commands/deploy/test_auth_utils.py index 72f5123da4..5ebe80e4fc 100644 --- a/tests/unit/commands/deploy/test_auth_utils.py +++ b/tests/unit/commands/deploy/test_auth_utils.py @@ -26,7 +26,7 @@ def setUp(self): [ ("CodeUri", "HelloWorldFunction"), ("Handler", "app.lambda_handler"), - ("Runtime", "python3.7"), + ("Runtime", "python3.12"), ( "Events", OrderedDict( diff --git a/tests/unit/commands/deploy/test_code_signer_utils.py b/tests/unit/commands/deploy/test_code_signer_utils.py index 9fc51de540..ef5ccd0b69 100644 --- a/tests/unit/commands/deploy/test_code_signer_utils.py +++ b/tests/unit/commands/deploy/test_code_signer_utils.py @@ -46,7 +46,7 @@ def test_signer_config_per_function(self): [ ("CodeUri", "HelloWorldFunction"), ("Handler", "app.lambda_handler"), - ("Runtime", "python3.7"), + ("Runtime", "python3.12"), ("CodeSigningConfigArn", "MyCodeSigningConfigArn"), ( "Layers", @@ -71,7 +71,7 @@ def test_signer_config_per_function(self): [ ("CodeUri", "HelloWorldFunction2"), ("Handler", "app.lambda_handler2"), - ("Runtime", "python3.7"), + ("Runtime", "python3.12"), ("CodeSigningConfigArn", "MyCodeSigningConfigArn"), ( "Layers", @@ -96,7 +96,7 @@ def test_signer_config_per_function(self): [ ("LayerName", "dependencies"), ("ContentUri", "dependencies/"), - ("CompatibleRuntimes", ["python3.7"]), + ("CompatibleRuntimes", ["python3.12"]), ] ), ), diff --git a/tests/unit/commands/init/test_cli.py b/tests/unit/commands/init/test_cli.py index 81148e8350..f1cbc55480 100644 --- a/tests/unit/commands/init/test_cli.py +++ b/tests/unit/commands/init/test_cli.py @@ -2521,7 +2521,7 @@ def test_init_cli_int_must_raise_for_unsupported_runtime( test-project """ runner = CliRunner() - result = runner.invoke(init_cmd, ["--runtime", "python3.7"], input=user_input) + result = runner.invoke(init_cmd, ["--runtime", "python3.12"], input=user_input) self.assertTrue(result.exception) @patch("samcli.commands.init.init_templates.InitTemplates.get_preprocessed_manifest") @@ -2848,9 +2848,9 @@ def test_init_cli_generate_app_template_from_local_cli_templates( @patch("samcli.local.common.runtime_template.INIT_RUNTIMES") def test_must_remove_unsupported_runtime(self, init_runtime_mock): - runtime_option_list = ["python3.7", "ruby3.2", "java11", "unsupported_runtime"] - init_runtime_mock.return_value = ["go1.x", "java11", "python3.7", "ruby3.2"] - expect_result = ["java11", "python3.7", "ruby3.2"] + runtime_option_list = ["python3.12", "ruby3.2", "java11", "unsupported_runtime"] + init_runtime_mock.return_value = ["go1.x", "java11", "python3.12", "ruby3.2"] + expect_result = ["java11", "python3.12", "ruby3.2"] actual_result = get_sorted_runtimes(runtime_option_list) self.assertEqual(actual_result, expect_result) diff --git a/tests/unit/commands/local/lib/test_sam_function_provider.py b/tests/unit/commands/local/lib/test_sam_function_provider.py index eba4b6158c..0c57430a9b 100644 --- a/tests/unit/commands/local/lib/test_sam_function_provider.py +++ b/tests/unit/commands/local/lib/test_sam_function_provider.py @@ -2476,7 +2476,7 @@ class TestSamFunctionProvider_search_layer(TestCase): "LayerName": "SamLayer", "Description": "Sam", "ContentUri": "layer/", - "CompatibleRuntimes": ["python3.7"], + "CompatibleRuntimes": ["python3.12"], }, } }, diff --git a/tests/unit/commands/local/lib/test_stack_provider.py b/tests/unit/commands/local/lib/test_stack_provider.py index c7cbc7c524..d3002ae0fd 100644 --- a/tests/unit/commands/local/lib/test_stack_provider.py +++ b/tests/unit/commands/local/lib/test_stack_provider.py @@ -17,7 +17,7 @@ "Resources": { "AFunction": { "Type": "AWS::Serverless::Function", - "Properties": {"CodeUri": "hi/", "Runtime": "python3.7"}, + "Properties": {"CodeUri": "hi/", "Runtime": "python3.12"}, } } } diff --git a/tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py b/tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py index a204684208..9143a1a43e 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py @@ -72,7 +72,7 @@ def setUp(self) -> None: "environment": [{"variables": {"foo": "bar", "hello": "world"}}], "handler": "index.handler", "package_type": "Zip", - "runtime": "python3.7", + "runtime": "python3.12", "layers": ["layer_arn1", "layer_arn2"], "timeout": 3, "memory_size": 128, @@ -83,7 +83,7 @@ def setUp(self) -> None: "Environment": {"Variables": {"foo": "bar", "hello": "world"}}, "Handler": "index.handler", "PackageType": "Zip", - "Runtime": "python3.7", + "Runtime": "python3.12", "Layers": ["layer_arn1", "layer_arn2"], "Timeout": 3, "MemorySize": 128, diff --git a/tests/unit/hook_packages/terraform/hooks/prepare/test_enrich.py b/tests/unit/hook_packages/terraform/hooks/prepare/test_enrich.py index 5a21491078..55c98bc2a2 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/test_enrich.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/test_enrich.py @@ -1204,10 +1204,6 @@ def test_validate_referenced_resource_matches_sam_metadata_type_invalid_types( @parameterized.expand( [ ([CalledProcessError(-2, "python3 --version"), Mock(stdout="Python 3.8.10")], "py3"), - ([Mock(stdout="Python 3.7.12"), CalledProcessError(-2, "py3 --version")], "python3"), - ([Mock(stdout="Python 3.7")], "python3"), - ([Mock(stdout="Python 3.7.0")], "python3"), - ([Mock(stdout="Python 3.7.12")], "python3"), ([Mock(stdout="Python 3.8")], "python3"), ([Mock(stdout="Python 3.8.0")], "python3"), ([Mock(stdout="Python 3.8.12")], "python3"), @@ -1222,7 +1218,7 @@ def test_validate_referenced_resource_matches_sam_metadata_type_invalid_types( Mock(stdout="Python 3.6.10"), Mock(stdout="Python 3.0.10"), Mock(stdout="Python 2.7.10"), - Mock(stdout="Python 3.7.12"), + Mock(stdout="Python 3.12.1"), ], "py", ), @@ -1275,6 +1271,6 @@ def test_get_python_command_name(self, mock_run_side_effect, expected_python_com def test_get_python_command_name_python_not_found(self, mock_run_side_effect, mock_subprocess_run): mock_subprocess_run.side_effect = mock_run_side_effect - expected_error_msg = "Python not found. Please ensure that python 3.7 or above is installed." + expected_error_msg = "Python not found. Please ensure that python 3.12 or above is installed." with self.assertRaises(PrepareHookException, msg=expected_error_msg): _get_python_command_name() diff --git a/tests/unit/hook_packages/terraform/hooks/prepare/test_resource_linking.py b/tests/unit/hook_packages/terraform/hooks/prepare/test_resource_linking.py index 6dd94545d8..d8a02e854b 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/test_resource_linking.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/test_resource_linking.py @@ -1215,13 +1215,13 @@ def test_handle_linking_mix_of_applied_and_non_applied_resources(self): "Type": "AWS::Lambda::Function", "Properties": { "FunctionName": "func1", - "Runtime": "Python3.7", + "Runtime": "Python3.12", "Layers": ["applied_layer1.arn", "existing_layer1.arn"], }, } cfn_resource_depend_on_at_least_one_non_applied_resource = { "Type": "AWS::Lambda::Function", - "Properties": {"FunctionName": "func2", "Runtime": "Python3.7"}, + "Properties": {"FunctionName": "func2", "Runtime": "Python3.12"}, } cfn_resources = [ cfn_resource_depend_on_applied_resources, @@ -1244,7 +1244,7 @@ def test_handle_linking_only_applied_resources(self): "Type": "AWS::Lambda::Function", "Properties": { "FunctionName": "func1", - "Runtime": "Python3.7", + "Runtime": "Python3.12", "Layers": ["applied_layer1.arn", "existing_layer1.arn"], }, } @@ -1252,7 +1252,7 @@ def test_handle_linking_only_applied_resources(self): "Type": "AWS::Lambda::Function", "Properties": { "FunctionName": "func2", - "Runtime": "Python3.7", + "Runtime": "Python3.12", "Layers": ["applied_layer2.arn", "existing_layer2.arn"], }, } @@ -1278,11 +1278,11 @@ def test_handle_linking_only_applied_resources(self): def test_handle_linking_only_non_applied_resources(self): cfn_resource1_depend_on_at_least_one_non_applied_resource = { "Type": "AWS::Lambda::Function", - "Properties": {"FunctionName": "func2", "Runtime": "Python3.7"}, + "Properties": {"FunctionName": "func2", "Runtime": "Python3.12"}, } cfn_resource2_depend_on_at_least_one_non_applied_resource = { "Type": "AWS::Lambda::Function", - "Properties": {"FunctionName": "func3", "Runtime": "Python3.7"}, + "Properties": {"FunctionName": "func3", "Runtime": "Python3.12"}, } cfn_resources = [ cfn_resource1_depend_on_at_least_one_non_applied_resource, diff --git a/tests/unit/hook_packages/terraform/hooks/prepare/test_translate.py b/tests/unit/hook_packages/terraform/hooks/prepare/test_translate.py index 0c664c4697..01a5fd19ae 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/test_translate.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/test_translate.py @@ -339,7 +339,7 @@ def test_translate_to_cfn_with_root_module_with_sam_metadata_resource( "Code": "file.zip", "Handler": "index.handler", "PackageType": "Zip", - "Runtime": "python3.7", + "Runtime": "python3.12", "Layers": ["layer_arn1", "layer_arn2"], "Timeout": 3, "MemorySize": 128, diff --git a/tests/unit/lib/build_module/test_app_builder.py b/tests/unit/lib/build_module/test_app_builder.py index 05c5bc6499..92c584ba30 100644 --- a/tests/unit/lib/build_module/test_app_builder.py +++ b/tests/unit/lib/build_module/test_app_builder.py @@ -465,9 +465,12 @@ def test_must_raise_for_functions_with_multi_architecture(self, persist_mock, re [ ("python2.7",), ("python3.6",), + ("python3.7",), ("ruby2.5",), ("ruby2.7",), ("nodejs10.x",), + ("nodejs12.x",), + ("nodejs14.x",), ("dotnetcore2.1",), ("dotnetcore3.1",), ] diff --git a/tests/unit/lib/build_module/test_build_strategy.py b/tests/unit/lib/build_module/test_build_strategy.py index 07f5e02021..27ea179a77 100644 --- a/tests/unit/lib/build_module/test_build_strategy.py +++ b/tests/unit/lib/build_module/test_build_strategy.py @@ -323,7 +323,7 @@ def test_build_single_function_definition_image_functions_with_same_metadata(sel function2.full_path = "Function2" function2.packagetype = IMAGE build_definition = FunctionBuildDefinition( - "3.7", "codeuri", IMAGE, X86_64, {}, "handler", env_vars={"FOO": "BAR"} + "3.12", "codeuri", IMAGE, X86_64, {}, "handler", env_vars={"FOO": "BAR"} ) # since they have the same metadata, they are put into the same build_definition. build_definition.functions = [function1, function2] @@ -344,6 +344,7 @@ class CachedBuildStrategyTest(BuildStrategyBaseTest): SOURCE_HASH = "cae49aa393d669e850bd49869905099d" LAYER_UUID = "761ce752-d1c8-4e07-86a0-f64778cdd108" LAYER_METHOD = "nodejs20.x" + LAYER_METHOD = "nodejs20.x" BUILD_GRAPH_CONTENTS = f""" [function_build_definitions] @@ -732,7 +733,7 @@ def setUp(self) -> None: @parameterized.expand( [ - "python3.7", + "python3.12", "nodejs20.x", "ruby3.2", ] diff --git a/tests/unit/lib/build_module/test_workflow_config.py b/tests/unit/lib/build_module/test_workflow_config.py index d6574b27c1..50f5ec4db9 100644 --- a/tests/unit/lib/build_module/test_workflow_config.py +++ b/tests/unit/lib/build_module/test_workflow_config.py @@ -16,7 +16,7 @@ def setUp(self): self.project_dir = "" EventTracker.clear_trackers() - @parameterized.expand([("python3.7",), ("python3.8",)]) + @parameterized.expand([("python3.8",), ("python3.9",), ("python3.10",), ("python3.11",), ("python3.12",)]) def test_must_work_for_python(self, runtime): result = get_workflow_config(runtime, self.code_dir, self.project_dir) self.assertEqual(result.language, "python") diff --git a/tests/unit/lib/utils/test_architecture.py b/tests/unit/lib/utils/test_architecture.py index fbf52e5901..e8c777fa84 100644 --- a/tests/unit/lib/utils/test_architecture.py +++ b/tests/unit/lib/utils/test_architecture.py @@ -58,7 +58,6 @@ def test_must_pass_for_support_runtime_architecture(self, runtime, arch, package @parameterized.expand( [ - ("python3.7", ARM64), ("java8", ARM64), ("go1.x", ARM64), ("provided", ARM64), diff --git a/tests/unit/local/docker/test_lambda_container.py b/tests/unit/local/docker/test_lambda_container.py index f5261ecd13..aaaa31961f 100644 --- a/tests/unit/local/docker/test_lambda_container.py +++ b/tests/unit/local/docker/test_lambda_container.py @@ -20,7 +20,6 @@ Runtime.nodejs16x.value, Runtime.nodejs18x.value, Runtime.nodejs20x.value, - Runtime.python37.value, Runtime.python38.value, Runtime.python39.value, Runtime.python310.value, diff --git a/tests/unit/local/docker/test_lambda_debug_settings.py b/tests/unit/local/docker/test_lambda_debug_settings.py index d9501f4e7b..19215c85ed 100644 --- a/tests/unit/local/docker/test_lambda_debug_settings.py +++ b/tests/unit/local/docker/test_lambda_debug_settings.py @@ -16,7 +16,6 @@ Runtime.nodejs16x, Runtime.nodejs18x, Runtime.nodejs20x, - Runtime.python37, Runtime.python38, Runtime.python39, Runtime.python310, diff --git a/tests/unit/local/docker/test_lambda_image.py b/tests/unit/local/docker/test_lambda_image.py index a8e0d776b7..54b2e6e766 100644 --- a/tests/unit/local/docker/test_lambda_image.py +++ b/tests/unit/local/docker/test_lambda_image.py @@ -21,8 +21,6 @@ class TestRuntime(TestCase): ("nodejs16.x", "nodejs:16-x86_64"), ("nodejs18.x", "nodejs:18-x86_64"), ("nodejs20.x", "nodejs:20-x86_64"), - ("python2.7", "python:2.7"), - ("python3.7", "python:3.7"), ("python3.8", "python:3.8-x86_64"), ("python3.9", "python:3.9-x86_64"), ("ruby3.2", "ruby:3.2-x86_64"), @@ -165,13 +163,13 @@ def test_building_image_with_no_layers(self, build_image_patch, is_base_image_cu lambda_image = LambdaImage(layer_downloader_mock, False, False, docker_client=docker_client_mock) self.assertEqual( - lambda_image.build("python3.7", ZIP, None, [], ARM64, stream=stream), - f"public.ecr.aws/lambda/python:3.7-{RAPID_IMAGE_TAG_PREFIX}-arm64", + lambda_image.build("python3.12", ZIP, None, [], ARM64, stream=stream), + f"public.ecr.aws/lambda/python:3.12-{RAPID_IMAGE_TAG_PREFIX}-arm64", ) build_image_patch.assert_called_once_with( - "public.ecr.aws/lambda/python:3.7", - f"public.ecr.aws/lambda/python:3.7-{RAPID_IMAGE_TAG_PREFIX}-arm64", + "public.ecr.aws/lambda/python:3.12-arm64", + f"public.ecr.aws/lambda/python:3.12-{RAPID_IMAGE_TAG_PREFIX}-arm64", [], ARM64, stream=stream, @@ -242,18 +240,18 @@ def test_not_building_image_that_is_up_to_date( docker_client_mock.images.get.return_value = Mock() lambda_image = LambdaImage(layer_downloader_mock, False, False, docker_client=docker_client_mock) - actual_image_id = lambda_image.build("python3.7", ZIP, None, [layer_mock], X86_64, function_name="function") + actual_image_id = lambda_image.build("python3.12", ZIP, None, [layer_mock], X86_64, function_name="function") self.assertEqual(actual_image_id, "samcli/lambda-runtime:image-version") layer_downloader_mock.download_all.assert_called_once_with([layer_mock], False) - generate_docker_image_version_patch.assert_called_once_with([layer_mock], "python:3.7") + generate_docker_image_version_patch.assert_called_once_with([layer_mock], "python:3.12-x86_64") docker_client_mock.images.get.assert_called_once_with("samcli/lambda-runtime:image-version") build_image_patch.assert_not_called() @parameterized.expand( [ - ("python3.7", "python:3.7", "public.ecr.aws/lambda/python:3.7"), + ("python3.12", "python:3.12-x86_64", "public.ecr.aws/lambda/python:3.12-x86_64"), ("python3.8", "python:3.8-x86_64", "public.ecr.aws/lambda/python:3.8-x86_64"), ] ) @@ -293,7 +291,7 @@ def test_force_building_image_that_doesnt_already_exists( @parameterized.expand( [ - ("python3.7", "python:3.7", "public.ecr.aws/lambda/python:3.7"), + ("python3.12", "python:3.12-x86_64", "public.ecr.aws/lambda/python:3.12-x86_64"), ("python3.8", "python:3.8-x86_64", "public.ecr.aws/lambda/python:3.8-x86_64"), ] ) @@ -333,7 +331,7 @@ def test_force_building_image_on_daemon_404( @parameterized.expand( [ - ("python3.7", "python:3.7", "public.ecr.aws/lambda/python:3.7"), + ("python3.12", "python:3.12-x86_64", "public.ecr.aws/lambda/python:3.12-x86_64"), ("python3.8", "python:3.8-x86_64", "public.ecr.aws/lambda/python:3.8-x86_64"), ] ) @@ -359,7 +357,7 @@ def test_docker_distribution_api_error_on_daemon_api_error( @parameterized.expand( [ - ("python3.7", "python:3.7", "public.ecr.aws/lambda/python:3.7"), + ("python3.12", "python:3.12-arm64", "public.ecr.aws/lambda/python:3.12-arm64"), ("python3.8", "python:3.8-arm64", "public.ecr.aws/lambda/python:3.8-arm64"), ] ) @@ -742,12 +740,12 @@ def test_is_rapid_image(self, image_name, is_rapid): (f"my_repo:rapid-{version}", False), (f"my_repo:rapid-{version}beta", False), (f"my_repo:rapid-{version}-x86_64", False), - (f"public.ecr.aws/sam/emulation-python3.7:{RAPID_IMAGE_TAG_PREFIX}", False), + (f"public.ecr.aws/sam/emulation-python3.12:{RAPID_IMAGE_TAG_PREFIX}", False), (f"public.ecr.aws/lambda/python:3.9-{RAPID_IMAGE_TAG_PREFIX}-x86_64", True), ("my_repo:rapid-1.230.0", False), ("my_repo:rapid-1.204.0beta", False), ("my_repo:rapid-0.00.02-x86_64", False), - (f"public.ecr.aws/sam/emulation-python3.7:{RAPID_IMAGE_TAG_PREFIX}-0.01.01.01", False), + (f"public.ecr.aws/sam/emulation-python3.12:{RAPID_IMAGE_TAG_PREFIX}-0.01.01.01", False), ] ) def test_is_rapid_image_current(self, image_name, is_current): diff --git a/tests/unit/local/lambdafn/test_runtime.py b/tests/unit/local/lambdafn/test_runtime.py index 67a417905e..dd7dfba10a 100644 --- a/tests/unit/local/lambdafn/test_runtime.py +++ b/tests/unit/local/lambdafn/test_runtime.py @@ -1158,7 +1158,7 @@ def test_function_should_reloaded_if_runtime_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1186,7 +1186,7 @@ def test_function_should_reloaded_if_handler_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1199,7 +1199,7 @@ def test_function_should_reloaded_if_handler_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler1", None, None, @@ -1214,7 +1214,7 @@ def test_function_should_reloaded_if_package_type_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", "imageUri", None, @@ -1227,7 +1227,7 @@ def test_function_should_reloaded_if_package_type_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1242,7 +1242,7 @@ def test_function_should_reloaded_if_image_uri_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", "imageUri", None, @@ -1255,7 +1255,7 @@ def test_function_should_reloaded_if_image_uri_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", "imageUri1", None, @@ -1270,7 +1270,7 @@ def test_function_should_reloaded_if_image_config_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", "imageUri", {"WorkingDirectory": "/opt"}, @@ -1283,7 +1283,7 @@ def test_function_should_reloaded_if_image_config_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", "imageUri", {"WorkingDirectory": "/var"}, @@ -1298,7 +1298,7 @@ def test_function_should_reloaded_if_code_path_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1311,7 +1311,7 @@ def test_function_should_reloaded_if_code_path_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1326,7 +1326,7 @@ def test_function_should_reloaded_if_env_vars_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1345,7 +1345,7 @@ def test_function_should_reloaded_if_env_vars_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1365,7 +1365,7 @@ def test_function_should_reloaded_if_one_layer_removed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1382,7 +1382,7 @@ def test_function_should_reloaded_if_one_layer_removed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1400,7 +1400,7 @@ def test_function_should_reloaded_if_one_layer_added(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1416,7 +1416,7 @@ def test_function_should_reloaded_if_one_layer_added(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1434,7 +1434,7 @@ def test_function_should_reloaded_if_layers_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1450,7 +1450,7 @@ def test_function_should_reloaded_if_layers_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1468,7 +1468,7 @@ def test_function_should_not_reloaded_if_nothing_changed(self): func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, @@ -1485,7 +1485,7 @@ def test_function_should_not_reloaded_if_nothing_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.7", + "python3.12", "app.handler", None, None, diff --git a/tests/unit/test_yamlhelper.py b/tests/unit/test_yamlhelper.py index f28dd1f970..4efc884ee1 100644 --- a/tests/unit/test_yamlhelper.py +++ b/tests/unit/test_yamlhelper.py @@ -172,7 +172,7 @@ def test_unquoted_template_format_version_to_json(self): " Type: AWS::Serverless::Function\n" " Properties:\n" " Handler: main.handler\n" - " Runtime: python3.7\n" + " Runtime: python3.12\n" " CodeUri: .\n" " Timeout: 600\n" )