diff --git a/.github/workflows/quality_check.yml b/.github/workflows/quality_check.yml index 22561070bfd..8934ccb7a79 100644 --- a/.github/workflows/quality_check.yml +++ b/.github/workflows/quality_check.yml @@ -26,7 +26,6 @@ on: - "mypy.ini" branches: - develop - - v3 push: paths: - "aws_lambda_powertools/**" @@ -37,7 +36,6 @@ on: - "mypy.ini" branches: - develop - - v3 permissions: contents: read diff --git a/.github/workflows/quality_code_cdk_constructor.yml b/.github/workflows/quality_code_cdk_constructor.yml new file mode 100644 index 00000000000..5d4cc33466b --- /dev/null +++ b/.github/workflows/quality_code_cdk_constructor.yml @@ -0,0 +1,70 @@ +name: Code quality - CDK constructor + +# PROCESS +# +# 1. Install all dependencies and spin off containers for all supported Python versions +# 2. Run code formatters and linters (various checks) for code standard +# 3. Run static typing checker for potential bugs +# 4. Run tests + +# USAGE +# +# Always triggered on new PRs, PR changes and PR merge. + + +on: + pull_request: + paths: + - "layer/layer_constructors/**" + branches: + - develop + push: + paths: + - "layer/layer_constructors/**" + branches: + - develop + +permissions: + contents: read + +jobs: + quality_check: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + env: + PYTHON: "${{ matrix.python-version }}" + permissions: + contents: read # checkout code only + defaults: + run: + working-directory: ./layer_v3/layer_constructors + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - name: Install poetry + run: pipx install poetry + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" + - name: Set up QEMU + uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.0.0 + with: + platforms: arm64 + # NOTE: we need QEMU to build Layer against a different architecture (e.g., ARM) + - name: Set up Docker Buildx + id: builder + uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 + with: + install: true + driver: docker + platforms: linux/amd64,linux/arm64 + - name: Install dependencies + run: | + pip install --upgrade pip pre-commit poetry + poetry install + - name: Test with pytest + run: poetry run pytest tests diff --git a/layer_v3/__init__.py b/layer_v3/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layer_v3/layer/layer_stack.py b/layer_v3/layer/layer_stack.py index 237d747b246..68ca842955b 100644 --- a/layer_v3/layer/layer_stack.py +++ b/layer_v3/layer/layer_stack.py @@ -14,9 +14,10 @@ ) from aws_cdk.aws_lambda import Architecture, CfnLayerVersionPermission, Runtime from aws_cdk.aws_ssm import StringParameter -from cdk_aws_lambda_powertools_layer import LambdaPowertoolsLayerPythonV3 from constructs import Construct +from layer_v3.layer_constructors.layer_stack import LambdaPowertoolsLayerPythonV3 + @jsii.implements(IAspect) class ApplyCondition: @@ -46,11 +47,11 @@ def __init__( layer = LambdaPowertoolsLayerPythonV3( self, "Layer", - layer_version_name=layer_version_name, - version=powertools_version, + layer_name=layer_version_name, + powertools_version=powertools_version, python_version=python_version, include_extras=True, - compatible_architectures=[architecture] if architecture else [], + architecture=architecture or Architecture.X86_64, ) layer.apply_removal_policy(RemovalPolicy.RETAIN) diff --git a/layer_v3/layer_constructors/__init__.py b/layer_v3/layer_constructors/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layer_v3/layer_constructors/helpers.py b/layer_v3/layer_constructors/helpers.py new file mode 100644 index 00000000000..ecc6d826475 --- /dev/null +++ b/layer_v3/layer_constructors/helpers.py @@ -0,0 +1,45 @@ +from __future__ import annotations + + +def construct_build_args(include_extras: bool = True, version: str | None = None) -> str: + """ + This function creates a suffix string for the Powertools package based on + whether extra dependencies should be included and a specific version is required. + + Params + ------ + include_extras: bool | None: + If True, include all extra dependencies in Powertools package + version: str | None + The version of Powertools to install. Can be a version number or a git reference. + + Returns + ------- + str + A string suffix to be appended to the Powertools package name during installation. + Examples: + - "" (empty string) if no extras or version specified + - "[all]" if include_extras is True + - "==1.2.3" if version is "1.2.3" + - "[all]==1.2.3" if include_extras is True and version is "1.2.3" + - " @ git+https://github.com/..." if version starts with "git" + + Example + ------- + >>> construct_build_args(True, "1.2.3") + '[all]==1.2.3' + >>> construct_build_args(False, "git+https://github.com/...") + ' @ git+https://github.com/...' + """ + + suffix = "" + + if include_extras: + suffix = "[all]" + if version: + if version.startswith("git"): + suffix = f"{suffix} @ {version}" + else: + suffix = f"{suffix}=={version}" + + return suffix diff --git a/layer_v3/layer_constructors/layer_stack.py b/layer_v3/layer_constructors/layer_stack.py new file mode 100644 index 00000000000..73b9be81b57 --- /dev/null +++ b/layer_v3/layer_constructors/layer_stack.py @@ -0,0 +1,83 @@ +from __future__ import annotations + +from pathlib import Path +from typing import TYPE_CHECKING + +from aws_cdk import aws_lambda as lambda_ + +if TYPE_CHECKING: + from constructs import Construct + +from layer_v3.layer_constructors.helpers import construct_build_args + + +class LambdaPowertoolsLayerPythonV3(lambda_.LayerVersion): + """ + A CDK Stack that creates a Lambda Layer for Powertools for AWS Lambda (Python) V3. + + This stack creates a Lambda Layer containing the Powertools for AWS Lambda (Python) V3 library. + It allows customization of the Python runtime version, inclusion of extra dependencies, + architecture, Powertools version, and layer name. + + Attributes: + scope (Construct): The scope in which to define this construct. + construct_id (str): The scoped construct ID. Must be unique amongst siblings in the same scope. + python_version (lambda_.Runtime): The Python runtime version for the layer. Defaults to Python 3.12. + include_extras (bool): Whether to include extra dependencies. Defaults to True. + architecture (lambda_.Architecture): The compatible Lambda architecture. Defaults to x86_64. + powertools_version (str): The version of Powertools to use. If empty, uses the latest version. + layer_name (str): Custom name for the Lambda Layer. If empty, a default name will be used. + + Example: + >>> app = cdk.App() + >>> LambdaPowertoolsLayerPythonV3(app, "PowertoolsLayer", + ... python_version=lambda_.Runtime.PYTHON_3_11, + ... include_extras=False, + ... architecture=lambda_.Architecture.ARM_64, + ... powertools_version="2.10.0", + ... layer_name="MyCustomPowertoolsLayer") + + """ + + def __init__( + self, + scope: Construct, + construct_id: str, + python_version: lambda_.Runtime = lambda_.Runtime.PYTHON_3_12, + include_extras: bool = True, + architecture: lambda_.Architecture = lambda_.Architecture.X86_64, + powertools_version: str = "", + layer_name: str = "", + ) -> None: + + docker_file_path = str(Path(__file__).parent.parent / "docker") + + python_normalized_version: str = python_version.to_string().replace("python", "") + + if architecture.to_string() == "x86_64": + docker_architecture: str = "linux/amd64" + else: + docker_architecture: str = "linux/arm64" + + super().__init__( + scope, + construct_id, + code=lambda_.Code.from_docker_build( + docker_file_path, + build_args={ + "PACKAGE_SUFFIX": construct_build_args( + include_extras, + powertools_version, + ), + "PYTHON_VERSION": python_normalized_version, + }, + platform=docker_architecture, + ), + layer_version_name=layer_name, + license="MIT-0", + compatible_runtimes=[python_version], + description=f"Powertools for AWS Lambda (Python) V3 [{architecture.to_string()} - Python {python_normalized_version}]" # noqa E501 + + (" with extra dependencies" if include_extras else "") + + (f" version {powertools_version}" if powertools_version else " latest version"), + compatible_architectures=[architecture] if architecture else None, + ) diff --git a/layer_v3/layer_constructors/tests/__init__.py b/layer_v3/layer_constructors/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layer_v3/layer_constructors/tests/unit/__init__.py b/layer_v3/layer_constructors/tests/unit/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layer_v3/layer_constructors/tests/unit/test_new_cdk_constructor_stack.py b/layer_v3/layer_constructors/tests/unit/test_new_cdk_constructor_stack.py new file mode 100644 index 00000000000..24db176905c --- /dev/null +++ b/layer_v3/layer_constructors/tests/unit/test_new_cdk_constructor_stack.py @@ -0,0 +1,186 @@ +import aws_cdk +import pytest +from aws_cdk import assertions +from aws_cdk import aws_lambda as lambda_ + +from layer_v3.layer_constructors.helpers import construct_build_args +from layer_v3.layer_constructors.layer_stack import LambdaPowertoolsLayerPythonV3 + + +def test_with_no_configuration_constructor(): + + app = aws_cdk.App() + stack = aws_cdk.Stack(app, "TestStack") + LambdaPowertoolsLayerPythonV3(stack, "LambdaPowertoolsLayerPythonV3") + + template = assertions.Template.from_stack(stack) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"LicenseInfo": "MIT-0"}) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"CompatibleRuntimes": ["python3.12"]}) + + +@pytest.mark.parametrize( + "python_version", + [ + lambda_.Runtime.PYTHON_3_8, + lambda_.Runtime.PYTHON_3_9, + lambda_.Runtime.PYTHON_3_10, + lambda_.Runtime.PYTHON_3_11, + lambda_.Runtime.PYTHON_3_12, + ], +) +def test_with_different_python_version_x86_64(python_version): + + inner_python_version: lambda_.Runtime = python_version + + app = aws_cdk.App() + stack = aws_cdk.Stack(app, "TestStack") + + LambdaPowertoolsLayerPythonV3( + stack, + "LambdaPowertoolsLayerPythonV3", + python_version=inner_python_version, + powertools_version="3.0.0", + layer_name="Powertools", + ) + template = assertions.Template.from_stack(stack) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"LicenseInfo": "MIT-0"}) + + template.has_resource_properties( + "AWS::Lambda::LayerVersion", + {"CompatibleRuntimes": [inner_python_version.to_string()]}, + ) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"CompatibleArchitectures": ["x86_64"]}) + + +@pytest.mark.parametrize( + "python_version", + [ + lambda_.Runtime.PYTHON_3_8, + lambda_.Runtime.PYTHON_3_9, + lambda_.Runtime.PYTHON_3_10, + lambda_.Runtime.PYTHON_3_11, + lambda_.Runtime.PYTHON_3_12, + ], +) +def test_with_different_python_version_arm64(python_version): + + inner_python_version: lambda_.Runtime = python_version + + app = aws_cdk.App() + stack = aws_cdk.Stack(app, "TestStack") + LambdaPowertoolsLayerPythonV3( + stack, + "LambdaPowertoolsLayerPythonV3", + python_version=inner_python_version, + architecture=lambda_.Architecture.ARM_64, + powertools_version="3.0.0", + layer_name="Powertools", + ) + template = assertions.Template.from_stack(stack) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"LicenseInfo": "MIT-0"}) + + template.has_resource_properties( + "AWS::Lambda::LayerVersion", + {"CompatibleRuntimes": [inner_python_version.to_string()]}, + ) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"CompatibleArchitectures": ["arm64"]}) + + +def test_with_custom_name(): + + app = aws_cdk.App() + stack = aws_cdk.Stack(app, "TestStack") + LambdaPowertoolsLayerPythonV3(stack, "LambdaPowertoolsLayerPythonV3", layer_name="custom_name_layer") + template = assertions.Template.from_stack(stack) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"LayerName": "custom_name_layer"}) + + template.has_resource_properties( + "AWS::Lambda::LayerVersion", + { + "Description": "Powertools for AWS Lambda (Python) V3 [x86_64 - Python 3.12] with extra dependencies latest version", # noqa E501 + }, + ) + + +def test_with_extras(): + + app = aws_cdk.App() + stack = aws_cdk.Stack(app, "TestStack") + LambdaPowertoolsLayerPythonV3( + stack, + "LambdaPowertoolsLayerPythonV3", + layer_name="custom_name_layer", + include_extras=True, + powertools_version="3.0.0", + ) + template = assertions.Template.from_stack(stack) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"LayerName": "custom_name_layer"}) + + template.has_resource_properties( + "AWS::Lambda::LayerVersion", + { + "Description": "Powertools for AWS Lambda (Python) V3 [x86_64 - Python 3.12] with extra dependencies version 3.0.0", # noqa E501 + }, + ) + + +def test_with_extras_arm64(): + + app = aws_cdk.App() + stack = aws_cdk.Stack(app, "TestStack") + LambdaPowertoolsLayerPythonV3( + stack, + "LambdaPowertoolsLayerPythonV3", + layer_name="custom_name_layer", + include_extras=True, + powertools_version="3.0.0", + architecture=lambda_.Architecture.ARM_64, + ) + template = assertions.Template.from_stack(stack) + + template.has_resource_properties("AWS::Lambda::LayerVersion", {"LayerName": "custom_name_layer"}) + + template.has_resource_properties( + "AWS::Lambda::LayerVersion", + { + "Description": "Powertools for AWS Lambda (Python) V3 [arm64 - Python 3.12] with extra dependencies version 3.0.0", # noqa E501 + }, + ) + + +def test_build_args_with_version(): + + build_args = construct_build_args(include_extras=True, version="3.0.0") + + assert build_args == "[all]==3.0.0" + + +def test_build_args_without_version(): + + build_args = construct_build_args(include_extras=True) + + assert build_args == "[all]" + + +def test_build_args_with_github_tag(): + + version = "git+https://github.com/awslabs/aws-lambda-powertools-python@v2" + + build_args = construct_build_args(include_extras=True, version=version) + + assert build_args == f"[all] @ {version}" + + +def test_build_args_with_no_version_and_no_extra(): + + build_args = construct_build_args(include_extras=False) + + assert build_args == "" diff --git a/layer_v3/poetry.lock b/layer_v3/poetry.lock index 6eee669caeb..7dffc856b64 100644 --- a/layer_v3/poetry.lock +++ b/layer_v3/poetry.lock @@ -2,38 +2,38 @@ [[package]] name = "attrs" -version = "23.2.0" +version = "24.2.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.7" files = [ - {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, - {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, + {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"}, + {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"}, ] [package.extras] -cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] -dev = ["attrs[tests]", "pre-commit"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] -tests = ["attrs[tests-no-zope]", "zope-interface"] -tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] -tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist[psutil]"] +benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "aws-cdk-asset-awscli-v1" -version = "2.2.202" +version = "2.2.205" description = "A library that contains the AWS CLI for use in Lambda Layers" optional = false python-versions = "~=3.8" files = [ - {file = "aws-cdk.asset-awscli-v1-2.2.202.tar.gz", hash = "sha256:3ef87d6530736b3a7b0f777fe3b4297994dd40c3ce9306d95f80f48fb18036e8"}, - {file = "aws_cdk.asset_awscli_v1-2.2.202-py3-none-any.whl", hash = "sha256:96205ea2e5e132ec52fabfff37ea25b9b859498f167d05b32564c949822cd331"}, + {file = "aws_cdk.asset_awscli_v1-2.2.205-py3-none-any.whl", hash = "sha256:086d74baa99596446f279a1263e1451a79f52fc0eea122b1f38f57f5a08699f0"}, + {file = "aws_cdk_asset_awscli_v1-2.2.205.tar.gz", hash = "sha256:037d0684472a34050c2e4438c76048b9049c2753523463e12dec9fd725a26363"}, ] [package.dependencies] -jsii = ">=1.93.0,<2.0.0" +jsii = ">=1.103.1,<2.0.0" publication = ">=0.0.3" -typeguard = ">=2.13.3,<2.14.0" +typeguard = ">=2.13.3,<5.0.0" [[package]] name = "aws-cdk-asset-kubectl-v20" @@ -53,53 +53,70 @@ typeguard = ">=2.13.3,<2.14.0" [[package]] name = "aws-cdk-asset-node-proxy-agent-v6" -version = "2.0.3" +version = "2.1.0" description = "@aws-cdk/asset-node-proxy-agent-v6" optional = false python-versions = "~=3.8" files = [ - {file = "aws-cdk.asset-node-proxy-agent-v6-2.0.3.tar.gz", hash = "sha256:b62cb10c69a42cab135e6bc670e3d2d3121fd4f53a0f61e53449da4b12738a6f"}, - {file = "aws_cdk.asset_node_proxy_agent_v6-2.0.3-py3-none-any.whl", hash = "sha256:ef2ff0634ab037e2ebddbe69d7c92515a847c6c8bb2abdfc85b089f5e87761cb"}, + {file = "aws_cdk.asset_node_proxy_agent_v6-2.1.0-py3-none-any.whl", hash = "sha256:24a388b69a44d03bae6dbf864c4e25ba650d4b61c008b4568b94ffbb9a69e40e"}, + {file = "aws_cdk_asset_node_proxy_agent_v6-2.1.0.tar.gz", hash = "sha256:1f292c0631f86708ba4ee328b3a2b229f7e46ea1c79fbde567ee9eb119c2b0e2"}, ] [package.dependencies] -jsii = ">=1.96.0,<2.0.0" +jsii = ">=1.103.1,<2.0.0" publication = ">=0.0.3" -typeguard = ">=2.13.3,<2.14.0" +typeguard = ">=2.13.3,<5.0.0" + +[[package]] +name = "aws-cdk-cloud-assembly-schema" +version = "38.0.1" +description = "Cloud Assembly Schema" +optional = false +python-versions = "~=3.8" +files = [ + {file = "aws_cdk.cloud_assembly_schema-38.0.1-py3-none-any.whl", hash = "sha256:92613b46213b460681e9424f09b77f06ff059eb1c773092540364ef82fcecf55"}, + {file = "aws_cdk_cloud_assembly_schema-38.0.1.tar.gz", hash = "sha256:7c75861adc41f7b959910d4b3b191ea242815402e599dbfa31934892838ae25e"}, +] + +[package.dependencies] +jsii = ">=1.103.1,<2.0.0" +publication = ">=0.0.3" +typeguard = ">=2.13.3,<5.0.0" [[package]] name = "aws-cdk-lib" -version = "2.153.0" +version = "2.161.1" description = "Version 2 of the AWS Cloud Development Kit library" optional = false python-versions = "~=3.8" files = [ - {file = "aws-cdk-lib-2.153.0.tar.gz", hash = "sha256:7cda51150c3615e9429329dc08fa0403822e64a749940ab032d65506fb88ff62"}, - {file = "aws_cdk_lib-2.153.0-py3-none-any.whl", hash = "sha256:1357ccb460a5340c4135307e9d03be3dc09294c14f89881968e9104583be110f"}, + {file = "aws_cdk_lib-2.161.1-py3-none-any.whl", hash = "sha256:c7de930396b1b9f0f512a728a1b926c77c3cab28fbc11fd4f81819dd9563bfb3"}, + {file = "aws_cdk_lib-2.161.1.tar.gz", hash = "sha256:e27a427bc6d95dd2eb0500b0de628a88ee587b212f999fa6efb7e9ab17980201"}, ] [package.dependencies] "aws-cdk.asset-awscli-v1" = ">=2.2.202,<3.0.0" "aws-cdk.asset-kubectl-v20" = ">=2.1.2,<3.0.0" -"aws-cdk.asset-node-proxy-agent-v6" = ">=2.0.3,<3.0.0" +"aws-cdk.asset-node-proxy-agent-v6" = ">=2.1.0,<3.0.0" +"aws-cdk.cloud-assembly-schema" = ">=38.0.0,<39.0.0" constructs = ">=10.0.0,<11.0.0" -jsii = ">=1.101.0,<2.0.0" +jsii = ">=1.103.1,<2.0.0" publication = ">=0.0.3" -typeguard = ">=2.13.3,<2.14.0" +typeguard = ">=2.13.3,<5.0.0" [[package]] name = "boto3" -version = "1.35.2" +version = "1.35.34" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.35.2-py3-none-any.whl", hash = "sha256:c2f0837a259002489e59d1c30008791e3b3bb59e30e48c64e1d2d270147a4549"}, - {file = "boto3-1.35.2.tar.gz", hash = "sha256:cbf197ce28f04bc1ffa1db0aa26a1903d9bfa57a490f70537932e84367cdd15b"}, + {file = "boto3-1.35.34-py3-none-any.whl", hash = "sha256:291e7b97a34967ed93297e6171f1bebb8529e64633dd48426760e3fdef1cdea8"}, + {file = "boto3-1.35.34.tar.gz", hash = "sha256:57e6ee8504e7929bc094bb2afc879943906064179a1e88c23b4812e2c6f61532"}, ] [package.dependencies] -botocore = ">=1.35.2,<1.36.0" +botocore = ">=1.35.34,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -108,13 +125,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.35.2" +version = "1.35.34" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.35.2-py3-none-any.whl", hash = "sha256:92b168d8be79055bb25754aa34d699866d8aa66abc69f8ce99b0c191bd9c6e70"}, - {file = "botocore-1.35.2.tar.gz", hash = "sha256:96c8eb6f0baed623a1b57ca9f24cb21d5508872cf0dfebb55527a85b6dbc76ba"}, + {file = "botocore-1.35.34-py3-none-any.whl", hash = "sha256:ccb0fe397b11b81c9abc0c87029d17298e17bf658d8db5c0c5a551a12a207e7a"}, + {file = "botocore-1.35.34.tar.gz", hash = "sha256:789b6501a3bb4a9591c1fe10da200cc315c1fa5df5ada19c720d8ef06439b3e3"}, ] [package.dependencies] @@ -126,7 +143,7 @@ urllib3 = [ ] [package.extras] -crt = ["awscrt (==0.21.2)"] +crt = ["awscrt (==0.22.0)"] [[package]] name = "cattrs" @@ -153,24 +170,6 @@ pyyaml = ["pyyaml (>=6.0)"] tomlkit = ["tomlkit (>=0.11.8)"] ujson = ["ujson (>=5.7.0)"] -[[package]] -name = "cdk-aws-lambda-powertools-layer" -version = "3.8.0" -description = "Powertools for AWS Lambda layer for python and typescript" -optional = false -python-versions = "~=3.8" -files = [ - {file = "cdk-aws-lambda-powertools-layer-3.8.0.tar.gz", hash = "sha256:7b6e5583901e59fb6e04a8291a5bcc5ba5f89a04ee58a42055164588bc5ee996"}, - {file = "cdk_aws_lambda_powertools_layer-3.8.0-py3-none-any.whl", hash = "sha256:581320334faef2ac5fd86f503e670fb9cbe8b671b979152a51e083a35654aab3"}, -] - -[package.dependencies] -aws-cdk-lib = ">=2.150.0,<3.0.0" -constructs = ">=10.0.5,<11.0.0" -jsii = ">=1.101.0,<2.0.0" -publication = ">=0.0.3" -typeguard = ">=2.13.3,<2.14.0" - [[package]] name = "colorama" version = "0.4.6" @@ -214,21 +213,25 @@ test = ["pytest (>=6)"] [[package]] name = "importlib-resources" -version = "6.4.3" +version = "6.4.5" description = "Read resources from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_resources-6.4.3-py3-none-any.whl", hash = "sha256:2d6dfe3b9e055f72495c2085890837fc8c758984e209115c8792bddcb762cd93"}, - {file = "importlib_resources-6.4.3.tar.gz", hash = "sha256:4a202b9b9d38563b46da59221d77bb73862ab5d79d461307bcb826d725448b98"}, + {file = "importlib_resources-6.4.5-py3-none-any.whl", hash = "sha256:ac29d5f956f01d5e4bb63102a5a19957f1b9175e45649977264a1416783bb717"}, + {file = "importlib_resources-6.4.5.tar.gz", hash = "sha256:980862a1d16c9e147a59603677fa2aa5fd82b87f223b6cb870695bcfce830065"}, ] [package.dependencies] zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["jaraco.test (>=5.4)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["jaraco.test (>=5.4)", "pytest (>=6,!=8.1.*)", "zipp (>=3.17)"] +type = ["pytest-mypy"] [[package]] name = "iniconfig" @@ -254,22 +257,22 @@ files = [ [[package]] name = "jsii" -version = "1.102.0" +version = "1.103.1" description = "Python client for jsii runtime" optional = false python-versions = "~=3.8" files = [ - {file = "jsii-1.102.0-py3-none-any.whl", hash = "sha256:9e0f54acd55d8ea7a0bfd7e4a3dccacf6ca3466a8d67d47703594cffedad382a"}, - {file = "jsii-1.102.0.tar.gz", hash = "sha256:ee044964a0db600d9dcde85b4763beb996b3f56a4c951911eb3ff073deeb8603"}, + {file = "jsii-1.103.1-py3-none-any.whl", hash = "sha256:24b96349230ca22f50fcd69c501e69b6c486acf37bbe0b5869f4c185572b079e"}, + {file = "jsii-1.103.1.tar.gz", hash = "sha256:7eaa46e8cd9546edc6bba81d0b32df9f8ed8f5848305277d261cccfe00b9c1eb"}, ] [package.dependencies] -attrs = ">=21.2,<24.0" +attrs = ">=21.2,<25.0" cattrs = ">=1.8,<23.3" importlib-resources = ">=5.2.0" publication = ">=0.0.3" python-dateutil = "*" -typeguard = ">=2.13.3,<2.14.0" +typeguard = ">=2.13.3,<5.0.0" typing-extensions = ">=3.8,<5.0" [[package]] @@ -375,13 +378,13 @@ files = [ [[package]] name = "tomli" -version = "2.0.1" +version = "2.0.2" description = "A lil' TOML parser" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, + {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, + {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, ] [[package]] @@ -412,13 +415,13 @@ files = [ [[package]] name = "urllib3" -version = "1.26.19" +version = "1.26.20" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "urllib3-1.26.19-py2.py3-none-any.whl", hash = "sha256:37a0344459b199fce0e80b0d3569837ec6b6937435c5244e7fd73fa6006830f3"}, - {file = "urllib3-1.26.19.tar.gz", hash = "sha256:3e3d753a8618b86d7de333b4223005f68720bcd6a7d2bcb9fbd2229ec7c1e429"}, + {file = "urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e"}, + {file = "urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"}, ] [package.extras] @@ -428,13 +431,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "urllib3" -version = "2.2.2" +version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, - {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] @@ -445,20 +448,24 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "zipp" -version = "3.20.0" +version = "3.20.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.20.0-py3-none-any.whl", hash = "sha256:58da6168be89f0be59beb194da1250516fdaa062ccebd30127ac65d30045e10d"}, - {file = "zipp-3.20.0.tar.gz", hash = "sha256:0145e43d89664cfe1a2e533adc75adafed82fe2da404b4bbb6b026c0157bdb31"}, + {file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"}, + {file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"}, ] [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "df6f60917acd24161722e169e6a58a449a0479fe0c945d925bd40c0dce502ed9" +content-hash = "8b06a13de59ed4d85870c3fec6d18eaf3084a2e0d03cf70bf7beba9b67975868" diff --git a/layer_v3/pyproject.toml b/layer_v3/pyproject.toml index a72a5a80520..ebc35d0ba6e 100644 --- a/layer_v3/pyproject.toml +++ b/layer_v3/pyproject.toml @@ -1,13 +1,13 @@ [tool.poetry] name = "aws-lambda-powertools-python-layer" -version = "1.1.0" +version = "3.0.0" description = "Powertools for AWS Lambda (Python) Lambda Layers" authors = ["Powertools for AWS Maintainers "] license = "MIT" [tool.poetry.dependencies] python = "^3.8" -cdk-aws-lambda-powertools-layer = "^3.8.0" +aws-cdk-lib = "^2.161.0" [tool.poetry.dev-dependencies] pytest = "^7.1.2"