Skip to content

Commit 1e29fc8

Browse files
authored
Release 1.63.0 (to main) #3067
Release 1.63.0 (to main)
2 parents 1e5b158 + efdc6cb commit 1e29fc8

File tree

160 files changed

+9363
-1144
lines changed

Some content is hidden

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

160 files changed

+9363
-1144
lines changed

.cfnlintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ ignore_checks:
125125
- E2531 # Deprecated runtime; not relevant for transform tests
126126
- W2531 # EOL runtime; not relevant for transform tests
127127
- E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources
128+
- W2001 # Parameter not used

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- "feat-*"
88
pull_request:
99
workflow_dispatch:
10+
merge_group:
11+
types: [checks_requested]
1012

1113
jobs:
1214
build:
@@ -22,6 +24,7 @@ jobs:
2224
- "3.8"
2325
- "3.9"
2426
- "3.10"
27+
- "3.11"
2528
steps:
2629
- uses: actions/checkout@v3
2730
- uses: actions/setup-python@v4

.github/workflows/check_compatibility.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Check compatibility
22

33
on:
44
pull_request:
5+
merge_group:
6+
types: [checks_requested]
57

68
jobs:
79
check-compatibility:

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ "develop" ]
20+
merge_group:
21+
types: [checks_requested]
2022
schedule:
2123
- cron: '43 23 * * 2'
2224

bin/_file_formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def config_additional_args(cls) -> None: # noqa: empty-method-without-abstract-
4545
"""Optionally configure additional args to arg parser."""
4646

4747
def process_file(self, file_path: str) -> None:
48-
with open(file_path, "r", encoding="utf-8") as f:
48+
with open(file_path, encoding="utf-8") as f:
4949
file_str = f.read()
5050
try:
5151
formatted_file_str = self.format_str(file_str)

bin/add_transform_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import shutil
77
import subprocess
88
import sys
9+
from copy import deepcopy
910
from pathlib import Path
1011
from typing import Any, Dict
1112

@@ -74,7 +75,7 @@ def replace_aws_partition(partition: str, file_path: str) -> None:
7475
def generate_transform_test_output_files(input_file_path: str, file_basename: str) -> None:
7576
output_file_option = file_basename + ".json"
7677

77-
with open(os.path.join(input_file_path), "r") as f:
78+
with open(os.path.join(input_file_path)) as f:
7879
manifest = yaml_parse(f) # type: ignore[no-untyped-call]
7980

8081
transform_test_output_paths = {
@@ -86,7 +87,8 @@ def generate_transform_test_output_files(input_file_path: str, file_basename: st
8687
for partition, (region, output_path) in transform_test_output_paths.items():
8788
# Set Boto Session Region to guarantee the same hash input as transform tests for API deployment id
8889
ArnGenerator.BOTO_SESSION_REGION_NAME = region
89-
output_fragment = transform(manifest, {}, ManagedPolicyLoader(iam_client))
90+
# Implicit API Plugin may alter input template file, thus passing a copy here.
91+
output_fragment = transform(deepcopy(manifest), {}, ManagedPolicyLoader(iam_client))
9092

9193
if not CLI_OPTIONS.disable_api_configuration and partition != "aws":
9294
output_fragment = add_regional_endpoint_configuration_if_needed(output_fragment)

bin/public_interface.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@
1515
import pkgutil
1616
import sys
1717
from pathlib import Path
18-
from typing import Any, Dict, List, NamedTuple, Set, Union
18+
from typing import Any, Dict, List, NamedTuple, Optional, Set, Union
1919

2020
_ARGUMENT_SELF = {"kind": "POSITIONAL_OR_KEYWORD", "name": "self"}
2121

2222

2323
class InterfaceScanner:
24-
def __init__(self) -> None:
24+
def __init__(self, skipped_modules: Optional[List[str]] = None) -> None:
2525
self.signatures: Dict[str, Union[inspect.Signature]] = {}
2626
self.variables: Set[str] = set()
27+
self.skipped_modules: Set[str] = set(skipped_modules or [])
2728

2829
def scan_interfaces_recursively(self, module_name: str) -> None:
30+
if module_name in self.skipped_modules:
31+
return
2932
self._scan_interfaces_in_module(module_name)
3033
for submodule in pkgutil.iter_modules([module_name.replace(".", os.path.sep)]):
3134
submodule_name = module_name + "." + submodule.name
@@ -212,13 +215,20 @@ def main() -> None:
212215
subparsers = parser.add_subparsers(dest="command")
213216
extract = subparsers.add_parser("extract", help="Extract public interfaces")
214217
extract.add_argument("--module", help="The module to extract public interfaces", type=str, default="samtranslator")
218+
extract.add_argument(
219+
"--skipped-module",
220+
help="The modules that should be skipped",
221+
type=str,
222+
nargs="*",
223+
default=["samtranslator.internal"],
224+
)
215225
check = subparsers.add_parser("check", help="Check public interface changes")
216226
check.add_argument("original_json", help="The original public interface JSON file", type=Path)
217227
check.add_argument("new_json", help="The new public interface JSON file", type=Path)
218228
args = parser.parse_args()
219229

220230
if args.command == "extract":
221-
scanner = InterfaceScanner()
231+
scanner = InterfaceScanner(skipped_modules=args.skipped_module)
222232
scanner.scan_interfaces_recursively(args.module)
223233
_print(scanner.signatures, scanner.variables)
224234
elif args.command == "check":

bin/sam-translate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"--output-template",
4141
help="Location to store resulting CloudFormation template [default: transformed-template.json].",
4242
type=Path,
43-
default=Path("transformed-template.yaml"),
43+
default=Path("transformed-template.json"),
4444
)
4545
parser.add_argument(
4646
"--s3-bucket",
@@ -102,7 +102,7 @@ def package(input_file_path, output_file_path): # type: ignore[no-untyped-def]
102102

103103

104104
def transform_template(input_file_path, output_file_path): # type: ignore[no-untyped-def]
105-
with open(input_file_path, "r") as f:
105+
with open(input_file_path) as f:
106106
sam_template = yaml_parse(f) # type: ignore[no-untyped-call]
107107

108108
try:

integration/combination/test_api_settings.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import hashlib
2+
from pathlib import Path
23
from unittest.case import skipIf
34

4-
from integration.config.service_names import REST_API
5-
from integration.helpers.resource import current_region_does_not_support
6-
7-
try:
8-
from pathlib import Path
9-
except ImportError:
10-
from pathlib2 import Path
11-
125
from parameterized import parameterized
136

7+
from integration.config.service_names import REST_API
148
from integration.helpers.base_test import BaseTest
9+
from integration.helpers.resource import current_region_does_not_support
1510

1611

1712
@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")

integration/combination/test_api_with_authorizer_apikey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def verify_authorized_request(
8585
status = response.status_code
8686
if status != expected_status_code:
8787
raise StatusCodeError(
88-
"Request to {} failed with status: {}, expected status: {}".format(url, status, expected_status_code)
88+
f"Request to {url} failed with status: {status}, expected status: {expected_status_code}"
8989
)
9090

9191
if not header_key or not header_value:

0 commit comments

Comments
 (0)