Skip to content

Commit 971c7df

Browse files
ran-isenbergRan Isenberg
and
Ran Isenberg
authored
chore: poetry update and minor fixes (#788)
--------- Co-authored-by: Ran Isenberg <[email protected]>
1 parent f2fa878 commit 971c7df

File tree

8 files changed

+491
-496
lines changed

8 files changed

+491
-496
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
exclude: "^(?!helpers/)"
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
2828
# Ruff version.
29-
rev: v0.1.8
29+
rev: v0.1.13
3030
hooks:
3131
# Run the Ruff linter.
3232
- id: ruff

cdk/service/configuration/configuration_construct.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22

33
import aws_cdk.aws_appconfig_alpha as appconfig
4-
from aws_cdk import Duration, RemovalPolicy
4+
from aws_cdk import Duration
55
from constructs import Construct
66

77
from cdk.service.configuration.schema import FeatureFlagsConfiguration
@@ -32,17 +32,13 @@ def __init__(self, scope: Construct, id_: str, environment: str, service_name: s
3232
name=self.app_name,
3333
)
3434

35-
self.config_app.apply_removal_policy(RemovalPolicy.DESTROY)
36-
3735
self.config_env = appconfig.Environment(
3836
self,
3937
id=f'{id_}env',
4038
application=self.config_app,
4139
name=environment,
4240
)
4341

44-
self.config_env.apply_removal_policy(RemovalPolicy.DESTROY)
45-
4642
# zero minutes, zero bake, 100 growth all at once
4743
self.config_dep_strategy = appconfig.DeploymentStrategy(
4844
self,
@@ -54,8 +50,6 @@ def __init__(self, scope: Construct, id_: str, environment: str, service_name: s
5450
),
5551
)
5652

57-
self.config_dep_strategy.apply_removal_policy(RemovalPolicy.DESTROY)
58-
5953
self.config = appconfig.HostedConfiguration(
6054
self,
6155
f'{id_}version',
@@ -67,9 +61,6 @@ def __init__(self, scope: Construct, id_: str, environment: str, service_name: s
6761
deploy_to=[self.config_env],
6862
)
6963

70-
# workaround until https://github.com/aws/aws-cdk/issues/26804 is resolved
71-
self.config.node.default_child.apply_removal_policy(RemovalPolicy.DESTROY) # type: ignore
72-
7364
def _get_and_validate_configuration(self, environment: str) -> str:
7465
current = Path(__file__).parent
7566
conf_filepath = current / (f'json/{environment}_configuration.json')

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"dependencies": {
3-
"aws-cdk": "2.115.0"
3+
"aws-cdk": "2.121.1"
44
}
55
}

poetry.lock

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

service/dal/dynamo_dal_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import uuid
2-
from datetime import datetime
2+
from datetime import datetime, timezone
33

44
import boto3
55
from botocore.exceptions import ClientError
@@ -27,7 +27,7 @@ def _get_db_handler(self, table_name: str) -> Table:
2727
return dynamodb.Table(table_name)
2828

2929
def _get_unix_time(self) -> int:
30-
return int(datetime.utcnow().timestamp())
30+
return int(datetime.now(timezone.utc).timestamp())
3131

3232
@tracer.capture_method(capture_response=False)
3333
def create_order_in_db(self, customer_name: str, order_item_count: int) -> Order:

tests/integration/test_create_order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from datetime import datetime
2+
from datetime import datetime, timezone
33
from http import HTTPStatus
44
from typing import Any
55

@@ -70,7 +70,7 @@ def test_handler_200_ok(mocker, table_name: str):
7070
assert 'Item' in response
7171
assert response['Item']['name'] == customer_name
7272
assert response['Item']['item_count'] == order_item_count
73-
now = int(datetime.utcnow().timestamp())
73+
now = int(datetime.now(timezone.utc).timestamp())
7474
assert now - int(response['Item']['created_at']) <= 60 # assume item was created in last minute, check that utc time calc is correct
7575

7676

tests/unit/test_create_order_input.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
from service.models.input import CreateOrderRequest
55

6-
# ... potentially more imports based on your project ...
7-
86

97
def test_invalid_name():
108
# Given: An empty customer_name

0 commit comments

Comments
 (0)