Skip to content

Commit 2358e63

Browse files
authored
Update to pyright==1.1.335 (#8075)
1 parent ab843af commit 2358e63

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ jobs:
269269
node-version: '18'
270270

271271
- name: install pyright
272-
run: npm install -g [email protected].322 # try to keep this in sync with .pre-commit-config.yaml
272+
run: npm install -g [email protected].335 # try to keep this in sync with .pre-commit-config.yaml
273273

274274
- name: run pyright tests
275275
run: make test-pyright

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ repos:
3636
types: [python]
3737
language: node
3838
pass_filenames: false
39-
additional_dependencies: ["[email protected].322"]
39+
additional_dependencies: ["[email protected].335"] # try to keep this in sync with .github/workflows/ci.yml

pydantic/_internal/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def smart_deepcopy(obj: Obj) -> Obj:
309309
try:
310310
if not obj and obj_type in BUILTIN_COLLECTIONS:
311311
# faster way for empty collections, no need to copy its members
312-
return obj if obj_type is tuple else obj.copy() # tuple doesn't have copy method
312+
return obj if obj_type is tuple else obj.copy() # tuple doesn't have copy method # type: ignore
313313
except (TypeError, ValueError, RuntimeError):
314314
# do we really dare to catch ALL errors? Seems a bit risky
315315
pass

pydantic/deprecated/parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def load_str_bytes(
4646
if proto == Protocol.json:
4747
if isinstance(b, bytes):
4848
b = b.decode(encoding)
49-
return json_loads(b)
49+
return json_loads(b) # type: ignore
5050
elif proto == Protocol.pickle:
5151
if not allow_pickle:
5252
raise RuntimeError('Trying to decode with pickle with allow_pickle=False')
53-
bb = b if isinstance(b, bytes) else b.encode()
53+
bb = b if isinstance(b, bytes) else b.encode() # type: ignore
5454
return pickle.loads(bb)
5555
else:
5656
raise TypeError(f'Unknown protocol: {proto}')

pydantic/fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class MyModel(pydantic.BaseModel):
244244
return cls(default=default, **kwargs)
245245

246246
@classmethod
247-
def from_annotation(cls, annotation: type[Any]) -> typing_extensions.Self:
247+
def from_annotation(cls, annotation: type[Any]) -> FieldInfo:
248248
"""Creates a `FieldInfo` instance from a bare annotation.
249249
250250
Args:
@@ -306,7 +306,7 @@ class MyModel(pydantic.BaseModel):
306306
return cls(annotation=annotation, frozen=final or None)
307307

308308
@classmethod
309-
def from_annotated_attribute(cls, annotation: type[Any], default: Any) -> typing_extensions.Self:
309+
def from_annotated_attribute(cls, annotation: type[Any], default: Any) -> FieldInfo:
310310
"""Create `FieldInfo` from an annotation with a default value.
311311
312312
Args:
@@ -402,7 +402,7 @@ def merge_field_infos(*field_infos: FieldInfo, **overrides: Any) -> FieldInfo:
402402
field_info._attributes_set.update(overrides)
403403
for k, v in overrides.items():
404404
setattr(field_info, k, v)
405-
return field_info
405+
return field_info # type: ignore
406406

407407
new_kwargs: dict[str, Any] = {}
408408
metadata = {}

pydantic/type_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __new__(cls, __type: type[T], *, config: ConfigDict | None = ...) -> TypeAda
125125
def __new__(cls, __type: T, *, config: ConfigDict | None = ...) -> TypeAdapter[T]:
126126
...
127127

128-
def __new__(cls, __type: Any, *, config: ConfigDict | None = ...) -> TypeAdapter[T]:
128+
def __new__(cls, __type: Any, *, config: ConfigDict | None = None) -> TypeAdapter[T]:
129129
"""A class representing the type adapter."""
130130
raise NotImplementedError
131131

0 commit comments

Comments
 (0)