diff --git a/packages/core/src/eventSchemas/models/schemaCodeLangs.ts b/packages/core/src/eventSchemas/models/schemaCodeLangs.ts index d182a8fb704..c2bec2e29f6 100644 --- a/packages/core/src/eventSchemas/models/schemaCodeLangs.ts +++ b/packages/core/src/eventSchemas/models/schemaCodeLangs.ts @@ -54,7 +54,16 @@ export function getLanguageDetails(language: SchemaCodeLangs): { } export function supportsEventBridgeTemplates(runtime: Runtime): boolean { - return ['python3.7', 'python3.8', 'python3.9', 'python3.10', 'python3.11', 'python3.12', 'go1.x'].includes(runtime) + return [ + 'python3.7', + 'python3.8', + 'python3.9', + 'python3.10', + 'python3.11', + 'python3.12', + 'python3.13', + 'go1.x', + ].includes(runtime) } export function getApiValueForSchemasDownload(runtime: Runtime): string { diff --git a/packages/core/src/lambda/models/samLambdaRuntime.ts b/packages/core/src/lambda/models/samLambdaRuntime.ts index 5b97ef06e2a..70d679b2c1f 100644 --- a/packages/core/src/lambda/models/samLambdaRuntime.ts +++ b/packages/core/src/lambda/models/samLambdaRuntime.ts @@ -50,6 +50,7 @@ export function getNodeMajorVersion(version?: string): number | undefined { } export const pythonRuntimes: ImmutableSet = ImmutableSet([ + 'python3.13', 'python3.12', 'python3.11', 'python3.10', diff --git a/packages/core/src/shared/sam/debugger/pythonSamDebug.ts b/packages/core/src/shared/sam/debugger/pythonSamDebug.ts index a5ef2bc5864..45013eaaf96 100644 --- a/packages/core/src/shared/sam/debugger/pythonSamDebug.ts +++ b/packages/core/src/shared/sam/debugger/pythonSamDebug.ts @@ -263,6 +263,8 @@ function getPythonExeAndBootstrap(runtime: Runtime) { return { python: '/var/lang/bin/python3.11', bootstrap: '/var/runtime/bootstrap.py' } case 'python3.12': return { python: '/var/lang/bin/python3.12', bootstrap: '/var/runtime/bootstrap.py' } + case 'python3.13': + return { python: '/var/lang/bin/python3.13', bootstrap: '/var/runtime/bootstrap.py' } default: throw new Error(`Python SAM debug logic ran for invalid Python runtime: ${runtime}`) } diff --git a/packages/core/src/test/eventSchemas/model/schemaCodeLangs.test.ts b/packages/core/src/test/eventSchemas/model/schemaCodeLangs.test.ts index ccee1dd4099..619f7bd035e 100644 --- a/packages/core/src/test/eventSchemas/model/schemaCodeLangs.test.ts +++ b/packages/core/src/test/eventSchemas/model/schemaCodeLangs.test.ts @@ -32,6 +32,7 @@ describe('getApiValueForSchemasDownload', function () { case 'python3.9': case 'python3.11': case 'python3.12': + case 'python3.13': case 'python3.10': { const result = getApiValueForSchemasDownload(runtime) assert.strictEqual(result, 'Python36', 'Api value used by schemas api') diff --git a/packages/core/src/test/lambda/models/samLambdaRuntime.test.ts b/packages/core/src/test/lambda/models/samLambdaRuntime.test.ts index f7e8ba4499b..0e6d96afffd 100644 --- a/packages/core/src/test/lambda/models/samLambdaRuntime.test.ts +++ b/packages/core/src/test/lambda/models/samLambdaRuntime.test.ts @@ -76,6 +76,7 @@ describe('runtimes', function () { 'python3.10', 'python3.11', 'python3.12', + 'python3.13', 'python3.7', 'python3.8', 'python3.9', @@ -88,6 +89,7 @@ describe('runtimes', function () { 'python3.10', 'python3.11', 'python3.12', + 'python3.13', 'python3.7', 'python3.8', 'python3.9', @@ -110,6 +112,7 @@ describe('runtimes', function () { 'python3.10', 'python3.11', 'python3.12', + 'python3.13', 'python3.7', 'python3.8', 'python3.9', @@ -131,6 +134,7 @@ describe('runtimes', function () { 'python3.10', 'python3.11', 'python3.12', + 'python3.13', 'python3.7', 'python3.8', 'python3.9', diff --git a/packages/core/src/test/lambda/models/samTemplates.test.ts b/packages/core/src/test/lambda/models/samTemplates.test.ts index 8e09aa841f6..f8ceb68bbe0 100644 --- a/packages/core/src/test/lambda/models/samTemplates.test.ts +++ b/packages/core/src/test/lambda/models/samTemplates.test.ts @@ -69,6 +69,7 @@ describe('getSamTemplateWizardOption', function () { case 'python3.10': case 'python3.11': case 'python3.12': + case 'python3.13': assert.deepStrictEqual( result, validPythonTemplateOptions, diff --git a/packages/core/src/testInteg/sam.test.ts b/packages/core/src/testInteg/sam.test.ts index 3729b8b0607..e347479d221 100644 --- a/packages/core/src/testInteg/sam.test.ts +++ b/packages/core/src/testInteg/sam.test.ts @@ -110,6 +110,16 @@ const scenarios: TestScenario[] = [ // https://github.com/microsoft/vscode-python/blob/main/package.json vscodeMinimum: '1.78.0', }, + { + runtime: 'python3.13', + displayName: 'python 3.13 (ZIP)', + path: 'hello_world/app.py', + debugSessionType: 'python', + language: 'python', + dependencyManager: 'pip', + // https://github.com/microsoft/vscode-python/blob/main/package.json + vscodeMinimum: '1.78.0', + }, { runtime: 'dotnet6', displayName: 'dotnet6 (ZIP)', @@ -211,6 +221,17 @@ const scenarios: TestScenario[] = [ // https://github.com/microsoft/vscode-python/blob/main/package.json vscodeMinimum: '1.78.0', }, + { + runtime: 'python3.13', + displayName: 'python 3.13 (ZIP)', + baseImage: 'amazon/python3.13-base', + path: 'hello_world/app.py', + debugSessionType: 'python', + language: 'python', + dependencyManager: 'pip', + // https://github.com/microsoft/vscode-python/blob/main/package.json + vscodeMinimum: '1.78.0', + }, // { // runtime: 'go1.x', // displayName: 'go1.x (Image)', diff --git a/packages/toolkit/.changes/next-release/Feature-496be4d9-462b-4ab7-bdc6-b7859e89e1c5.json b/packages/toolkit/.changes/next-release/Feature-496be4d9-462b-4ab7-bdc6-b7859e89e1c5.json new file mode 100644 index 00000000000..f3b5beb21c1 --- /dev/null +++ b/packages/toolkit/.changes/next-release/Feature-496be4d9-462b-4ab7-bdc6-b7859e89e1c5.json @@ -0,0 +1,4 @@ +{ + "type": "Feature", + "description": "python 3.13 support for SAM and lambda" +} diff --git a/packages/toolkit/README.quickstart.cloud9.md b/packages/toolkit/README.quickstart.cloud9.md index f619c4e7ae3..b67cba67c45 100644 --- a/packages/toolkit/README.quickstart.cloud9.md +++ b/packages/toolkit/README.quickstart.cloud9.md @@ -89,7 +89,7 @@ When you're satisfied with performance, you can [deploy your serverless applicat The Toolkit _local SAM debugging_ feature supports these runtimes: - JavaScript (Node.js 14.x, 16.x) -- Python (3.7, 3.8, 3.9, 3.10, 3.11, 3.12) +- Python (3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13) For more information see [Working with AWS Serverless Applications](https://docs.aws.amazon.com/cloud9/latest/user-guide/serverless-apps-toolkit.html) in the user guide.