Skip to content

Commit 3379647

Browse files
authored
Merge pull request #35 from sliedig/py11
feat: updated runtime to python 3.11
2 parents 7cdfcf9 + 46636fe commit 3379647

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1363
-1017
lines changed

.github/workflows/reusable_unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616

1717
- uses: actions/setup-python@v4
18-
with: { python-version: 3.10.11 }
18+
with: { python-version: 3.11.4 }
1919

2020
- uses: snok/install-poetry@v1
2121
with:

unicorn_contracts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ stackName := uni-prop-local-contract
33
build:
44
cfn-lint template.yaml -a cfn_lint_serverless.rules
55
poetry export --without-hashes --format=requirements.txt --output=src/requirements.txt
6-
sam build -c
6+
sam build -c $(DOCKER_OPTS)
77

88
deps:
99
poetry install

unicorn_contracts/poetry.lock

Lines changed: 275 additions & 301 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unicorn_contracts/pyproject.toml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@ name = "contracts_service"
33
version = "0.2.0"
44
description = "Unicorn Properties Contact Service"
55
authors = ["Amazon Web Services"]
6-
exclude = ["src/events/"]
7-
packages = [{ include = "contracts_service", from = "src" }]
6+
packages = [
7+
{ include = "contracts_service", from = "src" },
8+
]
89

910
[tool.poetry.dependencies]
10-
python = "^3.10"
11-
boto3 = "^1.26.153"
12-
aws-lambda-powertools = {extras = ["tracer"], version = "^2.16.2"}
11+
python = "^3.11"
12+
boto3 = "^1.28.15"
13+
aws-lambda-powertools = {extras = ["tracer"], version = "^2.22.0"}
1314
aws-xray-sdk = "^2.12.0"
1415

1516
[tool.poetry.group.dev.dependencies]
16-
pytest = "^7.1.2"
17-
pytest-mock = "^3.7.0"
18-
pytest-cov = "^3.0.0"
19-
coverage = "^6.4.2"
17+
pytest = "^7.4.0"
18+
pytest-mock = "^3.11.1"
19+
pytest-cov = "^4.1.0"
20+
coverage = "^7.2.7"
2021
requests = "^2.31.0"
21-
moto = "^3.1.17"
22-
importlib-metadata = "^4.12.0"
22+
moto = "^4.1.13"
23+
importlib-metadata = "^6.8.0"
2324

2425
[build-system]
2526
requires = ["poetry-core>=1.0.0"]
@@ -32,3 +33,6 @@ testpaths = [
3233
"./tests/unit",
3334
"./tests/integration",
3435
]
36+
37+
[tool.ruff]
38+
line-length = 150

unicorn_contracts/src/contracts_service/contract_status.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: MIT-0
3+
34
from enum import Enum
45

56
class ContractStatus(Enum):

unicorn_contracts/src/contracts_service/create_contract_function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: MIT-0
3+
34
import json
45
import os
56
import uuid

unicorn_contracts/src/contracts_service/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: MIT-0
3+
34
import json
45

56
class ContractNotFoundException(Exception):

unicorn_contracts/src/contracts_service/helper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: MIT-0
3+
34
import os
45
import json
56
from datetime import datetime
@@ -8,7 +9,7 @@
89
from aws_lambda_powertools.tracing import Tracer
910
from aws_lambda_powertools.logging import Logger
1011

11-
from contracts_service.exceptions import EventValidationException, EventValidationException
12+
from contracts_service.exceptions import EventValidationException
1213

1314
# Initialise Environment variables
1415
if (SERVICE_NAMESPACE := os.environ.get("SERVICE_NAMESPACE")) is None:
@@ -76,16 +77,16 @@ def get_event_body(event):
7677
try:
7778
event_json = json.loads(event_body)
7879
except json.decoder.JSONDecodeError as e:
79-
logger.fatal("This event input is not a valid JSON")
80+
logger.critical("This event input is not a valid JSON")
8081
raise e
8182
except TypeError as e:
82-
logger.fatal("This event input is not a valid JSON")
83+
logger.critical("This event input is not a valid JSON")
8384
raise e
8485

8586
# Check if event body contains data, otherwise log & raise exception
8687
if not event_json:
8788
msg = "This event input did not contain body payload."
88-
logger.fatal(msg)
89+
logger.critical(msg)
8990
raise EventValidationException(msg)
9091

9192
return event_json

unicorn_contracts/src/contracts_service/update_contract_function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: MIT-0
3+
34
import json
45
import os
56

unicorn_contracts/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Globals:
5454
Api:
5555
OpenApiVersion: 3.0.1
5656
Function:
57-
Runtime: python3.10
57+
Runtime: python3.11
5858
MemorySize: 128
5959
Timeout: 3
6060
Tracing: Active

0 commit comments

Comments
 (0)