Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit aa8cbd1

Browse files
chore(layer): add Python version in Layer description (#108)
* Adding Python version in Layer description * Adding Python version in Layer description
1 parent 48130b8 commit aa8cbd1

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/lambda-powertools-layer-python-v3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class LambdaPowertoolsLayerPythonV3 extends lambda.LayerVersion {
6868
),
6969
PYTHON_VERSION: pythonVersionNormalized,
7070
},
71-
// supports cross-platform docker build
71+
// supports cross-platform docker build using different Python versions
7272
platform: getDockerPlatformNameFromArchitectures(
7373
compatibleArchitectures,
7474
),
@@ -77,7 +77,7 @@ export class LambdaPowertoolsLayerPythonV3 extends lambda.LayerVersion {
7777
license: 'MIT-0',
7878
compatibleRuntimes: [props?.pythonVersion || Runtime.PYTHON_3_12],
7979
description:
80-
`Powertools for AWS Lambda (Python) V3 [${compatibleArchitecturesDescription}]${props?.includeExtras ? ' with extra dependencies' : ''
80+
`Powertools for AWS Lambda (Python) V3 [${compatibleArchitecturesDescription} - Python ${pythonVersionNormalized}]${props?.includeExtras ? ' with extra dependencies' : ''
8181
} ${props?.version ? `version ${props?.version}` : 'latest version'
8282
}`.trim(),
8383
// Dear reader: I'm happy that you've stumbled upon this line too! You might wonder, why are we doing this and passing `undefined` when the list is empty?

test/lambda-powertools-python-layer-v3.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { Template } from 'aws-cdk-lib/assertions';
33
import { Architecture, Runtime, RuntimeFamily } from 'aws-cdk-lib/aws-lambda';
44
import { LambdaPowertoolsLayerPythonV3, constructBuildArgs } from '../src';
55

6+
const defaultPythonVersion = 'Python 3.12';
7+
68
describe('with no configuration the construct', () => {
79
const stack = new Stack();
810
new LambdaPowertoolsLayerPythonV3(stack, 'PowertoolsLayerPythonV3');
911
const template = Template.fromStack(stack);
1012
test('synthesizes successfully', () => {
1113
template.hasResourceProperties('AWS::Lambda::LayerVersion', {
12-
Description: 'Powertools for AWS Lambda (Python) V3 [x86_64] latest version',
14+
Description: `Powertools for AWS Lambda (Python) V3 [x86_64 - ${defaultPythonVersion}] latest version`,
1315
});
1416
});
1517

@@ -106,7 +108,7 @@ describe('with arm64 architecture', () => {
106108
const template = Template.fromStack(stack);
107109
test('synthesizes successfully', () => {
108110
template.hasResourceProperties('AWS::Lambda::LayerVersion', {
109-
Description: 'Powertools for AWS Lambda (Python) V3 [arm64] latest version',
111+
Description: `Powertools for AWS Lambda (Python) V3 [arm64 - ${defaultPythonVersion}] latest version`,
110112
CompatibleArchitectures: ['arm64'],
111113
});
112114
});
@@ -156,7 +158,7 @@ describe('with version configuration the construct', () => {
156158
'AWS::Lambda::LayerVersion',
157159
{
158160
Description:
159-
'Powertools for AWS Lambda (Python) V3 [x86_64] version 1.21.0',
161+
`Powertools for AWS Lambda (Python) V3 [x86_64 - ${defaultPythonVersion}] version 1.21.0`,
160162
},
161163
);
162164
});
@@ -184,7 +186,7 @@ describe('with version configuration the construct', () => {
184186
'AWS::Lambda::LayerVersion',
185187
{
186188
Description:
187-
'Powertools for AWS Lambda (Python) V3 [x86_64] with extra dependencies version 2.40.0',
189+
`Powertools for AWS Lambda (Python) V3 [x86_64 - ${defaultPythonVersion}] with extra dependencies version 2.40.0`,
188190
},
189191
);
190192
});
@@ -200,7 +202,7 @@ describe('with version configuration the construct', () => {
200202
'AWS::Lambda::LayerVersion',
201203
{
202204
Description:
203-
'Powertools for AWS Lambda (Python) V3 [x86_64] with extra dependencies latest version',
205+
`Powertools for AWS Lambda (Python) V3 [x86_64 - ${defaultPythonVersion}] with extra dependencies latest version`,
204206
},
205207
);
206208
});

0 commit comments

Comments
 (0)