Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove python 3.8 support #7908

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove python 3.9
  • Loading branch information
mbfreder committed Feb 28, 2025
commit 575a20b48b3958460507832d5ffbf70e920ba21b
2 changes: 0 additions & 2 deletions samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
@@ -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),
10 changes: 0 additions & 10 deletions samcli/lib/init/local_manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"project_name": "Name of the project",
"runtime": "python3.8",
"runtime": "python3.9",
"architectures": {
"value": [
"x86_64"
1 change: 0 additions & 1 deletion samcli/lib/utils/architecture.py
Original file line number Diff line number Diff line change
@@ -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],
5 changes: 1 addition & 4 deletions samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
@@ -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",
4 changes: 0 additions & 4 deletions samcli/local/docker/lambda_debug_settings.py
Original file line number Diff line number Diff line change
@@ -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,
1 change: 0 additions & 1 deletion samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 3 additions & 5 deletions schema/samcli.json
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Resources:
Properties:
CodeUri: s3://bucket/key
Handler: app.lambda_handler
Runtime: python3.8
Runtime: python3.9
Role:
Fn::GetAtt:
- HelloWorldFunctionRole
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ Resources:
Properties:
CodeUri: s3://bucket/key
Handler: code/handler
Runtime: python3.8
Runtime: python3.9
Events:
AllEvent:
Type: Api
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.8
Runtime: python3.9
InlineCode: foo
Handler: bar
Events:
Original file line number Diff line number Diff line change
@@ -4,5 +4,5 @@ Resources:
Properties:
CodeUri: s3://sam-demo-bucket/queues.zip
Handler: handlers.handler
Runtime: python3.8
Runtime: python3.9
Events:
Original file line number Diff line number Diff line change
@@ -12,24 +12,24 @@ Resources:
Properties:
CodeUri: s3://sam-demo-bucket/hello.zip
Handler: hello.handler
Runtime: python3.8
Runtime: python3.9
RuntimeManagementConfig:
UpdateRuntimeOn: Auto
MinimalFunctionWithManualRuntimeManagementConfig:
Type: AWS::Serverless::Function
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,15 +38,15 @@ Resources:
Properties:
CodeUri: s3://sam-demo-bucket/hello.zip
Handler: hello.handler
Runtime: python3.8
Runtime: python3.9
RuntimeManagementConfig:
UpdateRuntimeOn: !Ref RuntimeUpdateParam
FunctionWithIntrinsicRuntimeVersion:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://sam-demo-bucket/hello.zip
Handler: hello.handler
Runtime: python3.8
Runtime: python3.9
RuntimeManagementConfig:
UpdateRuntimeOn: !Ref RuntimeUpdateParam
RuntimeVersionArn: !Ref RuntimeVersionParam
Original file line number Diff line number Diff line change
@@ -7,4 +7,4 @@ Resources:
pass"
CodeUri: .
Handler: index.lambda_handler
Runtime: python3.8
Runtime: python3.9
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.8
Runtime: python3.9
Handler: foo
InlineCode: bar
Policies:
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ Resources:
OtherFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.8
Runtime: python3.9
Handler: foo
InlineCode: bar
Environment:
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions tests/functional/testdata/init/unknown_runtime/manifest-v2.json
Original file line number Diff line number Diff line change
@@ -18,15 +18,5 @@
"packageType": "Zip",
"useCaseName": "Hello World Example"
}
],
"python3.8": [
{
"directory": "python3.8/cookiecutter-aws-sam-hello",
"displayName": "Hello World Example",
"dependencyManager": "pip",
"appTemplate": "hello-world",
"packageType": "Zip",
"useCaseName": "Hello World Example"
}
]
}
Original file line number Diff line number Diff line change
@@ -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 %}
Original file line number Diff line number Diff line change
@@ -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 %}
Original file line number Diff line number Diff line change
@@ -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 %}
8 changes: 4 additions & 4 deletions tests/integration/buildcmd/test_build_cmd_python.py
Original file line number Diff line number Diff line change
@@ -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):
2 changes: 1 addition & 1 deletion tests/integration/deploy/test_managed_stack_deploy.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -599,7 +599,6 @@ Resources:
LambdaLayerVersion:
Properties:
CompatibleRuntimes:
- python3.8
- python3.9
ContentUri:
Bucket: <%REPO_BUCKET%>
Loading
Oops, something went wrong.