From d34dc98918037177dcd222434aa557380c826701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Forestier?= Date: Thu, 12 Dec 2024 11:34:19 +0100 Subject: [PATCH] Add platforms for AWS Lambda Runtime configurations As described in the Github [issue](https://github.com/pypa/pip/issues/10760), `pip` fails to find a manylinux wheel when `--platform` is defined and there is no exact match. Add old platforms for the `pip` command when creating the data directory for the AWS Lambda function. This should resolved the dependency conflict observed in this [job](https://gitlab.adacore-it.com/it/iac/-/jobs/864195). --- src/e3/aws/troposphere/awslambda/__init__.py | 7 ++++++- .../troposphere/awslambda/awslambda_test.py | 20 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/e3/aws/troposphere/awslambda/__init__.py b/src/e3/aws/troposphere/awslambda/__init__.py index e95157d..01daa4a 100644 --- a/src/e3/aws/troposphere/awslambda/__init__.py +++ b/src/e3/aws/troposphere/awslambda/__init__.py @@ -363,7 +363,12 @@ class PyFunction(Function): f"python{version}": { "implementation": "cp", # Amazon Linux 2023 glibc version is 2.34 - "platforms": ("manylinux_2_34_x86_64",), + "platforms": ( + "manylinux_2_17_x86_64", + "manylinux_2_24_x86_64", + "manylinux_2_28_x86_64", + "manylinux_2_34_x86_64", + ), } for version in AMAZON_LINUX_2023_RUNTIMES } diff --git a/tests/tests_e3_aws/troposphere/awslambda/awslambda_test.py b/tests/tests_e3_aws/troposphere/awslambda/awslambda_test.py index 423fd11..96ba07e 100644 --- a/tests/tests_e3_aws/troposphere/awslambda/awslambda_test.py +++ b/tests/tests_e3_aws/troposphere/awslambda/awslambda_test.py @@ -500,8 +500,24 @@ def test_pyfunction_with_dlconfig(stack: Stack) -> None: ("3.9", ["manylinux_2_17_x86_64", "manylinux_2_24_x86_64"]), ("3.10", ["manylinux_2_17_x86_64", "manylinux_2_24_x86_64"]), ("3.11", ["manylinux_2_17_x86_64", "manylinux_2_24_x86_64"]), - ("3.12", ["manylinux_2_34_x86_64"]), - ("3.13", ["manylinux_2_34_x86_64"]), + ( + "3.12", + [ + "manylinux_2_17_x86_64", + "manylinux_2_24_x86_64", + "manylinux_2_28_x86_64", + "manylinux_2_34_x86_64", + ], + ), + ( + "3.13", + [ + "manylinux_2_17_x86_64", + "manylinux_2_24_x86_64", + "manylinux_2_28_x86_64", + "manylinux_2_34_x86_64", + ], + ), ], ) def test_pyfunction_with_requirements(