File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,7 +149,9 @@ jobs:
149149 - name : Install runtime deps + mypy
150150 # Install from the pinned lock file for deterministic resolution,
151151 # then add mypy (dev-only; not in requirements-lock.txt).
152- # Flask 3.1+ ships inline types — do not install types-Flask (conflicts).
152+ # Flask 3.1+ includes inline type hints — do not add or install types-Flask
153+ # (it will conflict with our pip installs). Preventative guidance for future
154+ # maintainers editing the steps below.
153155 run : |
154156 python -m pip install --upgrade pip
155157 python -m pip install -r requirements-lock.txt
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ __pycache__/
99venv /
1010.venv /
1111env /
12- .mypy-ci-test /
1312
1413# Packaging
1514* .egg-info /
Original file line number Diff line number Diff line change 1212import zipfile
1313from datetime import datetime
1414from pathlib import Path
15- from typing import Any , cast
15+ from typing import Any
1616
1717from flask import Blueprint , Response , request
1818
@@ -45,7 +45,14 @@ def _get_export_state() -> dict[str, Any]:
4545 if os .path .isfile (state_path ):
4646 try :
4747 with open (state_path , "r" , encoding = "utf-8" ) as f :
48- return cast (dict [str , Any ], json .load (f ))
48+ parsed = json .load (f )
49+ if isinstance (parsed , dict ):
50+ return parsed
51+ _logger .warning (
52+ "Export state in %s is not a JSON object (got %s); ignoring" ,
53+ state_path ,
54+ type (parsed ).__name__ ,
55+ )
4956 except (json .JSONDecodeError , ValueError , OSError ) as e :
5057 _logger .warning (
5158 "Could not read export state from %s: %s" ,
You can’t perform that action at this time.
0 commit comments