Skip to content

Commit c69af99

Browse files
authored
Merge pull request #2814 from theupdateframework/dependabot/pip/test-and-lint-dependencies-8ddb29c2ba
2 parents 9f873cb + f3eddc1 commit c69af99

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

requirements/lint.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# Lint tools
77
# (We are not so interested in the specific versions of the tools: the versions
88
# are pinned to prevent unexpected linting failures when tools update)
9-
ruff==0.9.10
9+
ruff==0.11.0
1010
mypy==1.15.0
11-
zizmor==1.4.1
11+
zizmor==1.5.1
1212

1313
# Required for type stubs
1414
freezegun==1.5.1

tuf/api/dsse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def from_bytes(cls, data: bytes) -> SimpleEnvelope[T]:
8181
except Exception as e:
8282
raise DeserializationError from e
8383

84-
return cast(SimpleEnvelope[T], envelope)
84+
return cast("SimpleEnvelope[T]", envelope)
8585

8686
def to_bytes(self) -> bytes:
8787
"""Return envelope as JSON bytes.
@@ -150,4 +150,4 @@ def get_signed(self) -> T:
150150
except Exception as e:
151151
raise DeserializationError from e
152152

153-
return cast(T, inner_cls.from_dict(payload_dict))
153+
return cast("T", inner_cls.from_dict(payload_dict))

tuf/api/metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def from_dict(cls, metadata: dict[str, Any]) -> Metadata[T]:
199199

200200
return cls(
201201
# Specific type T is not known at static type check time: use cast
202-
signed=cast(T, inner_cls.from_dict(metadata.pop("signed"))),
202+
signed=cast("T", inner_cls.from_dict(metadata.pop("signed"))),
203203
signatures=signatures,
204204
# All fields left in the metadata dict are unrecognized.
205205
unrecognized_fields=metadata,

tuf/ngclient/_internal/trusted_metadata_set.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,22 @@ def __iter__(self) -> Iterator[Signed]:
145145
@property
146146
def root(self) -> Root:
147147
"""Get current root."""
148-
return cast(Root, self._trusted_set[Root.type])
148+
return cast("Root", self._trusted_set[Root.type])
149149

150150
@property
151151
def timestamp(self) -> Timestamp:
152152
"""Get current timestamp."""
153-
return cast(Timestamp, self._trusted_set[Timestamp.type])
153+
return cast("Timestamp", self._trusted_set[Timestamp.type])
154154

155155
@property
156156
def snapshot(self) -> Snapshot:
157157
"""Get current snapshot."""
158-
return cast(Snapshot, self._trusted_set[Snapshot.type])
158+
return cast("Snapshot", self._trusted_set[Snapshot.type])
159159

160160
@property
161161
def targets(self) -> Targets:
162162
"""Get current top-level targets."""
163-
return cast(Targets, self._trusted_set[Targets.type])
163+
return cast("Targets", self._trusted_set[Targets.type])
164164

165165
# Methods for updating metadata
166166
def update_root(self, data: bytes) -> Root:

tuf/ngclient/updater.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def _load_targets(self, role: str, parent_role: str) -> Targets:
459459

460460
# Avoid loading 'role' more than once during "get_targetinfo"
461461
if role in self._trusted_set:
462-
return cast(Targets, self._trusted_set[role])
462+
return cast("Targets", self._trusted_set[role])
463463

464464
try:
465465
data = self._load_local_metadata(role)

0 commit comments

Comments
 (0)