-
Notifications
You must be signed in to change notification settings - Fork 291
Adding support for python 3.13 & 3.14, improved auto-detection for homebrew installations #6152
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
base: main
Are you sure you want to change the base?
Changes from all commits
f616626
fe5a476
ff3bd16
e6ecc17
314b9b7
348fdf1
bd96384
f53d580
edf593e
f7360f4
8789bb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,10 @@ abstract class ToolkitClientManager { | |
| } | ||
|
|
||
| val clientOverrideConfig = ClientOverrideConfiguration.builder() | ||
| clientOverrideConfig.putAdvancedOption( | ||
| SdkAdvancedClientOption.USER_AGENT_SUFFIX, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a test asserting this new User-Agent header still contains the toolkit identifier? |
||
| userAgent() | ||
| ) | ||
|
|
||
| if (credProvider != null) { | ||
| credentialsProvider(credProvider) | ||
|
|
@@ -194,49 +198,6 @@ abstract class ToolkitClientManager { | |
| } | ||
| } | ||
|
|
||
| clientOverrideConfig.addExecutionInterceptor(object : ExecutionInterceptor { | ||
| override fun modifyRequest( | ||
| context: Context.ModifyRequest, | ||
| executionAttributes: ExecutionAttributes, | ||
| ): SdkRequest { | ||
| val request = context.request() | ||
| if (request !is AwsRequest) { | ||
| return request | ||
| } | ||
|
|
||
| val clientType = executionAttributes.getAttribute(AwsExecutionAttribute.CLIENT_TYPE) | ||
| val sdkClient = executionAttributes.getAttribute(SdkInternalExecutionAttribute.SDK_CLIENT) | ||
| val serviceClientConfiguration = sdkClient.serviceClientConfiguration() | ||
| val retryMode = serviceClientConfiguration.overrideConfiguration().retryMode().orElse(RetryMode.defaultRetryMode()) | ||
| val toolkitUserAgent = userAgent() | ||
|
|
||
| val requestUserAgent = ApplyUserAgentStage.resolveClientUserAgent( | ||
| toolkitUserAgent, | ||
| null, | ||
| clientType, | ||
| null, | ||
| null, | ||
| retryMode.toString().lowercase() | ||
| ) | ||
|
|
||
| val overrideConfiguration = request.overrideConfiguration() | ||
| .map { config -> | ||
| config.toBuilder() | ||
| .putHeader(HEADER_USER_AGENT, requestUserAgent) | ||
| .build() | ||
| } | ||
| .orElseGet { | ||
| AwsRequestOverrideConfiguration.builder() | ||
| .putHeader(HEADER_USER_AGENT, requestUserAgent) | ||
| .build() | ||
| } | ||
|
|
||
| return request.toBuilder() | ||
| .overrideConfiguration(overrideConfiguration) | ||
| .build() | ||
| } | ||
| }) | ||
|
|
||
| clientOverrideConfig.let { configuration -> | ||
| configuration.retryStrategy(RetryMode.STANDARD) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,20 @@ class Python312ImageDebugSupport : PythonImageDebugSupport() { | |
| override val bootstrapPath: String = "/var/runtime/bootstrap.py" | ||
| } | ||
|
|
||
| class Python313ImageDebugSupport : PythonImageDebugSupport() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add tests for this and 3.14 |
||
| override val id: String = LambdaRuntime.PYTHON3_13.toString() | ||
| override fun displayName() = LambdaRuntime.PYTHON3_13.toString().capitalize() | ||
| override val pythonPath: String = "/var/lang/bin/python3.13" | ||
| override val bootstrapPath: String = "/var/runtime/bootstrap.py" | ||
| } | ||
|
|
||
| class Python314ImageDebugSupport : PythonImageDebugSupport() { | ||
| override val id: String = LambdaRuntime.PYTHON3_14.toString() | ||
| override fun displayName() = LambdaRuntime.PYTHON3_14.toString().capitalize() | ||
| override val pythonPath: String = "/var/lang/bin/python3.14" | ||
| override val bootstrapPath: String = "/var/runtime/bootstrap.py" | ||
| } | ||
|
|
||
| private const val DEBUGGER_VOLUME_PATH = "/tmp/lambci_debug_files" | ||
|
|
||
| private fun createDebugProcess( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,11 +67,16 @@ class SamExecutable : ExecutableType<SemVer>, AutoResolvable, Validatable { | |
| arrayOf("C:\\Program Files\\Amazon\\AWSSAMCLI\\bin", "C:\\Program Files (x86)\\Amazon\\AWSSAMCLI\\bin"), | ||
| arrayOf("sam.cmd", "sam.exe") | ||
| ) | ||
| } else { | ||
| } else if (SystemInfo.isMac) { | ||
| ExecutableDetector().find( | ||
| arrayOf("/usr/local/bin", "/usr/bin"), | ||
| arrayOf("/usr/local/bin", "/usr/bin", "/opt/homebrew/bin/sam"), | ||
| arrayOf("sam") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ExecutableDetector will look for /opt/homebrew/bin/sam/sam and never find anything. It needs to be "/opt/homebrew/bin".
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also please add a test for this |
||
| ) | ||
| } else { | ||
| ExecutableDetector().find( | ||
| arrayOf("/usr/local/bin", "/usr/bin"), | ||
| arrayOf("sam") | ||
| ) | ||
| } | ||
| ) ?: return null | ||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
.changes/next-release/*.jsonfiles to add changelogs, that gets rolled into the changelog at release time; direct CHANGELOG edits typically conflict with the release tooling.