Skip to content

Commit 22c8d34

Browse files
committed
style(verify): strict mypy + ruff compliance for TechEngine
1 parent aad86d2 commit 22c8d34

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/verify/crossref.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def crossref_record(
109109
# --- concrete fetchers (network; not exercised by unit tests) --------------------
110110

111111

112-
def _wikidata_claim_year(entity: dict) -> int | None:
112+
def _wikidata_claim_year(entity: dict[str, Any]) -> int | None:
113113
"""First year from inception (P571) or publication date (P577) claims."""
114114
claims = entity.get("claims", {})
115115
for prop in ("P571", "P577"):
@@ -136,10 +136,11 @@ def __init__(self, timeout: float = 10.0, limit: int = 5) -> None:
136136
self.timeout = timeout
137137
self.limit = limit
138138

139-
def _get(self, url: str) -> dict:
139+
def _get(self, url: str) -> dict[str, Any]:
140140
req = Request(url, headers={"User-Agent": self.UA})
141141
with urlopen(req, timeout=self.timeout) as resp:
142-
return json.loads(resp.read().decode("utf-8"))
142+
data: dict[str, Any] = json.loads(resp.read().decode("utf-8"))
143+
return data
143144

144145
def search(self, name: str) -> list[Candidate]:
145146
try:

0 commit comments

Comments
 (0)