Skip to content

Commit 5cf1a5a

Browse files
dependabot[bot]roger-zhanggclaude
authored
chore(deps-dev): bump mypy from 1.19.1 to 2.1.0 (#8999)
* chore(deps-dev): bump mypy from 1.19.1 to 2.1.0 Bumps [mypy](https://github.com/python/mypy) from 1.19.1 to 2.1.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.19.1...v2.1.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 2.1.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fix: resolve mypy 2.1.0 type-check errors - _METRICS: add explicit Dict[str, "Metric"] annotation (var-annotated) - lambda_authorizer.py, resource_trigger.py: drop redundant cast() that mypy 2.1 now flags after upstream stub improvements (redundant-cast) - sync_flow.py __eq__: keep the outer cast(bool, ...) since _equality_keys() returns Any, but drop the inner cast(SyncFlow, o) — mypy 2.1 narrows o via the type(o) is type(self) guard Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roger Zhang <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
1 parent e56f4a3 commit 5cf1a5a

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ dev = [
6969
"aws-sam-cli[pre-dev]",
7070
"coverage==7.14.0",
7171
"pytest-cov==7.1.0",
72-
"mypy==1.19.1",
72+
"mypy==2.1.0",
7373
"types-pywin32==311.0.0.20260508",
7474
"types-PyYAML==6.0.12.20250915",
7575
"types-chevron==0.14.2.20260408",

samcli/lib/sync/sync_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def __hash__(self) -> int:
347347
def __eq__(self, o: object) -> bool:
348348
if type(o) is not type(self):
349349
return False
350-
return cast(bool, self._equality_keys() == cast(SyncFlow, o)._equality_keys())
350+
return cast(bool, self._equality_keys() == o._equality_keys())
351351

352352
@property
353353
def log_name(self) -> str:

samcli/lib/telemetry/metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
No side effect will result in this as it is write-only for code outside of telemetry.
4343
Decorators should be used to minimize logic involving telemetry.
4444
"""
45-
_METRICS = dict()
45+
_METRICS: Dict[str, "Metric"] = dict()
4646

4747
# Global container socket and runtime information for telemetry
4848
# This persists across context boundaries to ensure accurate telemetry reporting

samcli/lib/utils/resource_trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def _get_definition_file(self) -> str:
386386
definition_file = self._resource.get("Properties", {}).get(property_name)
387387
if not definition_file or not isinstance(definition_file, str):
388388
raise MissingLocalDefinition(self._resource_identifier, property_name)
389-
return cast(str, definition_file)
389+
return definition_file
390390

391391
def _validator_wrapper(self, event: Optional[FileSystemEvent] = None):
392392
"""Wrapper for callback that only executes if the definition is valid and non-trivial changes are detected.

samcli/local/apigw/authorizers/lambda_authorizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from abc import ABC, abstractmethod
77
from dataclasses import dataclass
88
from json import JSONDecodeError, loads
9-
from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast
9+
from typing import Any, Dict, List, Optional, Tuple, Type, Union
1010
from urllib.parse import parse_qsl
1111

1212
from samcli.commands.local.lib.validators.identity_source_validator import IdentitySourceValidator
@@ -417,7 +417,7 @@ def _validate_simple_response(self, response: dict) -> bool:
417417
f"Authorizer {self.authorizer_name} is missing or contains an invalid " f"{_SIMPLE_RESPONSE_IS_AUTH}"
418418
)
419419

420-
return cast(bool, is_authorized)
420+
return is_authorized
421421

422422
def get_context(self, response: Union[str, bytes]) -> Dict[str, Any]:
423423
"""

0 commit comments

Comments
 (0)