Skip to content

Commit 9a9152b

Browse files
authored
Merge #3754 python 3.11 SAM, lambda
2 parents efac481 + 4dcee33 commit 9a9152b

File tree

11 files changed

+44
-3
lines changed

11 files changed

+44
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "SAM: create, run and debug Python 3.11 Lambdas #3753"
4+
}

README.quickstart.cloud9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ When you're satisfied with performance, you can [deploy your serverless applicat
8989
The Toolkit _local SAM debugging_ feature supports these runtimes:
9090

9191
- JavaScript (Node.js 12.x, 14.x)
92-
- Python (3.7, 3.8, 3.9, 3.10)
92+
- Python (3.7, 3.8, 3.9, 3.10, 3.11)
9393

9494
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.
9595

src/eventSchemas/models/schemaCodeLangs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function getLanguageDetails(language: SchemaCodeLangs): {
5454
}
5555

5656
export function supportsEventBridgeTemplates(runtime: Runtime): boolean {
57-
return ['python3.7', 'python3.8', 'python3.9', 'python3.10', 'go1.x'].includes(runtime)
57+
return ['python3.7', 'python3.8', 'python3.9', 'python3.10', 'python3.11', 'go1.x'].includes(runtime)
5858
}
5959

6060
export function getApiValueForSchemasDownload(runtime: Runtime): string {

src/lambda/models/samLambdaRuntime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function getNodeMajorVersion(version?: string): number | undefined {
4949
}
5050

5151
export const pythonRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
52+
'python3.11',
5253
'python3.10',
5354
'python3.9',
5455
'python3.8',

src/shared/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export const samInstallUrl = vscode.Uri.parse(
2121
export const samUpgradeUrl = vscode.Uri.parse(
2222
'https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/manage-sam-cli-versions.html#manage-sam-cli-versions-upgrade'
2323
)
24+
export const samTroubleshootingUrl = vscode.Uri.parse(
25+
'https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-troubleshooting.html'
26+
)
2427
export const githubUrl: string = 'https://github.com/aws/aws-toolkit-vscode'
2528
export const githubCreateIssueUrl = `${githubUrl}/issues/new/choose`
2629
export const documentationUrl: string = isCloud9()

src/shared/sam/debugger/awsSamDebugger.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import { Runtime, telemetry } from '../../telemetry/telemetry'
6464
import { ErrorInformation, isUserCancelledError, ToolkitError } from '../../errors'
6565
import { openLaunchJsonFile } from './commands/addSamDebugConfiguration'
6666
import { Logging } from '../../logger/commands'
67-
import { credentialHelpUrl } from '../../constants'
67+
import { credentialHelpUrl, samTroubleshootingUrl } from '../../constants'
6868
import { Auth } from '../../../auth/auth'
6969
import { openUrl } from '../../utilities/vsCodeUtils'
7070

@@ -81,6 +81,10 @@ class SamLaunchRequestError extends ToolkitError.named('SamLaunchRequestError')
8181
public constructor(message: string, info?: ErrorInformation & { readonly extraButtons?: NotificationButton[] }) {
8282
super(message, info)
8383
this.buttons = info?.extraButtons ?? [
84+
{
85+
label: localize('AWS.generic.message.troubleshooting', 'Troubleshooting'),
86+
onClick: () => openUrl(samTroubleshootingUrl),
87+
},
8488
{
8589
label: localize('AWS.generic.message.openConfig', 'Open Launch Config'),
8690
onClick: openLaunchJsonFile,

src/shared/sam/debugger/pythonSamDebug.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ function getPythonExeAndBootstrap(runtime: Runtime) {
258258
return { python: '/var/lang/bin/python3.9', bootstrap: '/var/runtime/bootstrap.py' }
259259
case 'python3.10':
260260
return { python: '/var/lang/bin/python3.10', bootstrap: '/var/runtime/bootstrap.py' }
261+
case 'python3.11':
262+
return { python: '/var/lang/bin/python3.11', bootstrap: '/var/runtime/bootstrap.py' }
261263
default:
262264
throw new Error(`Python SAM debug logic ran for invalid Python runtime: ${runtime}`)
263265
}

src/test/eventSchemas/model/schemaCodeLangs.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('getApiValueForSchemasDownload', function () {
3030
case 'python3.7':
3131
case 'python3.8':
3232
case 'python3.9':
33+
case 'python3.11':
3334
case 'python3.10': {
3435
const result = getApiValueForSchemasDownload(runtime)
3536
assert.strictEqual(result, 'Python36', 'Api value used by schemas api')

src/test/lambda/models/samLambdaRuntime.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('runtimes', function () {
7474
'nodejs16.x',
7575
'nodejs18.x',
7676
'python3.10',
77+
'python3.11',
7778
'python3.7',
7879
'python3.8',
7980
'python3.9',
@@ -84,6 +85,7 @@ describe('runtimes', function () {
8485
'nodejs16.x',
8586
'nodejs18.x',
8687
'python3.10',
88+
'python3.11',
8789
'python3.7',
8890
'python3.8',
8991
'python3.9',
@@ -102,6 +104,7 @@ describe('runtimes', function () {
102104
'nodejs16.x',
103105
'nodejs18.x',
104106
'python3.10',
107+
'python3.11',
105108
'python3.7',
106109
'python3.8',
107110
'python3.9',
@@ -119,6 +122,7 @@ describe('runtimes', function () {
119122
'nodejs16.x',
120123
'nodejs18.x',
121124
'python3.10',
125+
'python3.11',
122126
'python3.7',
123127
'python3.8',
124128
'python3.9',

src/test/lambda/models/samTemplates.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ describe('getSamTemplateWizardOption', function () {
6767
case 'python3.8':
6868
case 'python3.9':
6969
case 'python3.10':
70+
case 'python3.11':
7071
assert.deepStrictEqual(
7172
result,
7273
validPythonTemplateOptions,

0 commit comments

Comments
 (0)