diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..be92627 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @notdodo \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c5d1a61 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,40 @@ +version: 2 +updates: + - package-ecosystem: docker + directory: / + schedule: + interval: monthly + time: "12:00" + day: wednesday + groups: + erfiume-docker: + patterns: + - "*" + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + time: "12:00" + day: wednesday + - package-ecosystem: pip + directory: /pulumi + schedule: + interval: monthly + time: "12:00" + day: wednesday + groups: + pulumi: + dependency-type: "production" + pulumi-dev: + dependency-type: "development" + - package-ecosystem: pip + directory: /app + schedule: + interval: monthly + time: "12:00" + day: wednesday + groups: + app: + dependency-type: "production" + app-dev: + dependency-type: "development" diff --git a/.github/python-ci.yml b/.github/python-ci.yml new file mode 100644 index 0000000..c103d87 --- /dev/null +++ b/.github/python-ci.yml @@ -0,0 +1,22 @@ +name: Python CI +on: + push: + +concurrency: + group: ghas-erfiume-ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + python-ci-app: + uses: notdodo/github-actions/.github/workflows/python-ci.yml@python-ci-v0.0.2 + with: + poetry-version: latest + python-version: 3.12 + working-directory: "./app" + + python-ci-pulumi: + uses: notdodo/github-actions/.github/workflows/python-ci.yml@python-ci-v0.0.2 + with: + poetry-version: latest + python-version: 3.12 + working-directory: "./pulumi" diff --git a/app/erfiume/logging.py b/app/erfiume/logging.py index 2b074cb..aa9c48e 100644 --- a/app/erfiume/logging.py +++ b/app/erfiume/logging.py @@ -2,7 +2,6 @@ Module to start and configure logging. """ -import logging +from aws_lambda_powertools import Logger -logger = logging.getLogger(__name__) -logging.basicConfig(level=logging.INFO) +logger = Logger(service="erfiume", level="INFO", child=True) diff --git a/app/erfiume/tgbot.py b/app/erfiume/tgbot.py index 8d9fdd3..1d2a6db 100644 --- a/app/erfiume/tgbot.py +++ b/app/erfiume/tgbot.py @@ -36,7 +36,9 @@ async def fetch_bot_token() -> str: return boto3.client( service_name="secretsmanager", endpoint_url=("http://localhost:4566" if environment != "production" else None), - ).get_secret_value(SecretId="telegram-bot-token",)["SecretString"] + ).get_secret_value( + SecretId="telegram-bot-token", + )["SecretString"] async def start(update: Update, _: ContextTypes.DEFAULT_TYPE) -> None: diff --git a/app/poetry.lock b/app/poetry.lock index ad00b12..bb3158d 100644 --- a/app/poetry.lock +++ b/app/poetry.lock @@ -741,13 +741,13 @@ crt = ["awscrt (==0.20.11)"] [[package]] name = "botocore-stubs" -version = "1.35.22" +version = "1.35.24" description = "Type annotations and code completion for botocore" optional = false python-versions = ">=3.8" files = [ - {file = "botocore_stubs-1.35.22-py3-none-any.whl", hash = "sha256:dae8cc433df3044ece464f4985e67a154bab51fd042757d0c59e4a9ea26d0376"}, - {file = "botocore_stubs-1.35.22.tar.gz", hash = "sha256:14dec6b00d974dce4747d6917a791bcea0d8efd1c8959821d8ce6ca69ce40d70"}, + {file = "botocore_stubs-1.35.24-py3-none-any.whl", hash = "sha256:052eead5808ef138988089b6de6786f6271fc7f395ee0d4395e96e06ab04573c"}, + {file = "botocore_stubs-1.35.24.tar.gz", hash = "sha256:20ca0d0c77215b599ab79e365f2bf5f909a49f4c5440bbbbb08175971a3de442"}, ] [package.dependencies] @@ -1686,13 +1686,13 @@ reports = ["lxml"] [[package]] name = "mypy-boto3-dynamodb" -version = "1.35.15" -description = "Type annotations for boto3.DynamoDB 1.35.15 service generated with mypy-boto3-builder 8.0.1" +version = "1.35.24" +description = "Type annotations for boto3.DynamoDB 1.35.24 service generated with mypy-boto3-builder 8.1.1" optional = false python-versions = ">=3.8" files = [ - {file = "mypy_boto3_dynamodb-1.35.15-py3-none-any.whl", hash = "sha256:ac7daacc874e00a5ece33d582916c180a5fac5b293abcc5def5336749769e9cf"}, - {file = "mypy_boto3_dynamodb-1.35.15.tar.gz", hash = "sha256:7a913873e54289c5d392e18626ef379711530d406eda7766cb7e8d0114c2cbc1"}, + {file = "mypy_boto3_dynamodb-1.35.24-py3-none-any.whl", hash = "sha256:022859543c5314f14fb03ef4e445e34b97b9bc0cecb003c14c10943a2eaa3ff7"}, + {file = "mypy_boto3_dynamodb-1.35.24.tar.gz", hash = "sha256:55bf897a1d0e354579edb05001f4bc4f472b9452badd9db24876c31bdf3f72a1"}, ] [[package]] @@ -2049,13 +2049,13 @@ cli = ["click (>=5.0)"] [[package]] name = "python-telegram-bot" -version = "21.5" +version = "21.6" description = "We have made you a wrapper you can't refuse" optional = false python-versions = ">=3.8" files = [ - {file = "python_telegram_bot-21.5-py3-none-any.whl", hash = "sha256:1bbba653477ba164411622b717a0cfe1eb7843da016348e41df97f96c93f578e"}, - {file = "python_telegram_bot-21.5.tar.gz", hash = "sha256:2d679173072cce8d6b49aac2e438d49dbfc01c1a4ef5658828c2a65951ee830b"}, + {file = "python_telegram_bot-21.6-py3-none-any.whl", hash = "sha256:f2d6431bf154a53f40cdfc6c1d492a66102c0e4938709f6d8202bcd951c840cb"}, + {file = "python_telegram_bot-21.6.tar.gz", hash = "sha256:8b2b37836c3ff9c2924e990474a1c4731df21b1668acebff5099f475666426c6"}, ] [package.dependencies] @@ -2240,29 +2240,29 @@ requests = ">=2.0.1,<3.0.0" [[package]] name = "ruff" -version = "0.6.5" +version = "0.6.6" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.6.5-py3-none-linux_armv6l.whl", hash = "sha256:7e4e308f16e07c95fc7753fc1aaac690a323b2bb9f4ec5e844a97bb7fbebd748"}, - {file = "ruff-0.6.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:932cd69eefe4daf8c7d92bd6689f7e8182571cb934ea720af218929da7bd7d69"}, - {file = "ruff-0.6.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3a8d42d11fff8d3143ff4da41742a98f8f233bf8890e9fe23077826818f8d680"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a50af6e828ee692fb10ff2dfe53f05caecf077f4210fae9677e06a808275754f"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:794ada3400a0d0b89e3015f1a7e01f4c97320ac665b7bc3ade24b50b54cb2972"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:381413ec47f71ce1d1c614f7779d88886f406f1fd53d289c77e4e533dc6ea200"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:52e75a82bbc9b42e63c08d22ad0ac525117e72aee9729a069d7c4f235fc4d276"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09c72a833fd3551135ceddcba5ebdb68ff89225d30758027280968c9acdc7810"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:800c50371bdcb99b3c1551d5691e14d16d6f07063a518770254227f7f6e8c178"}, - {file = "ruff-0.6.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e25ddd9cd63ba1f3bd51c1f09903904a6adf8429df34f17d728a8fa11174253"}, - {file = "ruff-0.6.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7291e64d7129f24d1b0c947ec3ec4c0076e958d1475c61202497c6aced35dd19"}, - {file = "ruff-0.6.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9ad7dfbd138d09d9a7e6931e6a7e797651ce29becd688be8a0d4d5f8177b4b0c"}, - {file = "ruff-0.6.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:005256d977021790cc52aa23d78f06bb5090dc0bfbd42de46d49c201533982ae"}, - {file = "ruff-0.6.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:482c1e6bfeb615eafc5899127b805d28e387bd87db38b2c0c41d271f5e58d8cc"}, - {file = "ruff-0.6.5-py3-none-win32.whl", hash = "sha256:cf4d3fa53644137f6a4a27a2b397381d16454a1566ae5335855c187fbf67e4f5"}, - {file = "ruff-0.6.5-py3-none-win_amd64.whl", hash = "sha256:3e42a57b58e3612051a636bc1ac4e6b838679530235520e8f095f7c44f706ff9"}, - {file = "ruff-0.6.5-py3-none-win_arm64.whl", hash = "sha256:51935067740773afdf97493ba9b8231279e9beef0f2a8079188c4776c25688e0"}, - {file = "ruff-0.6.5.tar.gz", hash = "sha256:4d32d87fab433c0cf285c3683dd4dae63be05fd7a1d65b3f5bf7cdd05a6b96fb"}, + {file = "ruff-0.6.6-py3-none-linux_armv6l.whl", hash = "sha256:f5bc5398457484fc0374425b43b030e4668ed4d2da8ee7fdda0e926c9f11ccfb"}, + {file = "ruff-0.6.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:515a698254c9c47bb84335281a170213b3ee5eb47feebe903e1be10087a167ce"}, + {file = "ruff-0.6.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:6bb1b4995775f1837ab70f26698dd73852bbb82e8f70b175d2713c0354fe9182"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69c546f412dfae8bb9cc4f27f0e45cdd554e42fecbb34f03312b93368e1cd0a6"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:59627e97364329e4eae7d86fa7980c10e2b129e2293d25c478ebcb861b3e3fd6"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:94c3f78c3d32190aafbb6bc5410c96cfed0a88aadb49c3f852bbc2aa9783a7d8"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:704da526c1e137f38c8a067a4a975fe6834b9f8ba7dbc5fd7503d58148851b8f"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:efeede5815a24104579a0f6320660536c5ffc1c91ae94f8c65659af915fb9de9"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e368aef0cc02ca3593eae2fb8186b81c9c2b3f39acaaa1108eb6b4d04617e61f"}, + {file = "ruff-0.6.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2653fc3b2a9315bd809725c88dd2446550099728d077a04191febb5ea79a4f79"}, + {file = "ruff-0.6.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:bb858cd9ce2d062503337c5b9784d7b583bcf9d1a43c4df6ccb5eab774fbafcb"}, + {file = "ruff-0.6.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:488f8e15c01ea9afb8c0ba35d55bd951f484d0c1b7c5fd746ce3c47ccdedce68"}, + {file = "ruff-0.6.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:aefb0bd15f1cfa4c9c227b6120573bb3d6c4ee3b29fb54a5ad58f03859bc43c6"}, + {file = "ruff-0.6.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a4c0698cc780bcb2c61496cbd56b6a3ac0ad858c966652f7dbf4ceb029252fbe"}, + {file = "ruff-0.6.6-py3-none-win32.whl", hash = "sha256:aadf81ddc8ab5b62da7aae78a91ec933cbae9f8f1663ec0325dae2c364e4ad84"}, + {file = "ruff-0.6.6-py3-none-win_amd64.whl", hash = "sha256:0adb801771bc1f1b8cf4e0a6fdc30776e7c1894810ff3b344e50da82ef50eeb1"}, + {file = "ruff-0.6.6-py3-none-win_arm64.whl", hash = "sha256:4b4d32c137bc781c298964dd4e52f07d6f7d57c03eae97a72d97856844aa510a"}, + {file = "ruff-0.6.6.tar.gz", hash = "sha256:0fc030b6fd14814d69ac0196396f6761921bd20831725c7361e1b8100b818034"}, ] [[package]] @@ -3517,4 +3517,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "45969d10cf6572fb58441a16dbd237c3134ec9fd027f4f35494b61bd25bdb572" +content-hash = "621193469fdf51d3e3bfb7268f2637818d287d37dd55cb5abbbae4d182d9f914" diff --git a/app/pyproject.toml b/app/pyproject.toml index 854ade7..09b26c3 100644 --- a/app/pyproject.toml +++ b/app/pyproject.toml @@ -7,14 +7,14 @@ readme = "README.md" package-mode = false [tool.poetry.dependencies] -python = "^3.12" +aws-lambda-powertools = "^2.43.1" httpx = "^0.27.2" aioboto3 = "^13.1.1" -python-telegram-bot = "^21.5" poetry-dotenv-plugin = "^0.2.0" +python = "^3.12" +python-telegram-bot = "^21.5" [tool.poetry.group.dev.dependencies] -aws-lambda-powertools = "^2.43.1" awscli-local = "^0.22.0" boto3-stubs = { version = "1.35.5", extras = ["dynamodb", "secretsmanager"] } mypy = "^1.10.1"