Skip to content

Commit a1aee5d

Browse files
authored
chore: Batch update dev dependencies (#2936)
1 parent 3e173da commit a1aee5d

File tree

8 files changed

+28
-31
lines changed

8 files changed

+28
-31
lines changed

bin/parse_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def main() -> None:
8989
if args.cfn and not re.match(r"^\w+::\w+::\w+( \w+)?$", title):
9090
continue
9191
page = title if args.cfn else path.stem
92-
for name, description in parse(text):
92+
for name, raw_description in parse(text):
9393
if page not in props:
9494
props[page] = {}
95-
description = remove_first_line(description) # Remove property name; already in the schema title
95+
description = remove_first_line(raw_description) # Remove property name; already in the schema title
9696
description = fix_markdown_code_link(description)
9797
prefix = (
9898
"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/"

requirements/dev.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
coverage~=5.3
2-
pytest-cov~=2.10.1
3-
pytest-xdist~=2.5
4-
pytest-env~=0.6.2
5-
pytest-rerunfailures~=9.1.1
6-
pyyaml~=5.4
7-
ruff==0.0.244 # loose the requirement once it is more stable
1+
coverage>=5.3,<8
2+
pytest-cov>=2.10,<5
3+
pytest-xdist>=2.5,<4
4+
pytest-env>=0.6,<1
5+
pytest-rerunfailures>=9.1,<12
6+
pyyaml~=6.0
7+
ruff==0.0.252 # loose the requirement once it is more stable
88

99
# Test requirements
10-
pytest~=6.2.5
11-
parameterized~=0.7.4
10+
pytest>=6.2,<8
11+
parameterized~=0.7
1212

1313
# Integration tests
14-
dateparser~=0.7
14+
dateparser~=1.1
1515
boto3>=1.23,<2
16-
tenacity~=7.0.0
16+
tenacity~=8.0
1717

1818
# Requirements for examples
19-
requests~=2.25.0
19+
requests~=2.28
2020

2121
# formatter
2222
black==23.1.0
@@ -27,5 +27,5 @@ mypy~=1.0.0
2727

2828
# types
2929
boto3-stubs[appconfig,serverlessrepo]>=1.19.5,==1.*
30-
types-PyYAML~=5.4
30+
types-PyYAML~=6.0
3131
types-jsonschema~=3.2

samtranslator/model/api/api_generator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,14 @@ def _construct_api_domain( # noqa: too-many-branches
521521
# Remove possible leading and trailing '/' because a base path may only
522522
# contain letters, numbers, and one of "$-_.+!*'()"
523523
path = "".join(e for e in basepath if e.isalnum())
524-
basepath = path if normalize_basepath else basepath
525524
logical_id = "{}{}{}".format(self.logical_id, path, "BasePathMapping")
526525
basepath_mapping = ApiGatewayBasePathMapping(
527526
logical_id, attributes=self.passthrough_resource_attributes
528527
)
529528
basepath_mapping.DomainName = ref(api_domain_name)
530529
basepath_mapping.RestApiId = ref(rest_api.logical_id)
531530
basepath_mapping.Stage = ref(rest_api.logical_id + ".Stage")
532-
basepath_mapping.BasePath = basepath
531+
basepath_mapping.BasePath = path if normalize_basepath else basepath
533532
basepath_resource_list.extend([basepath_mapping])
534533

535534
# Create the Route53 RecordSetGroup resource

samtranslator/model/api/http_api_generator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,13 @@ def _construct_basepath_mappings(
401401
if re.search(invalid_regex, path) is not None:
402402
raise InvalidResourceException(self.logical_id, "Invalid Basepath name provided.")
403403

404-
# ignore leading and trailing `/` in the path name
405-
path = path.strip("/")
406-
407404
logical_id = "{}{}{}".format(self.logical_id, re.sub(r"[\-_/]+", "", path), "ApiMapping")
408405
basepath_mapping = ApiGatewayV2ApiMapping(logical_id, attributes=self.passthrough_resource_attributes)
409406
basepath_mapping.DomainName = ref(api_domain_name)
410407
basepath_mapping.ApiId = ref(http_api.logical_id)
411408
basepath_mapping.Stage = ref(http_api.logical_id + ".Stage")
412-
basepath_mapping.ApiMappingKey = path
409+
# ignore leading and trailing `/` in the path name
410+
basepath_mapping.ApiMappingKey = path.strip("/")
413411
basepath_resource_list.extend([basepath_mapping])
414412
return basepath_resource_list
415413

samtranslator/open_api/open_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ def add_path_parameters_to_method(self, api, path, method_name, path_parameters)
219219
else:
220220
# create as Py27Dict and insert keys one by one to preserve input order
221221
parameter = Py27Dict()
222-
param = Py27UniStr(param) if isinstance(param, str) else param
223-
parameter["name"] = param
222+
parameter["name"] = Py27UniStr(param) if isinstance(param, str) else param
224223
parameter["in"] = "path"
225224
parameter["required"] = True
226225
parameters.append(parameter)

samtranslator/third_party/py27hash/hash.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def thash(value): # type: ignore[no-untyped-def]
7878
for y in value:
7979
length -= 1
8080

81-
y = Hash.hash(y)
82-
x = (x ^ y) * mult
81+
x = (x ^ Hash.hash(y)) * mult
8382
mult += 82520 + length + length
8483

8584
x += 97531

samtranslator/translator/translator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,22 +328,23 @@ def _get_embedded_connectors(self, resources: Dict[str, Any]) -> List[Resource]:
328328

329329
for connector_logical_id, connector_dict in resource["Connectors"].items():
330330
try:
331-
connector_logical_id = source_logical_id + connector_logical_id
331+
full_connector_logical_id = source_logical_id + connector_logical_id
332332
# can't use sam_expect since this is neither a property nor a resource attribute
333333
if not isinstance(connector_dict, dict):
334334
raise InvalidResourceException(
335-
connector_logical_id, f"{source_logical_id}.{connector_logical_id} should be a map."
335+
full_connector_logical_id,
336+
f"{source_logical_id}.{full_connector_logical_id} should be a map.",
336337
)
337338

338339
generated_connector = self._get_generated_connector(
339340
source_logical_id,
340-
connector_logical_id,
341+
full_connector_logical_id,
341342
connector_dict,
342343
)
343344

344345
if not verify_unique_logical_id(generated_connector, resources):
345346
raise DuplicateLogicalIdException(
346-
source_logical_id, connector_logical_id, generated_connector.resource_type
347+
source_logical_id, full_connector_logical_id, generated_connector.resource_type
347348
)
348349
connectors.append(generated_connector)
349350
except (InvalidResourceException, DuplicateLogicalIdException) as e:

samtranslator/utils/py27hash_fix.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,13 @@ def update(self, *args, **kwargs): # type: ignore[no-untyped-def]
406406
"""
407407
for arg in args:
408408
# Cast to dict if applicable. Otherwise, assume it's an iterable of (key, value) pairs
409+
_arg = arg
409410
if isinstance(arg, dict):
410411
# Merge incoming keys into keylist
411412
self.keylist.merge(arg.keys()) # type: ignore[no-untyped-call]
412-
arg = arg.items()
413+
_arg = arg.items()
413414

414-
for k, v in arg:
415+
for k, v in _arg:
415416
self[k] = v
416417

417418
for k, v in dict(**kwargs).items():

0 commit comments

Comments
 (0)