Skip to content

Commit 7ad0afb

Browse files
chore(internal): codegen related update (#93)
1 parent b42d933 commit 7ad0afb

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cache_fine_grained = True
4141
# ```
4242
# Changing this codegen to make mypy happy would increase complexity
4343
# and would not be worth it.
44-
disable_error_code = func-returns-value
44+
disable_error_code = func-returns-value,overload-cannot-match
4545

4646
# https://github.com/python/mypy/issues/12162
4747
[mypy.overrides]

requirements-dev.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ markdown-it-py==3.0.0
4848
# via rich
4949
mdurl==0.1.2
5050
# via markdown-it-py
51-
mypy==1.13.0
51+
mypy==1.14.1
5252
mypy-extensions==1.0.0
5353
# via mypy
5454
nest-asyncio==1.6.0
@@ -68,7 +68,7 @@ pydantic-core==2.27.1
6868
# via pydantic
6969
pygments==2.18.0
7070
# via rich
71-
pyright==1.1.390
71+
pyright==1.1.392.post0
7272
pytest==8.3.3
7373
# via pytest-asyncio
7474
pytest-asyncio==0.24.0

src/honcho/_response.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
210210
raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`")
211211
return cast(R, response)
212212

213-
if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel):
213+
if (
214+
inspect.isclass(
215+
origin # pyright: ignore[reportUnknownArgumentType]
216+
)
217+
and not issubclass(origin, BaseModel)
218+
and issubclass(origin, pydantic.BaseModel)
219+
):
214220
raise TypeError("Pydantic models must subclass our base model type, e.g. `from honcho import BaseModel`")
215221

216222
if (

0 commit comments

Comments
 (0)