Skip to content

Commit 9111174

Browse files
fix(ci): repair mypy config and CI invocations for mypy 1.15
1 parent 46130cd commit 9111174

6 files changed

Lines changed: 16 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
run: pip install -r requirements-dev.txt
7676

7777
- name: Run mypy (strict, production packages)
78-
run: mypy
78+
run: mypy -p api -p utils -p models
7979

8080
- name: Run mypy on tests (non-strict smoke)
81-
run: mypy tests --follow-imports skip
81+
run: mypy tests --config-file mypy-tests.ini --follow-imports skip

api/_flask_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Shared Flask handler return types for mypy."""
22

3-
from typing import Any, Union
3+
from typing import Any, Union, cast
44

55
from flask import Response, jsonify
66

@@ -11,7 +11,7 @@
1111

1212
def json_response(*args: Any, **kwargs: Any) -> Response:
1313
"""Typed wrapper around :func:`flask.jsonify` for JSON bodies."""
14-
return jsonify(*args, **kwargs)
14+
return cast(Response, jsonify(*args, **kwargs))
1515

1616

1717
def json_error(payload: str | dict[str, Any], status: int) -> tuple[Response, int]:

api/export_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def bulk_export() -> FlaskReturn:
247247
buf,
248248
mimetype="application/zip",
249249
as_attachment=True,
250-
download_name=f"claude-code-export{suffix}-{date_tag}.zip",
250+
download_name=f"claude-code-export{suffix}-{date_tag}.zip", # type: ignore[call-arg]
251251
)
252252

253253

@@ -285,7 +285,7 @@ def export_session(project_name: str, session_id: str) -> FlaskReturn:
285285
buf,
286286
mimetype="application/json",
287287
as_attachment=True,
288-
download_name=f"{title_slug}.json",
288+
download_name=f"{title_slug}.json", # type: ignore[call-arg]
289289
)
290290

291291
md = session_to_markdown(session, stats)
@@ -295,7 +295,7 @@ def export_session(project_name: str, session_id: str) -> FlaskReturn:
295295
buf,
296296
mimetype="text/markdown",
297297
as_attachment=True,
298-
download_name=f"{title_slug}.md",
298+
download_name=f"{title_slug}.md", # type: ignore[call-arg]
299299
)
300300
except Exception:
301301
current_app.logger.exception(

mypy-tests.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Relaxed mypy pass for tests/ (CI smoke). Production code uses pyproject.toml strict.
2+
[mypy]
3+
python_version = 3.12
4+
strict = false
5+
disallow_untyped_defs = false
6+
disallow_untyped_calls = false

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,4 @@
22
python_version = "3.12"
33
strict = true
44
packages = ["api", "utils", "models"]
5-
6-
[[tool.mypy.overrides]]
7-
files = ["tests"]
8-
strict = false
9-
disallow_untyped_defs = false
10-
disallow_untyped_calls = false
5+
exclude = ["tests/"]

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-r requirements.txt
22
pytest==9.0.2
3-
mypy==2.1.0
3+
mypy==1.15.0
4+
types-Flask==1.1.6

0 commit comments

Comments
 (0)