diff --git a/pytest.ini b/pytest.ini index a02d5bd6f5..c85b0d3c4e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -13,9 +13,6 @@ filterwarnings = default::ResourceWarning ; Ignore below warning to not fail in Python3.12. Remove once dateutil updates itself or botocore use another way to generate EPOCH ignore::DeprecationWarning:dateutil.tz.tz: -; The following deprecation warnings are treated as failures unless we explicitly tell pytest not to -; Remove once we no longer support python3.7 - ignore::boto3.exceptions.PythonDeprecationWarning markers = ruby nodejs diff --git a/samcli/lib/build/constants.py b/samcli/lib/build/constants.py index d9c7ccff88..1109d7ef1e 100644 --- a/samcli/lib/build/constants.py +++ b/samcli/lib/build/constants.py @@ -18,6 +18,7 @@ "python2.7", "python3.6", "python3.7", + "python3.8", "ruby2.5", "ruby2.7", } diff --git a/samcli/lib/build/workflow_config.py b/samcli/lib/build/workflow_config.py index 87d02b8759..6d5bd350d3 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.8": "python", "python3.9": "python", "python3.10": "python", "python3.11": "python", @@ -155,7 +154,6 @@ def get_workflow_config( } selectors_by_runtime = { - "python3.8": BasicWorkflowSelector(PYTHON_PIP_CONFIG), "python3.9": BasicWorkflowSelector(PYTHON_PIP_CONFIG), "python3.10": BasicWorkflowSelector(PYTHON_PIP_CONFIG), "python3.11": BasicWorkflowSelector(PYTHON_PIP_CONFIG), diff --git a/samcli/lib/init/local_manifest.json b/samcli/lib/init/local_manifest.json index 098452776a..11f2b7049f 100644 --- a/samcli/lib/init/local_manifest.json +++ b/samcli/lib/init/local_manifest.json @@ -104,15 +104,5 @@ "packageType": "Zip", "useCaseName": "Hello World Example" } - ], - "python3.8": [ - { - "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/cookiecutter.json b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/cookiecutter.json index 2dc55ecda8..a6ecea4b40 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/cookiecutter.json +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-python/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "Name of the project", - "runtime": "python3.8", + "runtime": "python3.13", "architectures": { "value": [ "x86_64" diff --git a/samcli/lib/utils/architecture.py b/samcli/lib/utils/architecture.py index 85eebf4814..6525dd20a1 100644 --- a/samcli/lib/utils/architecture.py +++ b/samcli/lib/utils/architecture.py @@ -19,7 +19,6 @@ "nodejs18.x": [ARM64, X86_64], "nodejs20.x": [ARM64, X86_64], "nodejs22.x": [ARM64, X86_64], - "python3.8": [ARM64, X86_64], "python3.9": [ARM64, X86_64], "python3.10": [ARM64, X86_64], "python3.11": [ARM64, X86_64], diff --git a/samcli/local/common/runtime_template.py b/samcli/local/common/runtime_template.py index 906d4a40fd..b3001d1d42 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.13", "python3.12", "python3.11", "python3.10", "python3.9", "python3.8"], + "runtimes": ["python3.13", "python3.12", "python3.11", "python3.10", "python3.9"], "dependency_manager": "pip", "init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-python"), "build": True, @@ -123,7 +123,6 @@ def get_local_lambda_images_location(mapping, runtime): "python3.11", "python3.10", "python3.9", - "python3.8", # ruby runtimes in descending order "ruby3.3", "ruby3.2", @@ -149,7 +148,6 @@ def get_local_lambda_images_location(mapping, runtime): "python3.11": "amazon/python3.11-base", "python3.10": "amazon/python3.10-base", "python3.9": "amazon/python3.9-base", - "python3.8": "amazon/python3.8-base", "ruby3.3": "amazon/ruby3.3-base", "ruby3.2": "amazon/ruby3.2-base", } @@ -164,7 +162,6 @@ def get_local_lambda_images_location(mapping, runtime): "java11": "Java8", "java17": "Java8", "java21": "Java8", - "python3.8": "Python36", "python3.9": "Python36", "python3.10": "Python36", "python3.11": "Python36", diff --git a/samcli/local/docker/lambda_debug_settings.py b/samcli/local/docker/lambda_debug_settings.py index 6a033526bf..94404d413a 100644 --- a/samcli/local/docker/lambda_debug_settings.py +++ b/samcli/local/docker/lambda_debug_settings.py @@ -167,10 +167,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime **_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, - ), Runtime.python39.value: lambda: DebugSettings( entry + ["/var/lang/bin/python3.9"] + 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 b4752e87ee..84e3a049f3 100644 --- a/samcli/local/docker/lambda_image.py +++ b/samcli/local/docker/lambda_image.py @@ -39,7 +39,6 @@ class Runtime(Enum): nodejs18x = "nodejs18.x" nodejs20x = "nodejs20.x" nodejs22x = "nodejs22.x" - python38 = "python3.8" python39 = "python3.9" python310 = "python3.10" python311 = "python3.11" diff --git a/schema/samcli.json b/schema/samcli.json index 28bc9afc5c..cccc64a18d 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: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.13, python3.12, python3.11, python3.10, ruby3.3, 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/dotnet8-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.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/nodejs22.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.13-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base, amazon/ruby3.3-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: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.13, python3.12, python3.11, python3.10, ruby3.3, 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/dotnet8-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.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/nodejs22.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.13-base, amazon/python3.9-base, amazon/ruby3.2-base, amazon/ruby3.3-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: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.13, python3.12, python3.11, python3.10, ruby3.3, ruby3.2", + "description": "Lambda runtime for application.\n\nRuntimes: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.13, python3.12, python3.11, python3.10, ruby3.3, ruby3.2", "enum": [ "dotnet6", "dotnet8", @@ -68,7 +68,6 @@ "python3.11", "python3.12", "python3.13", - "python3.8", "python3.9", "ruby3.2", "ruby3.3" @@ -86,7 +85,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/dotnet8-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.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/nodejs22.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.13-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base, amazon/ruby3.3-base", + "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/dotnet8-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.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/nodejs22.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.13-base, amazon/python3.9-base, amazon/ruby3.2-base, amazon/ruby3.3-base", "enum": [ "amazon/dotnet6-base", "amazon/dotnet8-base", @@ -105,7 +104,6 @@ "amazon/python3.11-base", "amazon/python3.12-base", "amazon/python3.13-base", - "amazon/python3.8-base", "amazon/python3.9-base", "amazon/ruby3.2-base", "amazon/ruby3.3-base" @@ -406,7 +404,7 @@ "properties": { "parameters": { "title": "Parameters for the local invoke command", - "description": "Available parameters for the local invoke command:\n* terraform_plan_file:\nUsed for passing a custom plan file when executing the Terraform hook.\n* hook_name:\nHook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']\n* skip_prepare_infra:\nSkip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name.\n* event:\nJSON file containing event data passed to the Lambda function during invoke. If this option is not specified, no event is assumed. Pass in the value '-' to input JSON via stdin\n* no_event:\nDEPRECATED: By default no event is assumed.\n* runtime:\nLambda runtime used to invoke the function.\n\nRuntimes: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.13, python3.12, python3.11, python3.10, ruby3.3, ruby3.2\n* mount_symlinks:\nSpecify if symlinks at the top level of the code should be mounted inside the container. Activating this flag could allow access to locations outside of your workspace by using a symbolic link. By default symlinks are not mounted.\n* template_file:\nAWS SAM template which references built artifacts for resources in the template. (if applicable)\n* env_vars:\nJSON file containing values for Lambda function's environment variables.\n* parameter_overrides:\nString that contains AWS CloudFormation parameter overrides encoded as key=value pairs.\n* debug_port:\nWhen specified, Lambda function container will start in debug mode and will expose this port on localhost.\n* debugger_path:\nHost path to a debugger that will be mounted into the Lambda container.\n* debug_args:\nAdditional arguments to be passed to the debugger.\n* container_env_vars:\nJSON file containing additional environment variables to be set within the container when used in a debugging session locally.\n* docker_volume_basedir:\nSpecify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine.\n* log_file:\nFile to capture output logs.\n* layer_cache_basedir:\nSpecify the location basedir where the lambda layers used by the template will be downloaded to.\n* skip_pull_image:\nSkip pulling down the latest Docker image for Lambda runtime.\n* docker_network:\nName or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network.\n* force_image_build:\nForce rebuilding the image used for invoking functions with layers.\n* shutdown:\nEmulate a shutdown event after invoke completes, to test extension handling of shutdown behavior.\n* container_host:\nHost of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`\n* container_host_interface:\nIP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.\n* add_host:\nPasses a hostname to IP address mapping to the Docker container's host file. This parameter can be passed multiple times.Example:--add-host example.com:127.0.0.1\n* invoke_image:\nContainer image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs20.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs20.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used.\n* no_memory_limit:\nRemoves the Memory limit during emulation. With this parameter, the underlying container will run without a --memory parameter\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* profile:\nSelect a specific profile from your credential file to get AWS credentials.\n* region:\nSet the AWS Region of the service. (e.g. us-east-1)\n* save_params:\nSave the parameters provided via the command line to the configuration file.", + "description": "Available parameters for the local invoke command:\n* terraform_plan_file:\nUsed for passing a custom plan file when executing the Terraform hook.\n* hook_name:\nHook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']\n* skip_prepare_infra:\nSkip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name.\n* event:\nJSON file containing event data passed to the Lambda function during invoke. If this option is not specified, no event is assumed. Pass in the value '-' to input JSON via stdin\n* no_event:\nDEPRECATED: By default no event is assumed.\n* runtime:\nLambda runtime used to invoke the function.\n\nRuntimes: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.13, python3.12, python3.11, python3.10, ruby3.3, ruby3.2\n* mount_symlinks:\nSpecify if symlinks at the top level of the code should be mounted inside the container. Activating this flag could allow access to locations outside of your workspace by using a symbolic link. By default symlinks are not mounted.\n* template_file:\nAWS SAM template which references built artifacts for resources in the template. (if applicable)\n* env_vars:\nJSON file containing values for Lambda function's environment variables.\n* parameter_overrides:\nString that contains AWS CloudFormation parameter overrides encoded as key=value pairs.\n* debug_port:\nWhen specified, Lambda function container will start in debug mode and will expose this port on localhost.\n* debugger_path:\nHost path to a debugger that will be mounted into the Lambda container.\n* debug_args:\nAdditional arguments to be passed to the debugger.\n* container_env_vars:\nJSON file containing additional environment variables to be set within the container when used in a debugging session locally.\n* docker_volume_basedir:\nSpecify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine.\n* log_file:\nFile to capture output logs.\n* layer_cache_basedir:\nSpecify the location basedir where the lambda layers used by the template will be downloaded to.\n* skip_pull_image:\nSkip pulling down the latest Docker image for Lambda runtime.\n* docker_network:\nName or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network.\n* force_image_build:\nForce rebuilding the image used for invoking functions with layers.\n* shutdown:\nEmulate a shutdown event after invoke completes, to test extension handling of shutdown behavior.\n* container_host:\nHost of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`\n* container_host_interface:\nIP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.\n* add_host:\nPasses a hostname to IP address mapping to the Docker container's host file. This parameter can be passed multiple times.Example:--add-host example.com:127.0.0.1\n* invoke_image:\nContainer image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs20.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs20.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used.\n* no_memory_limit:\nRemoves the Memory limit during emulation. With this parameter, the underlying container will run without a --memory parameter\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* profile:\nSelect a specific profile from your credential file to get AWS credentials.\n* region:\nSet the AWS Region of the service. (e.g. us-east-1)\n* save_params:\nSave the parameters provided via the command line to the configuration file.", "type": "object", "properties": { "terraform_plan_file": { @@ -438,7 +436,7 @@ "runtime": { "title": "runtime", "type": "string", - "description": "Lambda runtime used to invoke the function.\n\nRuntimes: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.13, python3.12, python3.11, python3.10, ruby3.3, ruby3.2", + "description": "Lambda runtime used to invoke the function.\n\nRuntimes: dotnet8, dotnet6, go1.x, java21, java17, java11, java8.al2, nodejs22.x, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.13, python3.12, python3.11, python3.10, ruby3.3, ruby3.2", "enum": [ "dotnet6", "dotnet8", @@ -458,7 +456,6 @@ "python3.11", "python3.12", "python3.13", - "python3.8", "python3.9", "ruby3.2", "ruby3.3" diff --git a/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml b/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml index a2bfabbb2b..b75abe0f44 100644 --- a/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml +++ b/tests/functional/commands/validate/lib/models/api_http_with_default_iam_authorizer.yaml @@ -4,7 +4,7 @@ Resources: Properties: CodeUri: s3://bucket/key Handler: app.lambda_handler - Runtime: python3.8 + Runtime: python3.9 Role: Fn::GetAtt: - HelloWorldFunctionRole diff --git a/tests/functional/commands/validate/lib/models/api_merge_definitions_with_any_method.yaml b/tests/functional/commands/validate/lib/models/api_merge_definitions_with_any_method.yaml index 0b50b1aedd..007414a542 100644 --- a/tests/functional/commands/validate/lib/models/api_merge_definitions_with_any_method.yaml +++ b/tests/functional/commands/validate/lib/models/api_merge_definitions_with_any_method.yaml @@ -15,7 +15,7 @@ Resources: Properties: CodeUri: s3://bucket/key Handler: code/handler - Runtime: python3.8 + Runtime: python3.9 Events: AllEvent: Type: Api diff --git a/tests/functional/commands/validate/lib/models/cognito_user_pool_with_new_property_and_cognito_event.yaml b/tests/functional/commands/validate/lib/models/cognito_user_pool_with_new_property_and_cognito_event.yaml index 60056fcbc8..54c719f606 100644 --- a/tests/functional/commands/validate/lib/models/cognito_user_pool_with_new_property_and_cognito_event.yaml +++ b/tests/functional/commands/validate/lib/models/cognito_user_pool_with_new_property_and_cognito_event.yaml @@ -8,7 +8,7 @@ Resources: MyFunction: Type: AWS::Serverless::Function Properties: - Runtime: python3.8 + Runtime: python3.9 InlineCode: foo Handler: bar Events: diff --git a/tests/functional/commands/validate/lib/models/function_with_null_events.yaml b/tests/functional/commands/validate/lib/models/function_with_null_events.yaml index 5dc591caa2..7775773730 100644 --- a/tests/functional/commands/validate/lib/models/function_with_null_events.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_null_events.yaml @@ -4,5 +4,5 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: handlers.handler - Runtime: python3.8 + Runtime: python3.9 Events: diff --git a/tests/functional/commands/validate/lib/models/function_with_runtime_config.yaml b/tests/functional/commands/validate/lib/models/function_with_runtime_config.yaml index a9302aa106..697d29b9f6 100644 --- a/tests/functional/commands/validate/lib/models/function_with_runtime_config.yaml +++ b/tests/functional/commands/validate/lib/models/function_with_runtime_config.yaml @@ -12,7 +12,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler - Runtime: python3.8 + Runtime: python3.9 RuntimeManagementConfig: UpdateRuntimeOn: Auto MinimalFunctionWithManualRuntimeManagementConfig: @@ -20,16 +20,16 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler - Runtime: python3.8 + Runtime: python3.9 RuntimeManagementConfig: UpdateRuntimeOn: Manual - RuntimeVersionArn: !Sub arn:aws:lambda:${AWS::Region}::runtime:python3.8::0af1966588ced06e3143ae720245c9b7aeaae213c6921c12c742a166679cc505 + RuntimeVersionArn: !Sub arn:aws:lambda:${AWS::Region}::runtime:python3.9::0af1966588ced06e3143ae720245c9b7aeaae213c6921c12c742a166679cc505 FunctionWithRuntimeManagementConfigAndAlias: Type: AWS::Serverless::Function Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler - Runtime: python3.8 + Runtime: python3.9 AutoPublishAlias: live RuntimeManagementConfig: UpdateRuntimeOn: Auto @@ -38,7 +38,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler - Runtime: python3.8 + Runtime: python3.9 RuntimeManagementConfig: UpdateRuntimeOn: !Ref RuntimeUpdateParam FunctionWithIntrinsicRuntimeVersion: @@ -46,7 +46,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler - Runtime: python3.8 + Runtime: python3.9 RuntimeManagementConfig: UpdateRuntimeOn: !Ref RuntimeUpdateParam RuntimeVersionArn: !Ref RuntimeVersionParam diff --git a/tests/functional/commands/validate/lib/models/inline_precedence.yaml b/tests/functional/commands/validate/lib/models/inline_precedence.yaml index 6b96bab623..adefc73cac 100644 --- a/tests/functional/commands/validate/lib/models/inline_precedence.yaml +++ b/tests/functional/commands/validate/lib/models/inline_precedence.yaml @@ -7,4 +7,4 @@ Resources: pass" CodeUri: . Handler: index.lambda_handler - Runtime: python3.8 + Runtime: python3.9 diff --git a/tests/functional/commands/validate/lib/models/managed_policies_minimal.yaml b/tests/functional/commands/validate/lib/models/managed_policies_minimal.yaml index 8f82c6cc2b..e88a26b565 100644 --- a/tests/functional/commands/validate/lib/models/managed_policies_minimal.yaml +++ b/tests/functional/commands/validate/lib/models/managed_policies_minimal.yaml @@ -2,7 +2,7 @@ Resources: MyFunction: Type: AWS::Serverless::Function Properties: - Runtime: python3.8 + Runtime: python3.9 Handler: foo InlineCode: bar Policies: diff --git a/tests/functional/commands/validate/lib/models/schema_validation_4.yaml b/tests/functional/commands/validate/lib/models/schema_validation_4.yaml index 1d834b4ce9..7a98987f6c 100644 --- a/tests/functional/commands/validate/lib/models/schema_validation_4.yaml +++ b/tests/functional/commands/validate/lib/models/schema_validation_4.yaml @@ -59,7 +59,7 @@ Resources: OtherFunction: Type: AWS::Serverless::Function Properties: - Runtime: python3.8 + Runtime: python3.9 Handler: foo InlineCode: bar Environment: diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml index 0869955742..8b203b450a 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_api.yaml @@ -12,7 +12,7 @@ Resources: print(event) return "do nothing" Handler: index.handler - Runtime: python3.8 + Runtime: python3.9 Post: Type: AWS::Serverless::StateMachine Properties: diff --git a/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml b/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml index 388ddea304..14454554fa 100644 --- a/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml +++ b/tests/functional/commands/validate/lib/models/state_machine_with_sam_policy_templates.yaml @@ -14,7 +14,7 @@ Resources: Properties: CodeUri: s3://sam-demo-bucket/resolver.zip Handler: resolver.handler - Runtime: python3.8 + Runtime: python3.9 NestedWorkflow: Type: AWS::Serverless::StateMachine diff --git a/tests/functional/testdata/init/unknown_runtime/manifest-v2.json b/tests/functional/testdata/init/unknown_runtime/manifest-v2.json index 1b137aa23c..2cf3c6c15e 100644 --- a/tests/functional/testdata/init/unknown_runtime/manifest-v2.json +++ b/tests/functional/testdata/init/unknown_runtime/manifest-v2.json @@ -19,9 +19,9 @@ "useCaseName": "Hello World Example" } ], - "python3.8": [ + "python3.9": [ { - "directory": "python3.8/cookiecutter-aws-sam-hello", + "directory": "python3.9/cookiecutter-aws-sam-hello", "displayName": "Hello World Example", "dependencyManager": "pip", "appTemplate": "hello-world", @@ -29,4 +29,4 @@ "useCaseName": "Hello World Example" } ] -} \ No newline at end of file +} diff --git a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml b/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml index 4ac588c14c..431a09a65c 100644 --- a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml +++ b/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml @@ -16,7 +16,7 @@ Resources: Properties: CodeUri: hello_world/ Handler: app.lambda_handler - Runtime: python3.8 + Runtime: python3.9 {%- if cookiecutter.architectures.value != []%} Architectures: {%- for arch in cookiecutter.architectures.value %} diff --git a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/__init__.py b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/__init__.py similarity index 100% rename from tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/__init__.py rename to tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/__init__.py diff --git a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/cookiecutter.json b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/cookiecutter.json similarity index 100% rename from tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/cookiecutter.json rename to tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/cookiecutter.json diff --git a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/setup.cfg b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/setup.cfg similarity index 100% rename from tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/setup.cfg rename to tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/setup.cfg diff --git a/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/__init__.py b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/__init__.py b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/app.py b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/app.py new file mode 100644 index 0000000000..139af7d44e --- /dev/null +++ b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/app.py @@ -0,0 +1,44 @@ +import json + +# import requests + + +def lambda_handler(event, context): + """Sample pure Lambda function + + Parameters + ---------- + event: dict, required + API Gateway Lambda Proxy Input Format + + Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format + + context: object, required + Lambda Context runtime methods and attributes + + Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html + + Returns + ------ + API Gateway Lambda Proxy Output Format: dict + + Return doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html + """ + + # try: + # ip = requests.get("http://checkip.amazonaws.com/") + # except requests.RequestException as e: + # # Send some context about this error to Lambda Logs + # print(e) + + # raise e + + return { + "statusCode": 200, + "body": json.dumps( + { + "message": "hello world", + # "location": ip.text.replace("\n", "") + } + ), + } diff --git a/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/requirements.txt b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/requirements.txt new file mode 100644 index 0000000000..663bd1f6a2 --- /dev/null +++ b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/hello_world/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file diff --git a/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml new file mode 100644 index 0000000000..431a09a65c --- /dev/null +++ b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml @@ -0,0 +1,45 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: > + {{ cookiecutter.project_name }} + + Sample SAM Template for {{ cookiecutter.project_name }} + +# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst +Globals: + Function: + Timeout: 3 + +Resources: + HelloWorldFunction: + Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction + Properties: + CodeUri: hello_world/ + Handler: app.lambda_handler + Runtime: python3.9 + {%- if cookiecutter.architectures.value != []%} + Architectures: + {%- for arch in cookiecutter.architectures.value %} + - {{arch}} + {%- endfor %} + {%- endif %} + Events: + HelloWorld: + Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api + Properties: + Path: /hello + Method: get + +Outputs: + # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function + # Find out more about other implicit resources you can reference within SAM + # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api + HelloWorldApi: + Description: "API Gateway endpoint URL for Prod stage for Hello World function" + Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/" + HelloWorldFunction: + Description: "Hello World Lambda Function ARN" + Value: !GetAtt HelloWorldFunction.Arn + HelloWorldFunctionIamRole: + Description: "Implicit IAM Role created for Hello World function" + Value: !GetAtt HelloWorldFunctionRole.Arn diff --git a/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/unique_test_file.txt b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/unique_test_file.txt new file mode 100644 index 0000000000..9736540dae --- /dev/null +++ b/tests/functional/testdata/init/unknown_runtime/python3.9/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/unique_test_file.txt @@ -0,0 +1 @@ +The file was provided to confirm that all unsupported runtime were eliminated and only supported runtime was provided to the customer to select \ No newline at end of file diff --git a/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml b/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml index 4ac588c14c..431a09a65c 100644 --- a/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml +++ b/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml @@ -16,7 +16,7 @@ Resources: Properties: CodeUri: hello_world/ Handler: app.lambda_handler - Runtime: python3.8 + Runtime: python3.9 {%- if cookiecutter.architectures.value != []%} Architectures: {%- for arch in cookiecutter.architectures.value %} diff --git a/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml b/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml index 4ac588c14c..431a09a65c 100644 --- a/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml +++ b/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/{{cookiecutter.project_name}}/template.yaml @@ -16,7 +16,7 @@ Resources: Properties: CodeUri: hello_world/ Handler: app.lambda_handler - Runtime: python3.8 + Runtime: python3.9 {%- if cookiecutter.architectures.value != []%} Architectures: {%- for arch in cookiecutter.architectures.value %} diff --git a/tests/integration/buildcmd/test_build_cmd_python.py b/tests/integration/buildcmd/test_build_cmd_python.py index 2e7f11dbb6..d3b1eeabd5 100644 --- a/tests/integration/buildcmd/test_build_cmd_python.py +++ b/tests/integration/buildcmd/test_build_cmd_python.py @@ -69,8 +69,8 @@ def _test_default_requirements_wrapper(self, runtime, dockerfile): @parameterized.expand( [ - *[(runtime, "Dockerfile") for runtime in ["3.8", "3.9", "3.10", "3.11"]], - *[(runtime, "Dockerfile.production") for runtime in ["3.8", "3.9", "3.10", "3.11"]], + *[(runtime, "Dockerfile") for runtime in ["3.9", "3.10", "3.11"]], + *[(runtime, "Dockerfile.production") for runtime in ["3.9", "3.10", "3.11"]], ] ) def test_with_default_requirements(self, runtime, dockerfile): @@ -158,8 +158,8 @@ def _test_default_requirements_wrapper(self, runtime, dockerfile, expected): @parameterized.expand( [ - *[(runtime, "feature_phi/Dockerfile", {"phi": "1.62"}) for runtime in ["3.8", "3.9", "3.10", "3.11"]], - *[(runtime, "feature_pi/Dockerfile", {"pi": "3.14"}) for runtime in ["3.8", "3.9", "3.10", "3.11"]], + *[(runtime, "feature_phi/Dockerfile", {"phi": "1.62"}) for runtime in ["3.9", "3.10", "3.11"]], + *[(runtime, "feature_pi/Dockerfile", {"pi": "3.14"}) for runtime in ["3.9", "3.10", "3.11"]], ] ) def test_with_default_requirements(self, runtime, dockerfile, expected): diff --git a/tests/integration/deploy/test_managed_stack_deploy.py b/tests/integration/deploy/test_managed_stack_deploy.py index 5a74af639a..1b939eb26c 100644 --- a/tests/integration/deploy/test_managed_stack_deploy.py +++ b/tests/integration/deploy/test_managed_stack_deploy.py @@ -17,7 +17,7 @@ # This is to restrict package tests to run outside of CI/CD, when the branch is not master or tests are not run by Canary SKIP_MANAGED_STACK_TESTS = RUNNING_ON_CI and RUNNING_TEST_FOR_MASTER_ON_CI and not RUN_BY_CANARY # Limits the managed stack tests to be run on a single python version to avoid CI race conditions -IS_TARGETTED_PYTHON_VERSION = PYTHON_VERSION.startswith("3.8") +IS_TARGETTED_PYTHON_VERSION = PYTHON_VERSION.startswith("3.9") CFN_PYTHON_VERSION_SUFFIX = PYTHON_VERSION.replace(".", "-") # Set region for managed stacks to be in a different region than the ones in deploy diff --git a/tests/smoke/templates/sar/aws-deployment-framework-template.yaml b/tests/smoke/templates/sar/aws-deployment-framework-template.yaml index 58336b05ef..3d76e2264d 100644 --- a/tests/smoke/templates/sar/aws-deployment-framework-template.yaml +++ b/tests/smoke/templates/sar/aws-deployment-framework-template.yaml @@ -599,7 +599,6 @@ Resources: LambdaLayerVersion: Properties: CompatibleRuntimes: - - python3.8 - python3.9 ContentUri: Bucket: <%REPO_BUCKET%> diff --git a/tests/unit/commands/buildcmd/test_build_context.py b/tests/unit/commands/buildcmd/test_build_context.py index 10a9ddd589..3bc4e18256 100644 --- a/tests/unit/commands/buildcmd/test_build_context.py +++ b/tests/unit/commands/buildcmd/test_build_context.py @@ -251,7 +251,7 @@ def test_must_return_only_layer_when_layer_is_build( func_provider_mock.get.return_value = None funcprovider = SamFunctionProviderMock.return_value = func_provider_mock - layer1 = DummyLayer("layer1", "python3.8") + layer1 = DummyLayer("layer1", "python3.9") layer_provider_mock = Mock() layer_provider_mock.get.return_value = layer1 layerprovider = SamLayerProviderMock.return_value = layer_provider_mock @@ -303,7 +303,7 @@ def test_must_return_buildable_dependent_layer_when_function_is_build( stack.template_dict = template_dict get_buildable_stacks_mock.return_value = ([stack], []) - layer1 = DummyLayer("layer1", "python3.8") + layer1 = DummyLayer("layer1", "python3.9") layer2 = DummyLayer("layer2", None) layer_provider_mock = Mock() layer_provider_mock.get.return_value = layer1 @@ -699,7 +699,7 @@ def test_run_sync_build_context( builder_mock.update_template.side_effect = [modified_template_root, modified_template_child] get_buildable_stacks_mock.return_value = ([root_stack, child_stack], []) - layer1 = DummyLayer("layer1", "python3.8") + layer1 = DummyLayer("layer1", "python3.9") layer_provider_mock = Mock() layer_provider_mock.get.return_value = layer1 layerprovider = SamLayerProviderMock.return_value = layer_provider_mock @@ -960,7 +960,7 @@ def test_run_build_context( builder_mock.update_template.side_effect = [modified_template_root, modified_template_child] get_buildable_stacks_mock.return_value = ([root_stack, child_stack], []) - layer1 = DummyLayer("layer1", "python3.8") + layer1 = DummyLayer("layer1", "python3.9") layer_provider_mock = Mock() layer_provider_mock.get.return_value = layer1 layerprovider = SamLayerProviderMock.return_value = layer_provider_mock @@ -1134,7 +1134,7 @@ def test_must_catch_known_exceptions( builder_mock.update_template.side_effect = [modified_template_root, modified_template_child] get_buildable_stacks_mock.return_value = ([stack], []) - layer1 = DummyLayer("layer1", "python3.8") + layer1 = DummyLayer("layer1", "python3.9") layer_provider_mock = Mock() layer_provider_mock.get.return_value = layer1 layerprovider = SamLayerProviderMock.return_value = layer_provider_mock @@ -1212,7 +1212,7 @@ def test_must_catch_function_not_found_exception( builder_mock.update_template.side_effect = [modified_template_root, modified_template_child] get_buildable_stacks_mock.return_value = ([stack], []) - layer1 = DummyLayer("layer1", "python3.8") + layer1 = DummyLayer("layer1", "python3.9") layer_provider_mock = Mock() layer_provider_mock.get.return_value = layer1 layerprovider = SamLayerProviderMock.return_value = layer_provider_mock diff --git a/tests/unit/commands/buildcmd/test_utils.py b/tests/unit/commands/buildcmd/test_utils.py index 2784f7c78c..314b964502 100644 --- a/tests/unit/commands/buildcmd/test_utils.py +++ b/tests/unit/commands/buildcmd/test_utils.py @@ -18,7 +18,7 @@ def test_must_prompt_for_layer(self, prompt_mock): # dotnet6 need write permissions metadata1 = {"BuildMethod": "dotnet6"} - metadata2 = {"BuildMethod": "python3.8"} + metadata2 = {"BuildMethod": "python3.9"} layer1 = LayerVersion( "layer1", codeuri="codeuri", @@ -35,7 +35,7 @@ def test_must_prompt_for_layer(self, prompt_mock): function_id="function_id", name="logical_id", functionname="function_name", - runtime="python3.8", + runtime="python3.9", memory=1234, timeout=12, handler="handler", @@ -68,7 +68,7 @@ def test_must_prompt_for_layer(self, prompt_mock): def test_must_prompt_for_function(self, prompt_mock): base_dir = "/mybase" - metadata = {"BuildMethod": "python3.8"} + metadata = {"BuildMethod": "python3.9"} layer1 = LayerVersion( "layer1", codeuri="codeuri", @@ -118,7 +118,7 @@ def test_must_prompt_for_function(self, prompt_mock): def test_must_prompt_for_function_with_specified_workflow(self, prompt_mock): base_dir = "/mybase" - metadata1 = {"BuildMethod": "python3.8"} + metadata1 = {"BuildMethod": "python3.9"} layer1 = LayerVersion( "layer1", codeuri="codeuri", @@ -170,7 +170,7 @@ def test_must_prompt_for_function_with_specified_workflow(self, prompt_mock): def test_must_not_prompt_for_image_function(self, prompt_mock): base_dir = "/mybase" - metadata = {"BuildMethod": "python3.8"} + metadata = {"BuildMethod": "python3.9"} layer1 = LayerVersion( "layer1", codeuri="codeuri", @@ -220,7 +220,7 @@ def test_must_not_prompt_for_image_function(self, prompt_mock): def test_must_not_prompt(self, prompt_mock): base_dir = "/mybase" - metadata = {"BuildMethod": "python3.8"} + metadata = {"BuildMethod": "python3.9"} layer1 = LayerVersion( "layer1", codeuri="codeuri", @@ -237,7 +237,7 @@ def test_must_not_prompt(self, prompt_mock): function_id="function_id", name="logical_id", functionname="function_name", - runtime="python3.8", + runtime="python3.9", memory=1234, timeout=12, handler="handler", diff --git a/tests/unit/commands/init/test_cli.py b/tests/unit/commands/init/test_cli.py index 1e6bfd3a9a..b900e018cb 100644 --- a/tests/unit/commands/init/test_cli.py +++ b/tests/unit/commands/init/test_cli.py @@ -47,6 +47,9 @@ def __init__(self, no_interactive=False): class TestCli(TestCase): + + maxDiff = None + def setUp(self): self.ctx = None self.no_interactive = True @@ -1669,7 +1672,7 @@ def test_init_cli_no_package_type(self, generate_project_patch, git_repo_clone_m "--name", "untitled6", "--base-image", - "amazon/python3.8-base", + "amazon/python3.9-base", "--dependency-manager", "pip", "--no-structured-logging", @@ -1680,7 +1683,7 @@ def test_init_cli_no_package_type(self, generate_project_patch, git_repo_clone_m # THEN we should receive no errors self.assertFalse(result.exception) generate_project_patch.assert_called_once_with( - ANY, IMAGE, "python3.8", "pip", ".", "untitled6", True, ANY, False, False, False + ANY, IMAGE, "python3.9", "pip", ".", "untitled6", True, ANY, False, False, False ) @patch.object(InitTemplates, "__init__", MockInitTemplates.__init__) @@ -1691,14 +1694,14 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_bu ): init_options_from_manifest_mock.return_value = [ { - "directory": "python3.8-image/cookiecutter-aws-sam-hello-python-lambda-image", + "directory": "python3.9-image/cookiecutter-aws-sam-hello-python-lambda-image", "displayName": "Hello World Lambda Image Example", "dependencyManager": "pip", "appTemplate": "hello-world-lambda-image", "packageType": "Image", }, { - "directory": "python3.8-image/cookiecutter-ml-apigw-pytorch", + "directory": "python3.9-image/cookiecutter-ml-apigw-pytorch", "displayName": "PyTorch Machine Learning Inference API", "dependencyManager": "pip", "appTemplate": "ml-apigw-pytorch", @@ -1712,7 +1715,7 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_bu pt_explicit=self.pt_explicit, package_type="Image", architecture=None, - base_image="amazon/python3.8-base", + base_image="amazon/python3.9-base", dependency_manager="pip", app_template=None, name=self.name, @@ -1734,14 +1737,14 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_an ): init_options_from_manifest_mock.return_value = [ { - "directory": "python3.8-image/cookiecutter-aws-sam-hello-python-lambda-image", + "directory": "python3.9-image/cookiecutter-aws-sam-hello-python-lambda-image", "displayName": "Hello World Lambda Image Example", "dependencyManager": "pip", "appTemplate": "hello-world-lambda-image", "packageType": "Image", }, { - "directory": "python3.8-image/cookiecutter-ml-apigw-pytorch", + "directory": "python3.9-image/cookiecutter-ml-apigw-pytorch", "displayName": "PyTorch Machine Learning Inference API", "dependencyManager": "pip", "appTemplate": "ml-apigw-pytorch", @@ -1755,7 +1758,7 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_an pt_explicit=self.pt_explicit, package_type="Image", architecture=X86_64, - base_image="amazon/python3.8-base", + base_image="amazon/python3.9-base", dependency_manager="pip", app_template="Not-ml-apigw-pytorch", # different value than appTemplates shown in the manifest above name=self.name, @@ -1779,14 +1782,14 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_wi ): init_options_from_manifest_mock.return_value = [ { - "directory": "python3.8-image/cookiecutter-aws-sam-hello-python-lambda-image", + "directory": "python3.9-image/cookiecutter-aws-sam-hello-python-lambda-image", "displayName": "Hello World Lambda Image Example", "dependencyManager": "pip", "appTemplate": "hello-world-lambda-image", "packageType": "Image", }, { - "directory": "python3.8-image/cookiecutter-ml-apigw-pytorch", + "directory": "python3.9-image/cookiecutter-ml-apigw-pytorch", "displayName": "PyTorch Machine Learning Inference API", "dependencyManager": "pip", "appTemplate": "ml-apigw-pytorch", @@ -1799,7 +1802,7 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_wi pt_explicit=True, package_type="Image", architecture=None, - base_image="amazon/python3.8-base", + base_image="amazon/python3.9-base", dependency_manager="pip", app_template="ml-apigw-pytorch", # same value as one appTemplate in the manifest above name=self.name, @@ -1815,7 +1818,7 @@ def test_init_cli_image_pool_with_base_image_having_multiple_managed_template_wi generate_project_patch.assert_called_once_with( ANY, # location "Image", # package_type - "python3.8", # runtime + "python3.9", # runtime "pip", # dependency_manager self.output_dir, self.name, @@ -1836,7 +1839,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_does_no ): init_options_from_manifest_mock.return_value = [ { - "directory": "python3.8-image/cookiecutter-ml-apigw-pytorch", + "directory": "python3.9-image/cookiecutter-ml-apigw-pytorch", "displayName": "PyTorch Machine Learning Inference API", "dependencyManager": "pip", "appTemplate": "ml-apigw-pytorch", @@ -1848,7 +1851,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_does_no no_interactive=True, pt_explicit=True, package_type="Image", - base_image="amazon/python3.8-base", + base_image="amazon/python3.9-base", dependency_manager="pip", app_template=None, name=self.name, @@ -1865,7 +1868,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_does_no generate_project_patch.assert_called_once_with( ANY, # location "Image", # package_type - "python3.8", # runtime + "python3.9", # runtime "pip", # dependency_manager self.output_dir, self.name, @@ -1886,7 +1889,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_with_pr ): init_options_from_manifest_mock.return_value = [ { - "directory": "python3.8-image/cookiecutter-ml-apigw-pytorch", + "directory": "python3.9-image/cookiecutter-ml-apigw-pytorch", "displayName": "PyTorch Machine Learning Inference API", "dependencyManager": "pip", "appTemplate": "ml-apigw-pytorch", @@ -1898,7 +1901,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_with_pr no_interactive=True, pt_explicit=True, package_type="Image", - base_image="amazon/python3.8-base", + base_image="amazon/python3.9-base", dependency_manager="pip", app_template="ml-apigw-pytorch", # same value as appTemplate indicated in the manifest above name=self.name, @@ -1915,7 +1918,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_with_pr generate_project_patch.assert_called_once_with( ANY, # location "Image", # package_type - "python3.8", # runtime + "python3.9", # runtime "pip", # dependency_manager self.output_dir, self.name, @@ -1936,7 +1939,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_with_pr ): init_options_from_manifest_mock.return_value = [ { - "directory": "python3.8-image/cookiecutter-ml-apigw-pytorch", + "directory": "python3.9-image/cookiecutter-ml-apigw-pytorch", "displayName": "PyTorch Machine Learning Inference API", "dependencyManager": "pip", "appTemplate": "ml-apigw-pytorch", @@ -1949,7 +1952,7 @@ def test_init_cli_image_pool_with_base_image_having_one_managed_template_with_pr no_interactive=True, pt_explicit=True, package_type="Image", - base_image="amazon/python3.8-base", + base_image="amazon/python3.9-base", dependency_manager="pip", app_template="NOT-ml-apigw-pytorch", # different value than appTemplate shown in the manifest above name=self.name, @@ -2185,7 +2188,7 @@ def test_must_return_runtime_from_base_image_name(self): "amazon/go1.x-base", "amazon/java11-base", "amazon/nodejs20.x-base", - "amazon/python3.8-base", + "amazon/python3.9-base", "amazon/go-provided.al2-base", "amazon/ruby3.2-base", ] @@ -2195,7 +2198,7 @@ def test_must_return_runtime_from_base_image_name(self): "go1.x", "java11", "nodejs20.x", - "python3.8", + "python3.9", "go (provided.al2)", "ruby3.2", ] @@ -2266,10 +2269,10 @@ def test_must_process_manifest(self, _get_manifest_mock): } ] }, - "python3.8": { + "python3.9": { "Image": [ { - "directory": "python3.8-image/cookiecutter-aws-sam-hello-python-lambda-image", + "directory": "python3.9-image/cookiecutter-aws-sam-hello-python-lambda-image", "displayName": "Hello World Lambda Image Example", "dependencyManager": "pip", "appTemplate": "hello-world-lambda-image", diff --git a/tests/unit/commands/init/test_manifest.json b/tests/unit/commands/init/test_manifest.json index 05a3938dda..d7776ca90f 100644 --- a/tests/unit/commands/init/test_manifest.json +++ b/tests/unit/commands/init/test_manifest.json @@ -29,9 +29,9 @@ "useCaseName": "Hello World Example" } ], - "amazon/python3.8-base": [ + "amazon/python3.9-base": [ { - "directory": "python3.8-image/cookiecutter-aws-sam-hello-python-lambda-image", + "directory": "python3.9-image/cookiecutter-aws-sam-hello-python-lambda-image", "displayName": "Hello World Lambda Image Example", "dependencyManager": "pip", "appTemplate": "hello-world-lambda-image", diff --git a/tests/unit/commands/list/endpoints/test_endpoints_context.py b/tests/unit/commands/list/endpoints/test_endpoints_context.py index 55daa4bee0..e3e4153ebf 100644 --- a/tests/unit/commands/list/endpoints/test_endpoints_context.py +++ b/tests/unit/commands/list/endpoints/test_endpoints_context.py @@ -24,7 +24,7 @@ "Code": {"S3Bucket": "bucket", "S3Key": "value"}, "Handler": "app.lambda_handler", "Role": {"Fn::GetAtt": ["HelloWorldFunctionRole", "Arn"]}, - "Runtime": "python3.8", + "Runtime": "python3.9", "Tags": [{"Key": "lambda:createdBy", "Value": "SAM"}], "Timeout": 3, "TracingConfig": {"Mode": "Active"}, @@ -125,7 +125,7 @@ "Code": {"S3Bucket": "bucket", "S3Key": "value"}, "Handler": "app.lambda_handler", "Role": {"Fn::GetAtt": ["HelloWorldFunctionRole", "Arn"]}, - "Runtime": "python3.8", + "Runtime": "python3.9", "Tags": [{"Key": "lambda:createdBy", "Value": "SAM"}], "Timeout": 3, "TracingConfig": {"Mode": "Active"}, @@ -451,7 +451,7 @@ "CodeUri": "hello_world/", "Handler": "app.lambda_handler", "Architectures": ["x86_64"], - "Runtime": "python3.8", + "Runtime": "python3.9", "Events": {"HelloWorld": {"Type": "Api", "Properties": {"Path": "/hello", "Method": "get"}}}, }, } diff --git a/tests/unit/commands/list/resources/test_resources_context.py b/tests/unit/commands/list/resources/test_resources_context.py index 298aef8d53..7a28e5a9f7 100644 --- a/tests/unit/commands/list/resources/test_resources_context.py +++ b/tests/unit/commands/list/resources/test_resources_context.py @@ -32,7 +32,7 @@ "Code": {"S3Bucket": "bucket", "S3Key": "value"}, "Handler": "app.lambda_handler", "Role": {"Fn::GetAtt": ["HelloWorldFunctionRole", "Arn"]}, - "Runtime": "python3.8", + "Runtime": "python3.9", "Tags": [{"Key": "lambda:createdBy", "Value": "SAM"}], "Timeout": 3, "TracingConfig": {"Mode": "Active"}, @@ -127,7 +127,7 @@ "CodeUri": "hello_world/", "Handler": "app.lambda_handler", "Architectures": ["x86_64"], - "Runtime": "python3.8", + "Runtime": "python3.9", "Events": {"HelloWorld": {"Type": "Api", "Properties": {"Path": "/hello", "Method": "get"}}}, }, } @@ -319,7 +319,7 @@ def test_get_translate_dict_invalid_template_error( "CodeUri": "hello_world/", "Handler": "app.lambda_handler", "Architectures": ["x86_64"], - "Runtime": "python3.8", + "Runtime": "python3.9", "Events": {"HelloWorld": {"Type": "Api", "Properties": {"Path": "/hello", "Method": "get"}}}, }, } 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 9143a1a43e..235d46d989 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/prepare_base.py @@ -274,7 +274,7 @@ def setUp(self) -> None: "environment": [{"variables": {"hi": "there"}}], "handler": "index.handler2", "package_type": "Zip", - "runtime": "python3.8", + "runtime": "python3.9", "layers": ["layer_arn"], "filename": "file2.zip", } @@ -292,7 +292,7 @@ def setUp(self) -> None: "Environment": {"Variables": {"hi": "there"}}, "Handler": "index.handler2", "PackageType": "Zip", - "Runtime": "python3.8", + "Runtime": "python3.9", "Layers": ["layer_arn"], "Code": "file2.zip", } 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 55c98bc2a2..718598c2de 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/test_enrich.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/test_enrich.py @@ -1203,10 +1203,7 @@ 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.8")], "python3"), - ([Mock(stdout="Python 3.8.0")], "python3"), - ([Mock(stdout="Python 3.8.12")], "python3"), + ([CalledProcessError(-2, "python3 --version"), Mock(stdout="Python 3.9.12")], "py3"), ([Mock(stdout="Python 3.9")], "python3"), ([Mock(stdout="Python 3.9.0")], "python3"), ([Mock(stdout="Python 3.9.12")], "python3"), 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 d8a02e854b..8fc31bcb62 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 @@ -1539,7 +1539,7 @@ def test_link_resources(self): "Code": {"S3Bucket": "lambda_code_bucket", "S3Key": "remote_lambda_code_key"}, "Handler": "app.lambda_handler", "PackageType": "Zip", - "Runtime": "python3.8", + "Runtime": "python3.9", "Timeout": 3, }, "Metadata": {"SamResourceId": "aws_lambda_function.remote_lambda_code", "SkipBuild": True}, @@ -1553,7 +1553,7 @@ def test_link_resources(self): "Code": "HelloWorldFunction.zip", "Handler": "app.lambda_handler", "PackageType": "Zip", - "Runtime": "python3.8", + "Runtime": "python3.9", "Timeout": 3, }, "Metadata": {"SamResourceId": "aws_lambda_function.root_lambda", "SkipBuild": True}, @@ -1606,7 +1606,7 @@ def test_link_lambda_functions_to_layers( "Code": {"S3Bucket": "lambda_code_bucket", "S3Key": "remote_lambda_code_key"}, "Handler": "app.lambda_handler", "PackageType": "Zip", - "Runtime": "python3.8", + "Runtime": "python3.9", "Timeout": 3, }, "Metadata": {"SamResourceId": "aws_lambda_function.remote_lambda_code", "SkipBuild": True}, @@ -1620,7 +1620,7 @@ def test_link_lambda_functions_to_layers( "Code": "HelloWorldFunction.zip", "Handler": "app.lambda_handler", "PackageType": "Zip", - "Runtime": "python3.8", + "Runtime": "python3.9", "Timeout": 3, }, "Metadata": {"SamResourceId": "aws_lambda_function.root_lambda", "SkipBuild": True}, 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 01a5fd19ae..220d306538 100644 --- a/tests/unit/hook_packages/terraform/hooks/prepare/test_translate.py +++ b/tests/unit/hook_packages/terraform/hooks/prepare/test_translate.py @@ -355,7 +355,7 @@ def test_translate_to_cfn_with_root_module_with_sam_metadata_resource( "Code": "file2.zip", "Handler": "index.handler2", "PackageType": "Zip", - "Runtime": "python3.8", + "Runtime": "python3.9", "Layers": ["layer_arn"], }, {}, diff --git a/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py b/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py index 1c9bdaa1b3..c34f55894f 100644 --- a/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py +++ b/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py @@ -83,7 +83,7 @@ def test_no_function_build_definition(self): resources = { "MyFunction": { "Type": AWS_SERVERLESS_FUNCTION, - "Properties": {"Runtime": "python3.8", "Handler": "FakeHandler"}, + "Properties": {"Runtime": "python3.9", "Handler": "FakeHandler"}, } } self.stack.resources = resources @@ -102,7 +102,7 @@ def test_function_build_definition_without_dependencies_dir(self): resources = { "MyFunction": { "Type": AWS_SERVERLESS_FUNCTION, - "Properties": {"Runtime": "python3.8", "Handler": "FakeHandler"}, + "Properties": {"Runtime": "python3.9", "Handler": "FakeHandler"}, } } self.stack.resources = resources @@ -124,7 +124,7 @@ def test_with_zip_function(self, patched_isdir, patched_osutils, patched_move_te resources = { "MyFunction": { "Type": AWS_SERVERLESS_FUNCTION, - "Properties": {"Runtime": "python3.8", "Handler": "FakeHandler"}, + "Properties": {"Runtime": "python3.9", "Handler": "FakeHandler"}, } } self.stack.resources = resources @@ -241,6 +241,6 @@ def test_skipping_dependency_copy_when_function_has_no_dependencies( patched_osutils.copytree.assert_not_called() patched_add_layer_readme.assert_called_with(str(layer_root_folder), function_logical_id) - @parameterized.expand([("python3.8", True), ("ruby3.2", False)]) + @parameterized.expand([("python3.9", True), ("ruby3.2", False)]) def test_is_runtime_supported(self, runtime, supported): self.assertEqual(NestedStackManager.is_runtime_supported(runtime), supported) diff --git a/tests/unit/lib/build_module/test_app_builder.py b/tests/unit/lib/build_module/test_app_builder.py index e2f15ebe22..3c1d8f7041 100644 --- a/tests/unit/lib/build_module/test_app_builder.py +++ b/tests/unit/lib/build_module/test_app_builder.py @@ -476,6 +476,7 @@ def test_must_raise_for_functions_with_multi_architecture(self, persist_mock, re ("python2.7",), ("python3.6",), ("python3.7",), + ("python3.8",), ("ruby2.5",), ("ruby2.7",), ("nodejs10.x",), @@ -588,7 +589,7 @@ def test_must_build_layer_in_process(self, get_layer_subfolder_mock, osutils_moc build_function_in_process_mock = Mock() self.builder._build_function_in_process = build_function_in_process_mock - self.builder._build_layer("layer_name", "code_uri", "python3.8", ["python3.8"], ARM64, "full_path") + self.builder._build_layer("layer_name", "code_uri", "python3.9", ["python3.9"], ARM64, "full_path") build_function_in_process_mock.assert_called_once_with( config_mock, @@ -596,7 +597,7 @@ def test_must_build_layer_in_process(self, get_layer_subfolder_mock, osutils_moc PathValidator("python"), "scratch", PathValidator("manifest_name"), - "python3.8", + "python3.9", ARM64, None, None, @@ -679,7 +680,7 @@ def test_must_custom_build_layer_with_custom_working_dir_metadata_in_process( ApplicationBuilder._get_build_options = get_build_options_mock builder._build_function_in_process = build_function_in_process_mock builder._build_layer( - "layer_name", "code_uri", "provided", ["python3.8"], ARM64, "full_path", layer_metadata=metadata + "layer_name", "code_uri", "provided", ["python3.9"], ARM64, "full_path", layer_metadata=metadata ) ApplicationBuilder._get_build_options = get_build_options @@ -745,7 +746,7 @@ def test_must_custom_build_layer_with_custom_makefile_and_custom_project_root_me ApplicationBuilder._get_build_options = get_build_options_mock builder._build_function_in_process = build_function_in_process_mock builder._build_layer( - "layer_name", "code_uri", "provided", ["python3.8"], ARM64, "full_path", layer_metadata=metadata + "layer_name", "code_uri", "provided", ["python3.9"], ARM64, "full_path", layer_metadata=metadata ) ApplicationBuilder._get_build_options = get_build_options @@ -813,7 +814,7 @@ def test_must_custom_build_layer_with_all_metadata_in_process( ApplicationBuilder._get_build_options = get_build_options_mock builder._build_function_in_process = build_function_in_process_mock builder._build_layer( - "layer_name", "code_uri", "provided", ["python3.8"], ARM64, "full_path", layer_metadata=metadata + "layer_name", "code_uri", "provided", ["python3.9"], ARM64, "full_path", layer_metadata=metadata ) ApplicationBuilder._get_build_options = get_build_options @@ -878,7 +879,7 @@ def test_must_custom_build_layer_with_context_path_metadata_in_process( ApplicationBuilder._get_build_options = get_build_options_mock builder._build_function_in_process = build_function_in_process_mock builder._build_layer( - "layer_name", "code_uri", "provided", ["python3.8"], ARM64, "full_path", layer_metadata=metadata + "layer_name", "code_uri", "provided", ["python3.9"], ARM64, "full_path", layer_metadata=metadata ) ApplicationBuilder._get_build_options = get_build_options @@ -943,7 +944,7 @@ def test_must_custom_build_layer_with_project_root_directory_only_metadata_in_pr ApplicationBuilder._get_build_options = get_build_options_mock builder._build_function_in_process = build_function_in_process_mock builder._build_layer( - "layer_name", "code_uri", "provided", ["python3.8"], ARM64, "full_path", layer_metadata=metadata + "layer_name", "code_uri", "provided", ["python3.9"], ARM64, "full_path", layer_metadata=metadata ) ApplicationBuilder._get_build_options = get_build_options @@ -1006,7 +1007,7 @@ def test_must_custom_build_layer_with_empty_metadata_in_process( ApplicationBuilder._get_build_options = get_build_options_mock builder._build_function_in_process = build_function_in_process_mock builder._build_layer( - "layer_name", "code_uri", "provided", ["python3.8"], ARM64, "full_path", layer_metadata=metadata + "layer_name", "code_uri", "provided", ["python3.9"], ARM64, "full_path", layer_metadata=metadata ) ApplicationBuilder._get_build_options = get_build_options @@ -1052,13 +1053,13 @@ def test_must_build_layer_in_container(self, get_layer_subfolder_mock, osutils_m build_function_on_container_mock = Mock() self.builder._build_function_on_container = build_function_on_container_mock - self.builder._build_layer("layer_name", "code_uri", "python3.8", ["python3.8"], X86_64, "full_path") + self.builder._build_layer("layer_name", "code_uri", "python3.9", ["python3.9"], X86_64, "full_path") build_function_on_container_mock.assert_called_once_with( config_mock, PathValidator("code_uri"), PathValidator("python"), PathValidator("manifest_name"), - "python3.8", + "python3.9", X86_64, None, None, @@ -1088,13 +1089,13 @@ def test_must_build_layer_in_container_with_global_build_image( build_images = {None: "test_image"} self.builder._build_images = build_images self.builder._build_function_on_container = build_function_on_container_mock - self.builder._build_layer("layer_name", "code_uri", "python3.8", ["python3.8"], X86_64, "full_path") + self.builder._build_layer("layer_name", "code_uri", "python3.9", ["python3.9"], X86_64, "full_path") build_function_on_container_mock.assert_called_once_with( config_mock, PathValidator("code_uri"), PathValidator("python"), PathValidator("manifest_name"), - "python3.8", + "python3.9", X86_64, None, None, @@ -1124,13 +1125,13 @@ def test_must_build_layer_in_container_with_specific_build_image( build_images = {"layer_name": "test_image"} self.builder._build_images = build_images self.builder._build_function_on_container = build_function_on_container_mock - self.builder._build_layer("layer_name", "code_uri", "python3.8", ["python3.8"], ARM64, "full_path") + self.builder._build_layer("layer_name", "code_uri", "python3.9", ["python3.9"], ARM64, "full_path") build_function_on_container_mock.assert_called_once_with( config_mock, PathValidator("code_uri"), PathValidator("python"), PathValidator("manifest_name"), - "python3.8", + "python3.9", ARM64, None, None, @@ -1163,19 +1164,19 @@ def test_must_build_layer_in_container_with_specified_workflow_if_supported( self.builder._build_function_on_container = build_function_on_container_mock supports_specified_workflow_mock.return_value = True - self.builder._build_layer("layer_name", "code_uri", "python3.8", ["python3.8"], ARM64, "full_path") + self.builder._build_layer("layer_name", "code_uri", "python3.9", ["python3.9"], ARM64, "full_path") build_function_on_container_mock.assert_called_once_with( config_mock, PathValidator("code_uri"), PathValidator("python"), PathValidator("manifest_name"), - "python3.8", + "python3.9", ARM64, None, None, "test_image", is_building_layer=True, - specified_workflow="python3.8", + specified_workflow="python3.9", ) @@ -1237,12 +1238,12 @@ def setUp(self): "MyServerlessLayer": { "Type": "AWS::Serverless::LayerVersion", "Properties": {"ContentUri": "oldvalue"}, - "Metadata": {"BuildMethod": "python3.8"}, + "Metadata": {"BuildMethod": "python3.9"}, }, "MyLambdaLayer": { "Type": "AWS::Lambda::LayerVersion", "Properties": {"Content": "oldvalue"}, - "Metadata": {"BuildMethod": "python3.8"}, + "Metadata": {"BuildMethod": "python3.9"}, }, } } @@ -1313,12 +1314,12 @@ def test_must_update_resources_with_build_artifacts(self): "MyServerlessLayer": { "Type": "AWS::Serverless::LayerVersion", "Properties": {"ContentUri": os.path.join("build", "ServerlessLayer")}, - "Metadata": {"BuildMethod": "python3.8"}, + "Metadata": {"BuildMethod": "python3.9"}, }, "MyLambdaLayer": { "Type": "AWS::Lambda::LayerVersion", "Properties": {"Content": os.path.join("build", "LambdaLayer")}, - "Metadata": {"BuildMethod": "python3.8"}, + "Metadata": {"BuildMethod": "python3.9"}, }, } } @@ -1417,12 +1418,12 @@ def test_must_update_resources_with_build_artifacts_and_template_paths_in_multi_ "MyServerlessLayer": { "Type": "AWS::Serverless::LayerVersion", "Properties": {"ContentUri": os.path.join("build", "ChildStackXXX", "ServerlessLayer")}, - "Metadata": {"BuildMethod": "python3.8"}, + "Metadata": {"BuildMethod": "python3.9"}, }, "MyLambdaLayer": { "Type": "AWS::Lambda::LayerVersion", "Properties": {"Content": os.path.join("build", "ChildStackXXX", "LambdaLayer")}, - "Metadata": {"BuildMethod": "python3.8"}, + "Metadata": {"BuildMethod": "python3.9"}, }, } } diff --git a/tests/unit/lib/build_module/test_build_graph.py b/tests/unit/lib/build_module/test_build_graph.py index 898e7a965d..93d5103c70 100644 --- a/tests/unit/lib/build_module/test_build_graph.py +++ b/tests/unit/lib/build_module/test_build_graph.py @@ -288,7 +288,7 @@ class TestBuildGraph(TestCase): LAYER_CODEURI = "sum_layer/" LAYER_NAME = "SumLayer" ZIP = ZIP - RUNTIME = "python3.8" + RUNTIME = "python3.9" LAYER_RUNTIME = "nodejs20.x" METADATA = {"Test": "hello", "Test2": "world"} UUID = "3c1c254e-cd4b-4d94-8c74-7ab870b36063" diff --git a/tests/unit/lib/build_module/test_build_strategy.py b/tests/unit/lib/build_module/test_build_strategy.py index c0ecedb125..710367403b 100644 --- a/tests/unit/lib/build_module/test_build_strategy.py +++ b/tests/unit/lib/build_module/test_build_strategy.py @@ -345,7 +345,7 @@ def test_build_single_function_definition_image_functions_with_same_metadata(sel class CachedBuildStrategyTest(BuildStrategyBaseTest): CODEURI = "hello_world_python/" - RUNTIME = "python3.8" + RUNTIME = "python3.9" FUNCTION_UUID = "3c1c254e-cd4b-4d94-8c74-7ab870b36063" SOURCE_HASH = "cae49aa393d669e850bd49869905099d" LAYER_UUID = "761ce752-d1c8-4e07-86a0-f64778cdd108" diff --git a/tests/unit/lib/build_module/test_workflow_config.py b/tests/unit/lib/build_module/test_workflow_config.py index c6dc46f8a8..0ed6d444a1 100644 --- a/tests/unit/lib/build_module/test_workflow_config.py +++ b/tests/unit/lib/build_module/test_workflow_config.py @@ -16,9 +16,7 @@ def setUp(self): self.project_dir = "" EventTracker.clear_trackers() - @parameterized.expand( - [("python3.8",), ("python3.9",), ("python3.10",), ("python3.11",), ("python3.12",), ("python3.13",)] - ) + @parameterized.expand([("python3.9",), ("python3.10",), ("python3.11",), ("python3.12",), ("python3.13",)]) 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/iac/cfn/test_data/stack.yaml b/tests/unit/lib/iac/cfn/test_data/stack.yaml index e0bad862e5..a97529ed2e 100644 --- a/tests/unit/lib/iac/cfn/test_data/stack.yaml +++ b/tests/unit/lib/iac/cfn/test_data/stack.yaml @@ -7,4 +7,4 @@ Resources: Properties: CodeUri: . Handler: main.handler - Runtime: python3.8 + Runtime: python3.9 diff --git a/tests/unit/lib/sync/test_sync_flow_factory.py b/tests/unit/lib/sync/test_sync_flow_factory.py index 92d30c8a09..d3c1b07163 100644 --- a/tests/unit/lib/sync/test_sync_flow_factory.py +++ b/tests/unit/lib/sync/test_sync_flow_factory.py @@ -119,7 +119,7 @@ def test_create_lambda_flow_zip_with_auto_dependency_layer( ): build_context = MagicMock() build_context.function_provider.get.return_value = Mock( - packagetype=ZIP, build_info=FunctionBuildInfo.BuildableZip, runtime="python3.8" + packagetype=ZIP, build_info=FunctionBuildInfo.BuildableZip, runtime="python3.9" ) factory = self.create_factory(True, build_context=build_context) result = factory._create_lambda_flow("Function1", pre_build_artifacts) diff --git a/tests/unit/lib/utils/test_architecture.py b/tests/unit/lib/utils/test_architecture.py index b97183862b..07111970d9 100644 --- a/tests/unit/lib/utils/test_architecture.py +++ b/tests/unit/lib/utils/test_architecture.py @@ -72,6 +72,6 @@ def test_must_raise_for_unsupported_runtime_architecture(self, runtime, arch): self.assertEqual(str(ex.exception), f"Runtime {runtime} is not supported on '{arch}' architecture") - @parameterized.expand([("python3.8", True), ("python3.9", True)]) + @parameterized.expand([("python3.9", True)]) def test_multi_arch_image(self, runtime, result): self.assertEqual(has_runtime_multi_arch_image(runtime), result) diff --git a/tests/unit/local/docker/test_lambda_container.py b/tests/unit/local/docker/test_lambda_container.py index 2384a81fa0..1e051189ff 100644 --- a/tests/unit/local/docker/test_lambda_container.py +++ b/tests/unit/local/docker/test_lambda_container.py @@ -21,7 +21,6 @@ Runtime.nodejs18x.value, Runtime.nodejs20x.value, Runtime.nodejs22x.value, - Runtime.python38.value, Runtime.python39.value, Runtime.python310.value, Runtime.python311.value, diff --git a/tests/unit/local/docker/test_lambda_debug_settings.py b/tests/unit/local/docker/test_lambda_debug_settings.py index 67914bd090..44682a0da8 100644 --- a/tests/unit/local/docker/test_lambda_debug_settings.py +++ b/tests/unit/local/docker/test_lambda_debug_settings.py @@ -17,7 +17,6 @@ Runtime.nodejs18x, Runtime.nodejs20x, Runtime.nodejs22x, - Runtime.python38, Runtime.python39, Runtime.python310, Runtime.python311, diff --git a/tests/unit/local/lambdafn/test_runtime.py b/tests/unit/local/lambdafn/test_runtime.py index 1df3e24ada..2f09e7d892 100644 --- a/tests/unit/local/lambdafn/test_runtime.py +++ b/tests/unit/local/lambdafn/test_runtime.py @@ -1238,7 +1238,7 @@ def test_function_should_reloaded_if_runtime_changed(self): updated_func = FunctionConfig( "name", "stack/name", - "python3.8", + "python3.9", "app.handler", None, None,