Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-python-alpha/lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class Bundling implements CdkBundlingOptions {
bundlingCommands.push(packaging.exportCommand ?? '');

if (packaging.dependenciesFile == DependenciesFile.UV) {
bundlingCommands.push(`uv pip install -r ${DependenciesFile.PIP} --target ${options.outputDir}`);
bundlingCommands.push(`uv pip install --no-deps -r ${DependenciesFile.PIP} --target ${options.outputDir}`);
} else if (packaging.dependenciesFile) {
bundlingCommands.push(`python -m pip install -r ${DependenciesFile.PIP} -t ${options.outputDir}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ test('Bundling a function with uv dependencies', () => {
bundling: expect.objectContaining({
command: [
'bash', '-c',
"rsync -rLv --exclude='.python-version' /asset-input/ /asset-output/python && cd /asset-output/python && uv export --frozen --no-emit-workspace --no-dev --no-editable -o requirements.txt && uv pip install -r requirements.txt --target /asset-output/python",
"rsync -rLv --exclude='.python-version' /asset-input/ /asset-output/python && cd /asset-output/python && uv export --frozen --no-emit-workspace --no-dev --no-editable -o requirements.txt && uv pip install --no-deps -r requirements.txt --target /asset-output/python",
],
}),
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ const pythonFunction313 = new lambda.PythonFunction(stack, 'my_handler_inline_py
});
functionNames.push(pythonFunction313.functionName);

const pythonDepsFunction313 = new lambda.PythonFunction(stack, 'my_handler_inline_python_deps_313', {
entry: path.join(__dirname, 'lambda-handler-uv'),
index: 'dependency_versions.py',
runtime: Runtime.PYTHON_3_13,
});
functionNames.push(pythonDepsFunction313.functionName);

const integTest = new IntegTest(app, 'integ-lambda-python-uv-test', {
testCases: [stack],
// disabling update workflow because we don't want to include the assets in the snapshot
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from importlib.metadata import version

def handler(event, context):
status_code = 200

certifi_version = version('certifi')
urllib3_version = version('urllib3')
charset_normalizer_version = version('charset-normalizer')

if (certifi_version != '2025.1.31' or
urllib3_version != '2.3.0' or
charset_normalizer_version != '3.4.1'):
status_code = 400

return status_code
Loading