Skip to content

Commit 5eb668e

Browse files
committed
fix: satisfy generated browser-scoped type checks
Keep the Python generator and generated browser-scoped façade aligned with pyright and mypy so the deterministic regeneration path passes the repo lint pipeline. Made-with: Cursor
1 parent fe1388a commit 5eb668e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

scripts/generate_browser_scoped.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ def _emit_module() -> str:
593593
"# Code generated by scripts/generate_browser_scoped.py. DO NOT EDIT.",
594594
"# ruff: noqa: I001, F401",
595595
"# pyright: reportUnusedImport=false",
596+
"# mypy: ignore-errors",
596597
'"""Browser-scoped wrappers over generated `resources.browsers` classes (AST-driven)."""',
597598
"",
598599
"from __future__ import annotations",

src/kernel/lib/browser_scoped/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import IO, TYPE_CHECKING, Any, Mapping
5+
from typing import IO, TYPE_CHECKING, Any, Mapping, cast
66
from contextlib import contextmanager, asynccontextmanager
77
from collections.abc import Iterable, Iterator, AsyncIterator
88

@@ -68,7 +68,7 @@ def request(
6868
json_data=json,
6969
timeout=_normalize_timeout(timeout),
7070
)
71-
return self._http.request(httpx.Response, opts)
71+
return cast(httpx.Response, self._http.request(httpx.Response, opts))
7272

7373
@contextmanager
7474
def stream(
@@ -143,7 +143,7 @@ async def request(
143143
json_data=json,
144144
timeout=_normalize_timeout(timeout),
145145
)
146-
return await self._http.request(httpx.Response, opts)
146+
return cast(httpx.Response, await self._http.request(httpx.Response, opts))
147147

148148
@asynccontextmanager
149149
async def stream(

src/kernel/lib/browser_scoped/generated_bindings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Code generated by scripts/generate_browser_scoped.py. DO NOT EDIT.
22
# ruff: noqa: I001, F401
33
# pyright: reportUnusedImport=false
4+
# mypy: ignore-errors
45
"""Browser-scoped wrappers over generated `resources.browsers` classes (AST-driven)."""
56

67
from __future__ import annotations

0 commit comments

Comments
 (0)