Skip to content

Commit 53bd4e6

Browse files
dependabot[bot]jfussaaythapa
authored
chore(deps-dev): bump black from 23.10.1 to 24.3.0 in /requirements (#3569)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Aayush thapa <[email protected]>
1 parent b9427af commit 53bd4e6

20 files changed

+39
-25
lines changed

bin/_file_formatter.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Formatter base class for JSONFormatter and YamlFormatter."""
2+
23
import argparse
34
import os
45
import sys

bin/public_interface.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ def _print(signature: Dict[str, inspect.Signature], variables: Set[str]) -> None
101101
result: Dict[str, Any] = {"routines": {}, "variables": sorted(variables)}
102102
for key, value in signature.items():
103103
result["routines"][key] = [
104-
{
105-
"name": parameter.name,
106-
"kind": parameter.kind.name,
107-
"default": parameter.default,
108-
}
109-
if parameter.default != inspect.Parameter.empty
110-
else {"name": parameter.name, "kind": parameter.kind.name}
104+
(
105+
{
106+
"name": parameter.name,
107+
"kind": parameter.kind.name,
108+
"default": parameter.default,
109+
}
110+
if parameter.default != inspect.Parameter.empty
111+
else {"name": parameter.name, "kind": parameter.kind.name}
112+
)
111113
for parameter in value.parameters.values()
112114
]
113115
print(json.dumps(result, indent=2, sort_keys=True))

integration/helpers/deployer/deployer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ def describe_changeset(self, change_set_id, stack_name, **kwargs):
208208
{
209209
"LogicalResourceId": resource_props.get("LogicalResourceId"),
210210
"ResourceType": resource_props.get("ResourceType"),
211-
"Replacement": "N/A"
212-
if resource_props.get("Replacement") is None
213-
else resource_props.get("Replacement"),
211+
"Replacement": (
212+
"N/A" if resource_props.get("Replacement") is None else resource_props.get("Replacement")
213+
),
214214
}
215215
)
216216

integration/helpers/deployer/utils/colors.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Wrapper to generated colored messages for printing in Terminal
33
This was ported over from the sam-cli repo
44
"""
5+
56
from typing import Dict, Literal
67

78
SupportedColor = Literal["red", "green", "yellow"]

integration/helpers/deployer/utils/retry.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Retry decorator to retry decorated function based on Exception with exponential backoff and number of attempts built-in.
33
"""
4+
45
import math
56
import random
67
import time

integration/helpers/deployer/utils/table_print.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Utilities for table pretty printing
33
This was ported over from the sam-cli repo
44
"""
5+
56
import shutil
67
import textwrap
78
from functools import wraps

integration/helpers/s3_uploader.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Client for uploading files to s3
33
"""
4+
45
import logging
56
from typing import Any
67

requirements/dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tenacity~=8.0
1919
requests~=2.28
2020

2121
# formatter
22-
black==23.10.1
22+
black==24.3.0
2323
ruamel.yaml==0.17.21 # It can parse yaml while perserving comments
2424

2525
# type check

samtranslator/internal/deprecation_control.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
If external packages import deprecated interfaces,
1010
it is their responsibility to detect and remove them.
1111
"""
12+
1213
import warnings
1314
from functools import wraps
1415
from typing import Callable, Optional, TypeVar

samtranslator/metrics/method_decorator.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Method decorator for execution latency collection
33
"""
4+
45
import functools
56
import logging
67
from datetime import datetime
@@ -84,13 +85,13 @@ def _send_cw_metric(prefix, name, execution_time_ms, func, args): # type: ignor
8485
@overload
8586
def cw_timer(
8687
*, name: Optional[str] = None, prefix: Optional[str] = None
87-
) -> Callable[[Callable[_PT, _RT]], Callable[_PT, _RT]]:
88-
...
88+
) -> Callable[[Callable[_PT, _RT]], Callable[_PT, _RT]]: ...
8989

9090

9191
@overload
92-
def cw_timer(_func: Callable[_PT, _RT], name: Optional[str] = None, prefix: Optional[str] = None) -> Callable[_PT, _RT]:
93-
...
92+
def cw_timer(
93+
_func: Callable[_PT, _RT], name: Optional[str] = None, prefix: Optional[str] = None
94+
) -> Callable[_PT, _RT]: ...
9495

9596

9697
def cw_timer(

samtranslator/model/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" CloudFormation Resource serialization, deserialization, and validation """
2+
23
import inspect
34
import re
45
from abc import ABC, ABCMeta, abstractmethod

samtranslator/model/api/http_api_generator.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -777,9 +777,7 @@ def _add_title(self) -> None:
777777
self.definition_body = open_api_editor.openapi
778778

779779
@cw_timer(prefix="Generator", name="HttpApi")
780-
def to_cloudformation(
781-
self, route53_record_set_groups: Dict[str, Route53RecordSetGroup]
782-
) -> Tuple[
780+
def to_cloudformation(self, route53_record_set_groups: Dict[str, Route53RecordSetGroup]) -> Tuple[
783781
ApiGatewayV2HttpApi,
784782
Optional[ApiGatewayV2Stage],
785783
Optional[ApiGatewayV2DomainName],

samtranslator/model/architecture.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
Enum for determining type of architectures for Lambda Function.
33
"""
4+
45
ARM64 = "arm64"
56
X86_64 = "x86_64"

samtranslator/model/sam_resources.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" SAM macro definitions """
2+
23
import copy
34
from contextlib import suppress
45
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union, cast

samtranslator/model/types.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
the Permissions property is an ARN or list of ARNs. In this situation, we validate that the Permissions property is
99
either a string or a list of strings, but do not validate whether the string(s) are valid IAM policy ARNs.
1010
"""
11+
1112
from typing import Any, Callable, Type, Union
1213

1314
import samtranslator.model.exceptions

samtranslator/open_api/base_editor.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Base class for OpenApiEditor and SwaggerEditor."""
2+
23
import re
34
from typing import Any, Dict, Iterator, List, Optional, Union
45

samtranslator/utils/types.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Type related utils."""
2+
23
from typing import Any, Dict, TypeVar, Union
34

45
T = TypeVar("T")

samtranslator/validator/value_validator.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A plug-able validator to help raise exception when some value is unexpected."""
2+
23
from typing import Any, Dict, Generic, Optional, TypeVar, cast
34

45
from samtranslator.model.exceptions import (

tests/openapi/test_openapi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class TestOpenApiEditor_is_valid(TestCase):
342342
[
343343
param(OpenApiEditor.gen_skeleton()),
344344
# Dict can contain any other unrecognized properties
345-
param({"openapi": "3.1.1", "paths": {}, "foo": "bar", "baz": "bar"})
345+
param({"openapi": "3.1.1", "paths": {}, "foo": "bar", "baz": "bar"}),
346346
# TODO check and update the regex accordingly
347347
# Fails for this: param({"openapi": "3.1.10", "paths": {}, "foo": "bar", "baz": "bar"})
348348
]

tests/translator/test_translator.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ def _compare_transform(self, manifest, expected, partition, region):
165165
"AWSLambdaRole": f"arn:{partition}:iam::aws:policy/service-role/AWSLambdaRole",
166166
}
167167
if partition == "aws":
168-
mock_policy_loader.load.return_value[
169-
"AWSXrayWriteOnlyAccess"
170-
] = "arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess"
168+
mock_policy_loader.load.return_value["AWSXrayWriteOnlyAccess"] = (
169+
"arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess"
170+
)
171171
else:
172-
mock_policy_loader.load.return_value[
173-
"AWSXRayDaemonWriteAccess"
174-
] = f"arn:{partition}:iam::aws:policy/AWSXRayDaemonWriteAccess"
172+
mock_policy_loader.load.return_value["AWSXRayDaemonWriteAccess"] = (
173+
f"arn:{partition}:iam::aws:policy/AWSXRayDaemonWriteAccess"
174+
)
175175

176176
output_fragment = transform(manifest, parameter_values, mock_policy_loader)
177177

0 commit comments

Comments
 (0)