diff --git a/.github/workflows/quality_check.yml b/.github/workflows/quality_check.yml index 0f63716c09d..77e78201f70 100644 --- a/.github/workflows/quality_check.yml +++ b/.github/workflows/quality_check.yml @@ -68,6 +68,8 @@ jobs: run: make mypy - name: Test with pytest run: make test + - name: Test dependencies with Nox + run: make test-dependencies - name: Security baseline run: make security-baseline - name: Complexity baseline diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc37371cb88..dc04db7ce4f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,7 @@ timeline Pre-Pull Request
(make pr) : Code linting : Docs linting : Static typing analysis - : Tests (unit|functional|perf) + : Tests (unit|functional|perf|dependencies) : Security baseline : Complexity baseline : +pre-commit checks diff --git a/Makefile b/Makefile index 55bed054c32..85bb6a9d81d 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,9 @@ test: poetry run pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=xml poetry run pytest --cache-clear tests/performance +test-dependencies: + poetry run nox --error-on-external-run --reuse-venv=yes --non-interactive + test-pydanticv2: poetry run pytest -m "not perf" --ignore tests/e2e @@ -47,7 +50,7 @@ coverage-html: pre-commit: pre-commit run --show-diff-on-failure -pr: lint lint-docs mypy pre-commit test security-baseline complexity-baseline +pr: lint lint-docs mypy pre-commit test test-dependencies security-baseline complexity-baseline build: pr poetry build diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 00000000000..18a9e9cd4d5 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,58 @@ +# Run nox tests +# +# usage: +# poetry run nox --error-on-external-run --reuse-venv=yes --non-interactive +# +# If you want to target a specific Python version, add -p parameter + +from typing import List, Optional + +import nox + +PREFIX_TESTS_FUNCTIONAL = "tests/functional" +PREFIX_TESTS_UNIT = "tests/unit" + + +def build_and_run_test(session: nox.Session, folders: List, extras: Optional[str] = "") -> None: + """ + This function is responsible for setting up the testing environment and running the test suite for specific feature. + + The function performs the following tasks: + 1. Installs the required dependencies for executing any test + 2. If the `extras` parameter is provided, the function installs the additional dependencies + 3. the function runs the pytest command with the specified folders as arguments, executing the test suite. + + Parameters + ---------- + session: nox.Session + The current Nox session object, which is used to manage the virtual environment and execute commands. + folders: List + A list of folder paths that contain the test files to be executed. + extras: Optional[str] + A string representing additional dependencies that should be installed for the test environment. + If not provided, the function will install the project with basic dependencies + """ + + # Required install to execute any test + session.install("poetry", "pytest", "pytest-mock", "pytest_socket") + + # Powertools project folder is in the root + if extras: + session.install(f"./[{extras}]") + else: + session.install("./") + + # Execute test in specific folders + session.run("pytest", *folders) + + +@nox.session() +def test_with_only_required_packages(session: nox.Session): + """Tests that only depends for required libraries""" + # Logger + build_and_run_test( + session, + folders=[ + f"{PREFIX_TESTS_FUNCTIONAL}/logger/", + ], + ) diff --git a/poetry.lock b/poetry.lock index 3e29ecbd9bd..ab84623e119 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "anyio" @@ -22,6 +22,20 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] +[[package]] +name = "argcomplete" +version = "3.4.0" +description = "Bash tab completion for argparse" +optional = false +python-versions = ">=3.8" +files = [ + {file = "argcomplete-3.4.0-py3-none-any.whl", hash = "sha256:69a79e083a716173e5532e0fa3bef45f793f4e61096cf52b5a42c0211c8b8aa5"}, + {file = "argcomplete-3.4.0.tar.gz", hash = "sha256:c2abcdfe1be8ace47ba777d4fce319eb13bf8ad9dace8d085dcad6eded88057f"}, +] + +[package.extras] +test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] + [[package]] name = "async-timeout" version = "4.0.3" @@ -349,17 +363,17 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "boto3" -version = "1.34.114" +version = "1.34.128" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.34.114-py3-none-any.whl", hash = "sha256:4460958d2b0c53bd2195b23ed5d45db2350e514486fe8caeb38b285b30742280"}, - {file = "boto3-1.34.114.tar.gz", hash = "sha256:eeb11bca9b19d12baf93436fb8a16b8b824f1f7e8b9bcc722607e862c46b1b08"}, + {file = "boto3-1.34.128-py3-none-any.whl", hash = "sha256:a048ff980a81cd652724a73bc496c519b336fabe19cc8bfc6c53b2ff6eb22c7b"}, + {file = "boto3-1.34.128.tar.gz", hash = "sha256:43a6e99f53a8d34b3b4dbe424dbcc6b894350dc41a85b0af7c7bc24a7ec2cead"}, ] [package.dependencies] -botocore = ">=1.34.114,<1.35.0" +botocore = ">=1.34.128,<1.35.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -368,13 +382,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.114" +version = "1.34.128" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.114-py3-none-any.whl", hash = "sha256:606d1e55984d45e41a812badee292755f4db0233eed9cca63ea3bb8f5755507f"}, - {file = "botocore-1.34.114.tar.gz", hash = "sha256:5705f74fda009656a218ffaf4afd81228359160f2ab806ab8222d07e9da3a73b"}, + {file = "botocore-1.34.128-py3-none-any.whl", hash = "sha256:db67fda136c372ab3fa432580c819c89ba18d28a6152a4d2a7ea40d44082892e"}, + {file = "botocore-1.34.128.tar.gz", hash = "sha256:8d8e03f7c8c080ecafda72036eb3b482d649f8417c90b5dca33b7c2c47adb0c9"}, ] [package.dependencies] @@ -386,7 +400,7 @@ urllib3 = [ ] [package.extras] -crt = ["awscrt (==0.20.9)"] +crt = ["awscrt (==0.20.11)"] [[package]] name = "bytecode" @@ -466,13 +480,13 @@ typeguard = ">=2.13.3,<2.14.0" [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.6.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, + {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, + {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, ] [[package]] @@ -697,6 +711,23 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "colorlog" +version = "6.8.2" +description = "Add colours to the output of Python's logging module." +optional = false +python-versions = ">=3.6" +files = [ + {file = "colorlog-6.8.2-py3-none-any.whl", hash = "sha256:4dcbb62368e2800cb3c5abd348da7e53f6c362dda502ec27c560b2e58a66bd33"}, + {file = "colorlog-6.8.2.tar.gz", hash = "sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} + +[package.extras] +development = ["black", "flake8", "mypy", "pytest", "types-colorama"] + [[package]] name = "constructs" version = "10.3.0" @@ -782,43 +813,43 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "42.0.7" +version = "42.0.8" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-42.0.7-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:a987f840718078212fdf4504d0fd4c6effe34a7e4740378e59d47696e8dfb477"}, - {file = "cryptography-42.0.7-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:bd13b5e9b543532453de08bcdc3cc7cebec6f9883e886fd20a92f26940fd3e7a"}, - {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a79165431551042cc9d1d90e6145d5d0d3ab0f2d66326c201d9b0e7f5bf43604"}, - {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a47787a5e3649008a1102d3df55424e86606c9bae6fb77ac59afe06d234605f8"}, - {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:02c0eee2d7133bdbbc5e24441258d5d2244beb31da5ed19fbb80315f4bbbff55"}, - {file = "cryptography-42.0.7-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:5e44507bf8d14b36b8389b226665d597bc0f18ea035d75b4e53c7b1ea84583cc"}, - {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:7f8b25fa616d8b846aef64b15c606bb0828dbc35faf90566eb139aa9cff67af2"}, - {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:93a3209f6bb2b33e725ed08ee0991b92976dfdcf4e8b38646540674fc7508e13"}, - {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e6b8f1881dac458c34778d0a424ae5769de30544fc678eac51c1c8bb2183e9da"}, - {file = "cryptography-42.0.7-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3de9a45d3b2b7d8088c3fbf1ed4395dfeff79d07842217b38df14ef09ce1d8d7"}, - {file = "cryptography-42.0.7-cp37-abi3-win32.whl", hash = "sha256:789caea816c6704f63f6241a519bfa347f72fbd67ba28d04636b7c6b7da94b0b"}, - {file = "cryptography-42.0.7-cp37-abi3-win_amd64.whl", hash = "sha256:8cb8ce7c3347fcf9446f201dc30e2d5a3c898d009126010cbd1f443f28b52678"}, - {file = "cryptography-42.0.7-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:a3a5ac8b56fe37f3125e5b72b61dcde43283e5370827f5233893d461b7360cd4"}, - {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:779245e13b9a6638df14641d029add5dc17edbef6ec915688f3acb9e720a5858"}, - {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d563795db98b4cd57742a78a288cdbdc9daedac29f2239793071fe114f13785"}, - {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:31adb7d06fe4383226c3e963471f6837742889b3c4caa55aac20ad951bc8ffda"}, - {file = "cryptography-42.0.7-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:efd0bf5205240182e0f13bcaea41be4fdf5c22c5129fc7ced4a0282ac86998c9"}, - {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:a9bc127cdc4ecf87a5ea22a2556cab6c7eda2923f84e4f3cc588e8470ce4e42e"}, - {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:3577d029bc3f4827dd5bf8bf7710cac13527b470bbf1820a3f394adb38ed7d5f"}, - {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2e47577f9b18723fa294b0ea9a17d5e53a227867a0a4904a1a076d1646d45ca1"}, - {file = "cryptography-42.0.7-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:1a58839984d9cb34c855197043eaae2c187d930ca6d644612843b4fe8513c886"}, - {file = "cryptography-42.0.7-cp39-abi3-win32.whl", hash = "sha256:e6b79d0adb01aae87e8a44c2b64bc3f3fe59515280e00fb6d57a7267a2583cda"}, - {file = "cryptography-42.0.7-cp39-abi3-win_amd64.whl", hash = "sha256:16268d46086bb8ad5bf0a2b5544d8a9ed87a0e33f5e77dd3c3301e63d941a83b"}, - {file = "cryptography-42.0.7-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2954fccea107026512b15afb4aa664a5640cd0af630e2ee3962f2602693f0c82"}, - {file = "cryptography-42.0.7-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:362e7197754c231797ec45ee081f3088a27a47c6c01eff2ac83f60f85a50fe60"}, - {file = "cryptography-42.0.7-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4f698edacf9c9e0371112792558d2f705b5645076cc0aaae02f816a0171770fd"}, - {file = "cryptography-42.0.7-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5482e789294854c28237bba77c4c83be698be740e31a3ae5e879ee5444166582"}, - {file = "cryptography-42.0.7-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e9b2a6309f14c0497f348d08a065d52f3020656f675819fc405fb63bbcd26562"}, - {file = "cryptography-42.0.7-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d8e3098721b84392ee45af2dd554c947c32cc52f862b6a3ae982dbb90f577f14"}, - {file = "cryptography-42.0.7-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c65f96dad14f8528a447414125e1fc8feb2ad5a272b8f68477abbcc1ea7d94b9"}, - {file = "cryptography-42.0.7-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:36017400817987670037fbb0324d71489b6ead6231c9604f8fc1f7d008087c68"}, - {file = "cryptography-42.0.7.tar.gz", hash = "sha256:ecbfbc00bf55888edda9868a4cf927205de8499e7fabe6c050322298382953f2"}, + {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:81d8a521705787afe7a18d5bfb47ea9d9cc068206270aad0b96a725022e18d2e"}, + {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:961e61cefdcb06e0c6d7e3a1b22ebe8b996eb2bf50614e89384be54c48c6b63d"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e3ec3672626e1b9e55afd0df6d774ff0e953452886e06e0f1eb7eb0c832e8902"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e599b53fd95357d92304510fb7bda8523ed1f79ca98dce2f43c115950aa78801"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5226d5d21ab681f432a9c1cf8b658c0cb02533eece706b155e5fbd8a0cdd3949"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:6b7c4f03ce01afd3b76cf69a5455caa9cfa3de8c8f493e0d3ab7d20611c8dae9"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:2346b911eb349ab547076f47f2e035fc8ff2c02380a7cbbf8d87114fa0f1c583"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ad803773e9df0b92e0a817d22fd8a3675493f690b96130a5e24f1b8fabbea9c7"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2f66d9cd9147ee495a8374a45ca445819f8929a3efcd2e3df6428e46c3cbb10b"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d45b940883a03e19e944456a558b67a41160e367a719833c53de6911cabba2b7"}, + {file = "cryptography-42.0.8-cp37-abi3-win32.whl", hash = "sha256:a0c5b2b0585b6af82d7e385f55a8bc568abff8923af147ee3c07bd8b42cda8b2"}, + {file = "cryptography-42.0.8-cp37-abi3-win_amd64.whl", hash = "sha256:57080dee41209e556a9a4ce60d229244f7a66ef52750f813bfbe18959770cfba"}, + {file = "cryptography-42.0.8-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:dea567d1b0e8bc5764b9443858b673b734100c2871dc93163f58c46a97a83d28"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4783183f7cb757b73b2ae9aed6599b96338eb957233c58ca8f49a49cc32fd5e"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0608251135d0e03111152e41f0cc2392d1e74e35703960d4190b2e0f4ca9c70"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dc0fdf6787f37b1c6b08e6dfc892d9d068b5bdb671198c72072828b80bd5fe4c"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9c0c1716c8447ee7dbf08d6db2e5c41c688544c61074b54fc4564196f55c25a7"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fff12c88a672ab9c9c1cf7b0c80e3ad9e2ebd9d828d955c126be4fd3e5578c9e"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:cafb92b2bc622cd1aa6a1dce4b93307792633f4c5fe1f46c6b97cf67073ec961"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:31f721658a29331f895a5a54e7e82075554ccfb8b163a18719d342f5ffe5ecb1"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b297f90c5723d04bcc8265fc2a0f86d4ea2e0f7ab4b6994459548d3a6b992a14"}, + {file = "cryptography-42.0.8-cp39-abi3-win32.whl", hash = "sha256:2f88d197e66c65be5e42cd72e5c18afbfae3f741742070e3019ac8f4ac57262c"}, + {file = "cryptography-42.0.8-cp39-abi3-win_amd64.whl", hash = "sha256:fa76fbb7596cc5839320000cdd5d0955313696d9511debab7ee7278fc8b5c84a"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ba4f0a211697362e89ad822e667d8d340b4d8d55fae72cdd619389fb5912eefe"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:81884c4d096c272f00aeb1f11cf62ccd39763581645b0812e99a91505fa48e0c"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c9bb2ae11bfbab395bdd072985abde58ea9860ed84e59dbc0463a5d0159f5b71"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7016f837e15b0a1c119d27ecd89b3515f01f90a8615ed5e9427e30d9cdbfed3d"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5a94eccb2a81a309806027e1670a358b99b8fe8bfe9f8d329f27d72c094dde8c"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:dec9b018df185f08483f294cae6ccac29e7a6e0678996587363dc352dc65c842"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:343728aac38decfdeecf55ecab3264b015be68fc2816ca800db649607aeee648"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:013629ae70b40af70c9a7a5db40abe5d9054e6f4380e50ce769947b73bf3caad"}, + {file = "cryptography-42.0.8.tar.gz", hash = "sha256:8d09d05439ce7baa8e9e95b07ec5b6c886f548deb7e0f69ef25f64b3bce842f2"}, ] [package.dependencies] @@ -891,71 +922,71 @@ serialization = ["protobuf (>=3.0.0)"] [[package]] name = "ddtrace" -version = "2.9.0" +version = "2.9.1" description = "Datadog APM client library" optional = false python-versions = ">=3.7" files = [ - {file = "ddtrace-2.9.0-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:95f6f23f935c3a4a43b02245067bf50f54057bebb32dd32fdcaa2db7affc4862"}, - {file = "ddtrace-2.9.0-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:4daa39ed9b9f8f932a386ed0d697767e9b982a34db0b2347c581f3b656dc8e90"}, - {file = "ddtrace-2.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da6f8e31104f673a5dd5b246c9b877be143cdac0a9428b262d4dba7df78349af"}, - {file = "ddtrace-2.9.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2e8caf09ec0fbd05bdc7a397680deeace7319fb047f4cf14a376c3e21d507d69"}, - {file = "ddtrace-2.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b01a4438f2d08b112641114bad7ead09fa31a450242db038f5c3c2973fdaab6f"}, - {file = "ddtrace-2.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:243b100d1db0e0652480d1cee4ee2b367846791b769421a275d5dda141b39df9"}, - {file = "ddtrace-2.9.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cce137825e24e029978ad0556a360328098cee7e1e23bae91012f6765eb616f4"}, - {file = "ddtrace-2.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7b5fd5d4cc7fe035213179e3a98102ccf43e9baefd499d3a421658e22aacf20f"}, - {file = "ddtrace-2.9.0-cp310-cp310-win32.whl", hash = "sha256:a534604c03edcb899c03901845271953e7f32b98695400e7db59739c4f736dc5"}, - {file = "ddtrace-2.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:07030249c095b67a63381a7b5a01a5321b6991df2677fe487a78f7703e3ed6d0"}, - {file = "ddtrace-2.9.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e79a0f58ad413aaaa1a3249fae21a00cf4980250b2456bea55e2a5b1dc793c28"}, - {file = "ddtrace-2.9.0-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:75387aa906efde0a07dcb3ae27cf4b9cbe2d6480d5a5a4bec8199f7462b0d8a8"}, - {file = "ddtrace-2.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:622d0af63e28cb973bfd94809ced69b93c1560e2a30cddbd6091672c9d3e007a"}, - {file = "ddtrace-2.9.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2afb9e3623a6cd7a1757dd3771a9a8b7932ce088589929e9a97e18623cc7dae1"}, - {file = "ddtrace-2.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f22f65537cfbe43aeec9321d528924a99256f18141bd23afdb3aa19d71393acd"}, - {file = "ddtrace-2.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:53c1eca06c85d99d36cb0dcb7f0062a5b05ac4fbfbaffbc3c9d3982ceadef39b"}, - {file = "ddtrace-2.9.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1d2f123002c47f4f52ee55faf4080d3dde86b85dd90e34b6dcbbe64958490ecd"}, - {file = "ddtrace-2.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bf62180016d026689dc62244900409a5e111618a436c0231e46cf676fb3bbb11"}, - {file = "ddtrace-2.9.0-cp311-cp311-win32.whl", hash = "sha256:417b60d6cec637a027d448801ced48d41fe6e4ff48a835e2d06eae6b5255f0c4"}, - {file = "ddtrace-2.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:cf14cb2e893734d8a9116d2d21ef6286d60e1a1f751bb5c3460c85b73bd73123"}, - {file = "ddtrace-2.9.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:ed1f636c7c151fee5a71b65b067d71e46789f980fc381728e693e0574ea9c1af"}, - {file = "ddtrace-2.9.0-cp312-cp312-macosx_11_0_x86_64.whl", hash = "sha256:e16b14b3644046a66764d97269f96ee359f0c9366bbca615ecd4cebdc21b612d"}, - {file = "ddtrace-2.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7625829a8bc6de5b2b01ab21c02d489a0f4bc166baae1c007786472c7a3b892d"}, - {file = "ddtrace-2.9.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:166292b189a90f9bf8affde627d844e5502a527903c5620a28c6713a7c8590cc"}, - {file = "ddtrace-2.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08ab866972d485ebd5dd764a9264be67833ec70a845cf64478299ff61fb4f828"}, - {file = "ddtrace-2.9.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:6457c6262fd42d901e9c6f428ab950b8c8dba508512201efd1af92cbf42732a6"}, - {file = "ddtrace-2.9.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:d5d21ec52b3a0476e29407db9928dc59c97f0f16c6972eb893cfa351b3f9b93d"}, - {file = "ddtrace-2.9.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:6adf27d4e1b7d4253cabc9b766346d4e1f466997f7ac620e68edd2fd0f245e59"}, - {file = "ddtrace-2.9.0-cp312-cp312-win32.whl", hash = "sha256:dc9b6255c7d12db446b4e940f1cb5a98943a13d8ca98be7f47e611c10cca6596"}, - {file = "ddtrace-2.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:3842f2039a631eb1fc8feefdb30d4bad8a74fdbf5b0df377d170b34aba8337a3"}, - {file = "ddtrace-2.9.0-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:b40e8080cc22d82613bb14b21f51550f93ce5f6a664c70287f673ed827723016"}, - {file = "ddtrace-2.9.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53d6635aef649650aebb8f870ce7eef472a837dcce9ada45dfbab2af4b9cb20a"}, - {file = "ddtrace-2.9.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:16e1ea6a507dd382b282430b00b33d819ca303143fafd02b494c90ae8531f849"}, - {file = "ddtrace-2.9.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc19958fd370b6c116a7729d2d2697ca150ded3951e6154a74755b6ca175d28a"}, - {file = "ddtrace-2.9.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:e99b2ad009d104fa58bdcaf35b69ade699101b93e267af1e1096602428e554e7"}, - {file = "ddtrace-2.9.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b8422969326af5574435f96a2a4715d025e51e4b456f56879057679c741d3f38"}, - {file = "ddtrace-2.9.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b46aa1da359e3b156e769b70df7441813f36b927f19d06885ab5b3ca4710c5a1"}, - {file = "ddtrace-2.9.0-cp37-cp37m-win32.whl", hash = "sha256:2adc40996fd4f88850d3356fcd2bf24db5b755ae0d9f5eeed36cbab31958f03d"}, - {file = "ddtrace-2.9.0-cp37-cp37m-win_amd64.whl", hash = "sha256:a2292449f9fca0fc9543f71cf31d55ecb201a34dff210e22159cc2746c133565"}, - {file = "ddtrace-2.9.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:d11895cbe71f140c4d220dcda06bb06c77d41e9101b4cd3c2f1d3ee3ae06b7cd"}, - {file = "ddtrace-2.9.0-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:3f1c36c4d819394639b9976fc2eecc2dab56bde960b8ca9f05ef936893eaa979"}, - {file = "ddtrace-2.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4bcb78811f8190f45ddc28e41f3c5dd2ea02aa4d0a2db5d75417b23ae9b35804"}, - {file = "ddtrace-2.9.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b19f1a4c17c767701923365813d1ccf3f46ce456418b735699b139f3c4bdbca"}, - {file = "ddtrace-2.9.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8e061570554051550e271126989c466471e810b65fcd7e9543fd4f56d567743"}, - {file = "ddtrace-2.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4f912e21d4f2c0d1fed1a69e22282c02900bafbe1e8180f008534a837838de16"}, - {file = "ddtrace-2.9.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:aa502b336ecb7fc4aee0263392639c9f9f4dfef879667a2c341838263d151e02"}, - {file = "ddtrace-2.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2ded8f9387e1967dd739e34ec874eddd42c4ad80c15c67050ed7fdffbbc88a3e"}, - {file = "ddtrace-2.9.0-cp38-cp38-win32.whl", hash = "sha256:82409c86fc12f7c7969e8538610eef8a74fc839d33e5a2ea64ad50011c296cbf"}, - {file = "ddtrace-2.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:976188aadb18175810cb8ff966cb66a923cb3c4d6df5214b25ffb65369655ff5"}, - {file = "ddtrace-2.9.0-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:c69f7cd19f1e170dde5601a38e9ed860cbf3bf81c447a2a56f8a9e7bbab48a14"}, - {file = "ddtrace-2.9.0-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:d5bbdc3ea83e6edb4553792b0513f5745b73d1be457338fd78b4e07ac4acfa19"}, - {file = "ddtrace-2.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e4147d0ad2996a18ad705873e4ae09c44b439d82fcfddb17a13a9f2f94555a4"}, - {file = "ddtrace-2.9.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:835238b6488d85c36a41933201ee0a6e7e42eacf9ba4622b987ce0cd2edec18d"}, - {file = "ddtrace-2.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8b5227380ea379c8f0c8cdb6cfd98d432d16ff2e53a7141b335fb4d7a4ddc7d9"}, - {file = "ddtrace-2.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:fd41ca7ce56ff0f3eeeaee77fd9ab471554c58d0dfb68e6a10f10f756665b697"}, - {file = "ddtrace-2.9.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ccc7f85ce0a3ba51da52f54f00bd156886e61162497eb9b940c0b8741026ba35"}, - {file = "ddtrace-2.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ecd5575dca41fe09f814badb3885ec0f70a241b3c18133da609be276b8a370e2"}, - {file = "ddtrace-2.9.0-cp39-cp39-win32.whl", hash = "sha256:ec6e49b389a60d183f472eeef308354962792137d9a5019895a8dd01925007fa"}, - {file = "ddtrace-2.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:c9a7e267862e86f153e17f0ff347743aa13fad18d6efd1b40b0301623dfde70e"}, - {file = "ddtrace-2.9.0.tar.gz", hash = "sha256:f12fba84cfeb11a0a823e85e5b81ad56a2ea3a9de6a4f5a2c1a4038671afe521"}, + {file = "ddtrace-2.9.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:4c20a7b15100315138a60f8234af4aadd3b8cc177e231d47c35432cf7e69b575"}, + {file = "ddtrace-2.9.1-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:82abb15c0bdb8fe59f02e69825feafcb5979908904aad3ae73c0ed3592977892"}, + {file = "ddtrace-2.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc4c857a4023d840432e9a9e8be109c1ab2f8d3910ee5a300981e784d185e67d"}, + {file = "ddtrace-2.9.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0df9b59459819858b602985a22f12ec65cfe2441ef958f4ed079d18201f038a8"}, + {file = "ddtrace-2.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dce2f97dcccd3147a9b672c98b70bad6aec2c21b5fb27d9efbef413a4f784eef"}, + {file = "ddtrace-2.9.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7a76a55302c09e7347fc8ab4a18b5f5bd8161eeffbc37cef82a8de547468783c"}, + {file = "ddtrace-2.9.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e694e9d89b0825f4f829db8a1f3f90055419f34ae89e744369de27cb3473cb95"}, + {file = "ddtrace-2.9.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:29c7d8126fefde2b2bdac1f6a8520fa524f1da5e1a857140d50e97649979055e"}, + {file = "ddtrace-2.9.1-cp310-cp310-win32.whl", hash = "sha256:4b41f02f3110b3e08a884727ca927df568a8ce62db680a364f667cc09e5e754f"}, + {file = "ddtrace-2.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:f8c7998f510840b660c850f5fe5d4157d68d6793de5dbcd742fee6c390d16879"}, + {file = "ddtrace-2.9.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:d4c63866d42299a6f51b9b52908107241c98f129caa1d26b9aa50867c52551d6"}, + {file = "ddtrace-2.9.1-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:64225d093faee8b702f9604d18301361e808933282313d9b11bfd2a048512dd5"}, + {file = "ddtrace-2.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b1f7ffe48a4cddd2e49e91dd51fbeaaf1a18e11eb969d8beb4fccc2c1ca8855"}, + {file = "ddtrace-2.9.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9e6154eca04cfe097b4bbdd874e5ae6eaa1d198f5f1858c4b4b8e9b4ffa93509"}, + {file = "ddtrace-2.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad83d587a565a344d8ef9759ffa190ff701b16df6018e0c2d3696e82e4bf7c42"}, + {file = "ddtrace-2.9.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5cbab236b72c153283623d0c9d625df777f0dbf272f35c428e3f42b7f4ca69a8"}, + {file = "ddtrace-2.9.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:f6c74a84e73b781a71418f2c173e75c9e328bcf483aab408be377d6cf284fd11"}, + {file = "ddtrace-2.9.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0b8c78edd95658c20c35759b92e7349347dd40bf729bbb0fb49009fb84bc2c55"}, + {file = "ddtrace-2.9.1-cp311-cp311-win32.whl", hash = "sha256:c5d33b3468fb80284f60b21b83bcea00c4f503218315169122e981d51d79798b"}, + {file = "ddtrace-2.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:fc9b8d1f0933bc683af7d1d62082bd68eb8be8757a7340a4a73cc0619a997d34"}, + {file = "ddtrace-2.9.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:439ef7ee79772997d2157dcc5897d05bd7ae324e86d97e4bc9779b37db77794c"}, + {file = "ddtrace-2.9.1-cp312-cp312-macosx_11_0_x86_64.whl", hash = "sha256:5483022683a2f648665e29814cc612d7cb2a69660e18c14813b3cfc36f045f03"}, + {file = "ddtrace-2.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64f4c48a2d6b82fe16be4d0a43e6da837621b9b02d7fc7dbd5ada74cb2da079d"}, + {file = "ddtrace-2.9.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c01037998a618e4ed8805be0686ee2098773d25b73442b553b81515afb3da425"}, + {file = "ddtrace-2.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06defd1e6db28a155bf5f8face471090bfdec0a670a03fd3df8d6406ba572e78"}, + {file = "ddtrace-2.9.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:f82987475530d805eec232381be074814d1e0d25bc22018d75b504aa2086b3b9"}, + {file = "ddtrace-2.9.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:24eeaaa04f1a0a0578f6a29e1e128592c29dd6311a5c9d2a7fcff63b732c1729"}, + {file = "ddtrace-2.9.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9df34ac4a900963dde5acb15f9202426b3f941bbb8baff1ee45d5fc74b98b5b1"}, + {file = "ddtrace-2.9.1-cp312-cp312-win32.whl", hash = "sha256:e8b85212ff5fa3e6f6c06f55c953266f45c88c41d8a1f816a7147eed48629049"}, + {file = "ddtrace-2.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:9999d1a19aeccec7a8fd1111dd71bbeb6df836616a2dbf0053552b59ff4d5727"}, + {file = "ddtrace-2.9.1-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:40e3f90dcbff55a1463424cb8e9c0581db13da88576b5c8cb4fcbed23defd691"}, + {file = "ddtrace-2.9.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d5a4f6634ccfcff933551a6e7521914e80d94f624ada4f06b6d4e7b867e05b4"}, + {file = "ddtrace-2.9.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd624294820d0c563b5e9adea581a91091dc0bd8c68799f8e6d9cae670686db4"}, + {file = "ddtrace-2.9.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:612be4a001c358a336d9b25600108feb251ef7167d6e9b8def2193ad28f1b0c6"}, + {file = "ddtrace-2.9.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1bd360b4661c59e50d8a1e8114faa79404673590127985fd6b61db24e0499513"}, + {file = "ddtrace-2.9.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:fe6da949bcd9764b7436867a5f2263fac677dafa58c6557e89a611dbfa4be1c0"}, + {file = "ddtrace-2.9.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e0b58043a08dcbd33dfb4365bf0e5a5ac91914f848fa5733cc5e0c6f90269b19"}, + {file = "ddtrace-2.9.1-cp37-cp37m-win32.whl", hash = "sha256:f9c6e764df8a859573a8713eff65d8031465d96941ac78ecfb9b8319c137a8db"}, + {file = "ddtrace-2.9.1-cp37-cp37m-win_amd64.whl", hash = "sha256:3fab5caa34c6de49642f801ed4738ce032acf44c728db02686bae194e4347c88"}, + {file = "ddtrace-2.9.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:f76b47cf22c1678bdd9197dc322ff7f776454006e4dcaa429af494919344b2ec"}, + {file = "ddtrace-2.9.1-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:27fd4394b1c0189b50fad186612b629556912991b4233a196a74f8be8b8b6ba4"}, + {file = "ddtrace-2.9.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6e645902ad10503071537174acdd22159af35a1488e20a9b980559b7714822d"}, + {file = "ddtrace-2.9.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96fbd4cc9086556877b6c31a6ce43b599de676f1b5e00a2e7a1773fc0e9b2bb8"}, + {file = "ddtrace-2.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff78cf54e4526e03f15336cb476b9011b6a012a5356675a233ad3a6335d80ca8"}, + {file = "ddtrace-2.9.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:eb371d6b196435034440b5dc7d565ca0161885f971fcb45bde1774278e593131"}, + {file = "ddtrace-2.9.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0eca78a0c251678e83563c93881a459db547f85ced930a83a76255f28516e834"}, + {file = "ddtrace-2.9.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bdb0219a11b6da9bdb428f377077d5ceb88048ee9deba100905256f21a4564aa"}, + {file = "ddtrace-2.9.1-cp38-cp38-win32.whl", hash = "sha256:eab490d9074bf2bdcafc9925442c6a1e842c13bf9c593763e487aa9585e8214a"}, + {file = "ddtrace-2.9.1-cp38-cp38-win_amd64.whl", hash = "sha256:9baec20b1bc9c04fb4aaf2923c4ff2c3390a6ee171189213d9d8e777029b1d47"}, + {file = "ddtrace-2.9.1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:af8f78f2a056868a003c04559469e37de3aa24311c9f02de0e8fd56c0520b868"}, + {file = "ddtrace-2.9.1-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:22a2facabc9f560b7cf3d33ef0250a55b6251cdcca6f7e2f00b1e7397f1b2a23"}, + {file = "ddtrace-2.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:895ad47108f096ef72f477c84157671054b5cfba7551511cf5686258ab1f0337"}, + {file = "ddtrace-2.9.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56d974320df77d19bbad52fe9a2be040ccbee3fcf5abbdd4e15a236be9c259f1"}, + {file = "ddtrace-2.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d53097177580da6f338a832d53e48cd630fd4d5d8cedd5128989360d6bf7afe9"}, + {file = "ddtrace-2.9.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3ef829673f161756b37a2c22ac99a282e46a1187b4dd7a93b30d0dacfd66e56d"}, + {file = "ddtrace-2.9.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:568ef280d9df5113f838b126d7358d4d434bdf94f60bf6d30bf74cbf92620224"}, + {file = "ddtrace-2.9.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:05c883d2c01026bc09c89ed516ab9a63398ec151c1873f435f5f8c1f04b5b094"}, + {file = "ddtrace-2.9.1-cp39-cp39-win32.whl", hash = "sha256:3b4bb28bacd6206de1d40b9dfd89ee4a554da1dd6f3928ab0a6cd5b1c75da26c"}, + {file = "ddtrace-2.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:7aea36fb9dcb86d4168f272e8b796ef0a5549570b1351dc55c1a8b77652e4652"}, + {file = "ddtrace-2.9.1.tar.gz", hash = "sha256:27f10bdb888f79d5eddaa730d99cf42078ee5adb72e54e650884d94ceb5ba676"}, ] [package.dependencies] @@ -972,7 +1003,6 @@ opentelemetry-api = ">=1" protobuf = ">=3" setuptools = {version = "*", markers = "python_version >= \"3.12\""} six = ">=1.12.0" -sqlparse = ">=0.2.2" typing-extensions = "*" xmltodict = ">=0.12" @@ -1037,6 +1067,17 @@ files = [ graph = ["objgraph (>=1.7.2)"] profile = ["gprof2dot (>=2022.7.29)"] +[[package]] +name = "distlib" +version = "0.3.8" +description = "Distribution utilities" +optional = false +python-versions = "*" +files = [ + {file = "distlib-0.3.8-py2.py3-none-any.whl", hash = "sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784"}, + {file = "distlib-0.3.8.tar.gz", hash = "sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64"}, +] + [[package]] name = "docker" version = "7.1.0" @@ -1523,13 +1564,13 @@ ply = "*" [[package]] name = "jsonpickle" -version = "3.0.4" -description = "Serialize any Python object to JSON" +version = "3.2.1" +description = "Python library for serializing arbitrary object graphs into JSON" optional = false python-versions = ">=3.7" files = [ - {file = "jsonpickle-3.0.4-py3-none-any.whl", hash = "sha256:04ae7567a14269579e3af66b76bda284587458d7e8a204951ca8f71a3309952e"}, - {file = "jsonpickle-3.0.4.tar.gz", hash = "sha256:a1b14c8d6221cd8f394f2a97e735ea1d7edc927fbd135b26f2f8700657c8c62b"}, + {file = "jsonpickle-3.2.1-py3-none-any.whl", hash = "sha256:ec291e4719674dd35d390fbdb521ac6517fbe9f541d361c8bffc8131133b1661"}, + {file = "jsonpickle-3.2.1.tar.gz", hash = "sha256:4b6d7640974199f7acf9035295365b5a1a71a91109effa15ba170fbb48cf871c"}, ] [package.extras] @@ -1539,13 +1580,13 @@ testing = ["bson", "ecdsa", "feedparser", "gmpy2", "numpy", "pandas", "pymongo", [[package]] name = "jsonpointer" -version = "2.4" +version = "3.0.0" description = "Identify specific nodes in a JSON document (RFC 6901)" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*" +python-versions = ">=3.7" files = [ - {file = "jsonpointer-2.4-py2.py3-none-any.whl", hash = "sha256:15d51bba20eea3165644553647711d150376234112651b4f1811022aecad7d7a"}, - {file = "jsonpointer-2.4.tar.gz", hash = "sha256:585cee82b70211fa9e6043b7bb89db6e1aa49524340dde8ad6b63206ea689d88"}, + {file = "jsonpointer-3.0.0-py2.py3-none-any.whl", hash = "sha256:13e088adc14fca8b6aa8177c044e12701e6ad4b28ff10e65f2267a90109c9942"}, + {file = "jsonpointer-3.0.0.tar.gz", hash = "sha256:2b2d729f2091522d61c3b31f82e11870f60b68f43fbc705cb76bf4b832af59ef"}, ] [[package]] @@ -2168,30 +2209,52 @@ doc = ["nb2plots (>=0.6)", "numpydoc (>=1.5)", "pillow (>=9.4)", "pydata-sphinx- extra = ["lxml (>=4.6)", "pydot (>=1.4.2)", "pygraphviz (>=1.10)", "sympy (>=1.10)"] test = ["codecov (>=2.1)", "pytest (>=7.2)", "pytest-cov (>=4.0)"] +[[package]] +name = "nox" +version = "2024.4.15" +description = "Flexible test automation." +optional = false +python-versions = ">=3.7" +files = [ + {file = "nox-2024.4.15-py3-none-any.whl", hash = "sha256:6492236efa15a460ecb98e7b67562a28b70da006ab0be164e8821177577c0565"}, + {file = "nox-2024.4.15.tar.gz", hash = "sha256:ecf6700199cdfa9e5ea0a41ff5e6ef4641d09508eda6edb89d9987864115817f"}, +] + +[package.dependencies] +argcomplete = ">=1.9.4,<4.0" +colorlog = ">=2.6.1,<7.0.0" +packaging = ">=20.9" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} +virtualenv = ">=20.14.1" + +[package.extras] +tox-to-nox = ["jinja2", "tox"] +uv = ["uv (>=0.1.6)"] + [[package]] name = "opentelemetry-api" -version = "1.16.0" +version = "1.25.0" description = "OpenTelemetry Python API" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "opentelemetry_api-1.16.0-py3-none-any.whl", hash = "sha256:79e8f0cf88dbdd36b6abf175d2092af1efcaa2e71552d0d2b3b181a9707bf4bc"}, - {file = "opentelemetry_api-1.16.0.tar.gz", hash = "sha256:4b0e895a3b1f5e1908043ebe492d33e33f9ccdbe6d02d3994c2f8721a63ddddb"}, + {file = "opentelemetry_api-1.25.0-py3-none-any.whl", hash = "sha256:757fa1aa020a0f8fa139f8959e53dec2051cc26b832e76fa839a6d76ecefd737"}, + {file = "opentelemetry_api-1.25.0.tar.gz", hash = "sha256:77c4985f62f2614e42ce77ee4c9da5fa5f0bc1e1821085e9a47533a9323ae869"}, ] [package.dependencies] deprecated = ">=1.2.6" -setuptools = ">=16.0" +importlib-metadata = ">=6.0,<=7.1" [[package]] name = "packaging" -version = "24.0" +version = "24.1" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, - {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] [[package]] @@ -2296,22 +2359,22 @@ files = [ [[package]] name = "protobuf" -version = "5.27.0" +version = "5.27.1" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "protobuf-5.27.0-cp310-abi3-win32.whl", hash = "sha256:2f83bf341d925650d550b8932b71763321d782529ac0eaf278f5242f513cc04e"}, - {file = "protobuf-5.27.0-cp310-abi3-win_amd64.whl", hash = "sha256:b276e3f477ea1eebff3c2e1515136cfcff5ac14519c45f9b4aa2f6a87ea627c4"}, - {file = "protobuf-5.27.0-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:744489f77c29174328d32f8921566fb0f7080a2f064c5137b9d6f4b790f9e0c1"}, - {file = "protobuf-5.27.0-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:f51f33d305e18646f03acfdb343aac15b8115235af98bc9f844bf9446573827b"}, - {file = "protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:56937f97ae0dcf4e220ff2abb1456c51a334144c9960b23597f044ce99c29c89"}, - {file = "protobuf-5.27.0-cp38-cp38-win32.whl", hash = "sha256:a17f4d664ea868102feaa30a674542255f9f4bf835d943d588440d1f49a3ed15"}, - {file = "protobuf-5.27.0-cp38-cp38-win_amd64.whl", hash = "sha256:aabbbcf794fbb4c692ff14ce06780a66d04758435717107c387f12fb477bf0d8"}, - {file = "protobuf-5.27.0-cp39-cp39-win32.whl", hash = "sha256:587be23f1212da7a14a6c65fd61995f8ef35779d4aea9e36aad81f5f3b80aec5"}, - {file = "protobuf-5.27.0-cp39-cp39-win_amd64.whl", hash = "sha256:7cb65fc8fba680b27cf7a07678084c6e68ee13cab7cace734954c25a43da6d0f"}, - {file = "protobuf-5.27.0-py3-none-any.whl", hash = "sha256:673ad60f1536b394b4fa0bcd3146a4130fcad85bfe3b60eaa86d6a0ace0fa374"}, - {file = "protobuf-5.27.0.tar.gz", hash = "sha256:07f2b9a15255e3cf3f137d884af7972407b556a7a220912b252f26dc3121e6bf"}, + {file = "protobuf-5.27.1-cp310-abi3-win32.whl", hash = "sha256:3adc15ec0ff35c5b2d0992f9345b04a540c1e73bfee3ff1643db43cc1d734333"}, + {file = "protobuf-5.27.1-cp310-abi3-win_amd64.whl", hash = "sha256:25236b69ab4ce1bec413fd4b68a15ef8141794427e0b4dc173e9d5d9dffc3bcd"}, + {file = "protobuf-5.27.1-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:4e38fc29d7df32e01a41cf118b5a968b1efd46b9c41ff515234e794011c78b17"}, + {file = "protobuf-5.27.1-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:917ed03c3eb8a2d51c3496359f5b53b4e4b7e40edfbdd3d3f34336e0eef6825a"}, + {file = "protobuf-5.27.1-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:ee52874a9e69a30271649be88ecbe69d374232e8fd0b4e4b0aaaa87f429f1631"}, + {file = "protobuf-5.27.1-cp38-cp38-win32.whl", hash = "sha256:7a97b9c5aed86b9ca289eb5148df6c208ab5bb6906930590961e08f097258107"}, + {file = "protobuf-5.27.1-cp38-cp38-win_amd64.whl", hash = "sha256:f6abd0f69968792da7460d3c2cfa7d94fd74e1c21df321eb6345b963f9ec3d8d"}, + {file = "protobuf-5.27.1-cp39-cp39-win32.whl", hash = "sha256:dfddb7537f789002cc4eb00752c92e67885badcc7005566f2c5de9d969d3282d"}, + {file = "protobuf-5.27.1-cp39-cp39-win_amd64.whl", hash = "sha256:39309898b912ca6febb0084ea912e976482834f401be35840a008da12d189340"}, + {file = "protobuf-5.27.1-py3-none-any.whl", hash = "sha256:4ac7249a1530a2ed50e24201d6630125ced04b30619262f06224616e0030b6cf"}, + {file = "protobuf-5.27.1.tar.gz", hash = "sha256:df5e5b8e39b7d1c25b186ffdf9f44f40f810bbcc9d2b71d9d3156fee5a9adf15"}, ] [[package]] @@ -2837,13 +2900,13 @@ files = [ [[package]] name = "requests" -version = "2.32.2" +version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" files = [ - {file = "requests-2.32.2-py3-none-any.whl", hash = "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c"}, - {file = "requests-2.32.2.tar.gz", hash = "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289"}, + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] [package.dependencies] @@ -3152,21 +3215,6 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] -[[package]] -name = "sqlparse" -version = "0.5.0" -description = "A non-validating SQL parser." -optional = false -python-versions = ">=3.8" -files = [ - {file = "sqlparse-0.5.0-py3-none-any.whl", hash = "sha256:c204494cd97479d0e39f28c93d46c0b2d5959c7b9ab904762ea6c7af211c8663"}, - {file = "sqlparse-0.5.0.tar.gz", hash = "sha256:714d0a4932c059d16189f58ef5411ec2287a4360f17cdd0edd2d09d4c5087c93"}, -] - -[package.extras] -dev = ["build", "hatch"] -doc = ["sphinx"] - [[package]] name = "stevedore" version = "5.2.0" @@ -3183,17 +3231,17 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" [[package]] name = "sympy" -version = "1.12" +version = "1.12.1" description = "Computer algebra system (CAS) in Python" optional = false python-versions = ">=3.8" files = [ - {file = "sympy-1.12-py3-none-any.whl", hash = "sha256:c3588cd4295d0c0f603d0f2ae780587e64e2efeedb3521e46b9bb1d08d184fa5"}, - {file = "sympy-1.12.tar.gz", hash = "sha256:ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8"}, + {file = "sympy-1.12.1-py3-none-any.whl", hash = "sha256:9b2cbc7f1a640289430e13d2a56f02f867a1da0190f2f99d8968c2f74da0e515"}, + {file = "sympy-1.12.1.tar.gz", hash = "sha256:2877b03f998cd8c08f07cd0de5b767119cd3ef40d09f41c30d722f6686b0fb88"}, ] [package.dependencies] -mpmath = ">=0.19" +mpmath = ">=1.1.0,<1.4.0" [[package]] name = "testcontainers" @@ -3324,6 +3372,20 @@ files = [ [package.dependencies] types-urllib3 = "*" +[[package]] +name = "types-requests" +version = "2.32.0.20240602" +description = "Typing stubs for requests" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-requests-2.32.0.20240602.tar.gz", hash = "sha256:3f98d7bbd0dd94ebd10ff43a7fbe20c3b8528acace6d8efafef0b6a184793f06"}, + {file = "types_requests-2.32.0.20240602-py3-none-any.whl", hash = "sha256:ed3946063ea9fbc6b5fc0c44fa279188bae42d582cb63760be6cb4b9d06c3de8"}, +] + +[package.dependencies] +urllib3 = ">=2" + [[package]] name = "types-setuptools" version = "70.0.0.20240524" @@ -3446,13 +3508,13 @@ files = [ [[package]] name = "urllib3" -version = "1.26.18" +version = "1.26.19" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "urllib3-1.26.18-py2.py3-none-any.whl", hash = "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07"}, - {file = "urllib3-1.26.18.tar.gz", hash = "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"}, + {file = "urllib3-1.26.19-py2.py3-none-any.whl", hash = "sha256:37a0344459b199fce0e80b0d3569837ec6b6937435c5244e7fd73fa6006830f3"}, + {file = "urllib3-1.26.19.tar.gz", hash = "sha256:3e3d753a8618b86d7de333b4223005f68720bcd6a7d2bcb9fbd2229ec7c1e429"}, ] [package.extras] @@ -3491,6 +3553,26 @@ files = [ [package.extras] test = ["coverage", "flake8 (>=3.7)", "mypy", "pretend", "pytest"] +[[package]] +name = "virtualenv" +version = "20.26.2" +description = "Virtual Python Environment builder" +optional = false +python-versions = ">=3.7" +files = [ + {file = "virtualenv-20.26.2-py3-none-any.whl", hash = "sha256:a624db5e94f01ad993d476b9ee5346fdf7b9de43ccaee0e0197012dc838a0e9b"}, + {file = "virtualenv-20.26.2.tar.gz", hash = "sha256:82bf0f4eebbb78d36ddaee0283d43fe5736b53880b8a8cdcd37390a07ac3741c"}, +] + +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<5" + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] + [[package]] name = "watchdog" version = "4.0.1" @@ -3643,18 +3725,18 @@ files = [ [[package]] name = "zipp" -version = "3.19.0" +version = "3.19.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.19.0-py3-none-any.whl", hash = "sha256:96dc6ad62f1441bcaccef23b274ec471518daf4fbbc580341204936a5a3dddec"}, - {file = "zipp-3.19.0.tar.gz", hash = "sha256:952df858fb3164426c976d9338d3961e8e8b3758e2e059e0f754b8c4262625ee"}, + {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, + {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "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)"] +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)"] [extras] all = ["aws-xray-sdk", "fastjsonschema", "pydantic"] @@ -3669,4 +3751,4 @@ validation = ["fastjsonschema"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4.0.0" -content-hash = "05f858ad4f2d4e174f898201a8d51f1f57c6e9d731e69e767755cad886896e5f" +content-hash = "99fcc13e97765ae4b3a997ae7a3b22b7e0bc3e9d9341a96d2a4fa7cb6e27b7d7" diff --git a/pyproject.toml b/pyproject.toml index ef4a4efe767..a080974a559 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,6 +126,7 @@ pytest-socket = ">=0.6,<0.8" types-redis = "^4.6.0.7" testcontainers = { extras = ["redis"], version = "^3.7.1" } multiprocess = "^0.70.16" +nox = "^2024.4.15" [tool.coverage.run] source = ["aws_lambda_powertools"] diff --git a/tests/functional/test_logger.py b/tests/functional/logger/test_logger.py similarity index 94% rename from tests/functional/test_logger.py rename to tests/functional/logger/test_logger.py index 7aa4037cb9c..e86dba27eb6 100644 --- a/tests/functional/test_logger.py +++ b/tests/functional/logger/test_logger.py @@ -8,21 +8,19 @@ import secrets import string import sys -import warnings from collections import namedtuple from datetime import datetime, timezone from typing import Any, Callable, Dict, Iterable, List, Optional, Union import pytest -from aws_lambda_powertools import Logger, Tracer, set_package_logger_handler +from aws_lambda_powertools import Logger from aws_lambda_powertools.logging import correlation_paths from aws_lambda_powertools.logging.exceptions import InvalidLoggerSamplingRateError from aws_lambda_powertools.logging.formatter import ( BasePowertoolsFormatter, LambdaPowertoolsFormatter, ) -from aws_lambda_powertools.logging.logger import set_package_logger from aws_lambda_powertools.shared import constants from aws_lambda_powertools.utilities.data_classes import S3Event, event_source @@ -215,36 +213,6 @@ def handler(event, context): assert second_log["cold_start"] is False -def test_package_logger_stream(stdout): - # GIVEN package logger "aws_lambda_powertools" is explicitly set with no params - set_package_logger(stream=stdout) - - # WHEN Tracer is initialized in disabled mode - Tracer(disabled=True) - - # THEN Tracer debug log statement should be logged - output = stdout.getvalue() - logger = logging.getLogger("aws_lambda_powertools") - assert "Tracing has been disabled" in output - assert logger.level == logging.DEBUG - - -def test_package_logger_format(capsys): - # GIVEN package logger "aws_lambda_powertools" is explicitly - # with a custom formatter - formatter = logging.Formatter("message=%(message)s") - set_package_logger(formatter=formatter) - - # WHEN Tracer is initialized in disabled mode - Tracer(disabled=True) - - # THEN Tracer debug log statement should be logged using `message=` format - output = capsys.readouterr().out - logger = logging.getLogger("aws_lambda_powertools") - assert "message=" in output - assert logger.level == logging.DEBUG - - def test_logger_append_duplicated(stdout, service_name): # GIVEN Logger is initialized with request_id field logger = Logger(service=service_name, stream=stdout, request_id="value") @@ -971,36 +939,6 @@ def handler(event, context, planet, str_end="."): assert log["message"] == "Hello World!" -def test_set_package_logger_handler_with_powertools_debug_env_var(stdout, monkeypatch: pytest.MonkeyPatch): - # GIVEN POWERTOOLS_DEBUG is set - monkeypatch.setenv(constants.POWERTOOLS_DEBUG_ENV, "1") - logger = logging.getLogger("aws_lambda_powertools") - - # WHEN set_package_logger is used at initialization - # and any Powertools for AWS Lambda (Python) operation is used (e.g., Tracer) - set_package_logger_handler(stream=stdout) - Tracer(disabled=True) - - # THEN Tracer debug log statement should be logged - output = stdout.getvalue() - assert "Tracing has been disabled" in output - assert logger.level == logging.DEBUG - - -def test_powertools_debug_env_var_warning(monkeypatch: pytest.MonkeyPatch): - # GIVEN POWERTOOLS_DEBUG is set - monkeypatch.setenv(constants.POWERTOOLS_DEBUG_ENV, "1") - warning_message = "POWERTOOLS_DEBUG environment variable is enabled. Setting logging level to DEBUG." - - # WHEN set_package_logger is used at initialization - # THEN a warning should be emitted - with warnings.catch_warnings(record=True) as w: - warnings.simplefilter("default") - set_package_logger_handler() - assert len(w) == 1 - assert str(w[0].message) == warning_message - - def test_logger_log_uncaught_exceptions(service_name, stdout): # GIVEN an initialized Logger is set with log_uncaught_exceptions logger = Logger(service=service_name, stream=stdout, log_uncaught_exceptions=True) diff --git a/tests/functional/test_logger_powertools_formatter.py b/tests/functional/logger/test_logger_powertools_formatter.py similarity index 100% rename from tests/functional/test_logger_powertools_formatter.py rename to tests/functional/logger/test_logger_powertools_formatter.py diff --git a/tests/functional/test_logger_utils.py b/tests/functional/logger/test_logger_utils.py similarity index 100% rename from tests/functional/test_logger_utils.py rename to tests/functional/logger/test_logger_utils.py diff --git a/tests/functional/logger/test_logger_with_package_logger.py b/tests/functional/logger/test_logger_with_package_logger.py new file mode 100644 index 00000000000..2dfd6016333 --- /dev/null +++ b/tests/functional/logger/test_logger_with_package_logger.py @@ -0,0 +1,113 @@ +import io +import json +import logging +import random +import string +import warnings +from collections import namedtuple + +import pytest + +from aws_lambda_powertools import Metrics, set_package_logger_handler +from aws_lambda_powertools.logging.logger import set_package_logger +from aws_lambda_powertools.shared import constants + + +@pytest.fixture +def stdout(): + return io.StringIO() + + +@pytest.fixture +def lambda_context(): + lambda_context = { + "function_name": "test", + "memory_limit_in_mb": 128, + "invoked_function_arn": "arn:aws:lambda:eu-west-1:809313241:function:test", + "aws_request_id": "52fdfc07-2182-154f-163f-5f0f9a621d72", + } + + return namedtuple("LambdaContext", lambda_context.keys())(*lambda_context.values()) + + +@pytest.fixture +def lambda_event(): + return {"greeting": "hello"} + + +@pytest.fixture +def service_name(): + chars = string.ascii_letters + string.digits + return "".join(random.SystemRandom().choice(chars) for _ in range(15)) + + +def capture_logging_output(stdout): + return json.loads(stdout.getvalue().strip()) + + +def capture_multiple_logging_statements_output(stdout): + return [json.loads(line.strip()) for line in stdout.getvalue().split("\n") if line] + + +def test_package_logger_stream(stdout): + # GIVEN package logger "aws_lambda_powertools" is explicitly set with no params + set_package_logger(stream=stdout) + + # WHEN we add a dimension in Metrics feature + my_metrics = Metrics(namespace="powertools") + my_metrics.add_dimension(name="dimension", value="test") + + # THEN Metrics debug log statement should be logged + output = stdout.getvalue() + logger = logging.getLogger("aws_lambda_powertools") + assert "Adding dimension:" in output + assert logger.level == logging.DEBUG + + +def test_package_logger_format(capsys): + # GIVEN package logger "aws_lambda_powertools" is explicitly + # with a custom formatter + formatter = logging.Formatter("message=%(message)s") + set_package_logger(formatter=formatter) + + # WHEN we add a dimension in Metrics feature + my_metrics = Metrics(namespace="powertools") + my_metrics.add_dimension(name="dimension", value="test") + + # THEN Metrics debug log statement should be logged using `message=` format + output = capsys.readouterr().out + logger = logging.getLogger("aws_lambda_powertools") + assert "message=" in output + assert logger.level == logging.DEBUG + + +def test_set_package_logger_handler_with_powertools_debug_env_var(stdout, monkeypatch: pytest.MonkeyPatch): + # GIVEN POWERTOOLS_DEBUG is set + monkeypatch.setenv(constants.POWERTOOLS_DEBUG_ENV, "1") + logger = logging.getLogger("aws_lambda_powertools") + + # WHEN set_package_logger is used at initialization + # and any Powertools for AWS Lambda (Python) operation is used (e.g., Metrics add_dimension) + set_package_logger_handler(stream=stdout) + + my_metrics = Metrics(namespace="powertools") + my_metrics.add_dimension(name="dimension", value="test") + + # THEN Metrics debug log statement should be logged + output = stdout.getvalue() + assert "Adding dimension:" in output + assert logger.level == logging.DEBUG + + +def test_powertools_debug_env_var_warning(monkeypatch: pytest.MonkeyPatch): + # GIVEN POWERTOOLS_DEBUG is set + monkeypatch.setenv(constants.POWERTOOLS_DEBUG_ENV, "1") + warning_message = "POWERTOOLS_DEBUG environment variable is enabled. Setting logging level to DEBUG." + + # WHEN set_package_logger is used at initialization + # THEN a warning should be emitted + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("default") + set_package_logger_handler() + assert len(w) == 1 + assert str(w[0].message) == warning_message