Skip to content

Commit 69f99d3

Browse files
chore(internal): codegen related update (#226)
1 parent f8b971d commit 69f99d3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

mypy.ini

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ markdown-it-py==3.0.0
4949
# via rich
5050
mdurl==0.1.2
5151
# via markdown-it-py
52-
mypy==1.13.0
52+
mypy==1.14.1
5353
mypy-extensions==1.0.0
5454
# via mypy
5555
nest-asyncio==1.6.0
@@ -69,7 +69,7 @@ pydantic-core==2.27.1
6969
# via pydantic
7070
pygments==2.18.0
7171
# via rich
72-
pyright==1.1.390
72+
pyright==1.1.392.post0
7373
pytest==8.3.3
7474
# via pytest-asyncio
7575
pytest-asyncio==0.24.0

src/onebusaway/_response.py

Lines changed: 7 additions & 1 deletion
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(
215221
"Pydantic models must subclass our base model type, e.g. `from onebusaway import BaseModel`"
216222
)

0 commit comments

Comments
 (0)