Skip to content

Commit

Permalink
Bump pyright to 1.1.315 and fix openpyxl tests (#10356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Jun 23, 2023
1 parent c1df736 commit 5af30e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ all = true
disable_all_dunder_policy = true

[tool.typeshed]
pyright_version = "1.1.314"
pyright_version = "1.1.315"
4 changes: 2 additions & 2 deletions stubs/openpyxl/openpyxl/descriptors/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ class Convertible(Typed[_T, _N]):
# str | Blip
@overload
def __set__(
self: Convertible[str, bool] | Convertible[Blip, bool],
self: Convertible[str, _N] | Convertible[Blip, _N],
instance: Serialisable | Strict,
value: object, # Not[None] when _N = False
) -> None: ...
# bool
@overload
def __set__(self: Convertible[bool, bool], instance: Serialisable | Strict, value: _ConvertibleToBool) -> None: ...
def __set__(self: Convertible[bool, _N], instance: Serialisable | Strict, value: _ConvertibleToBool) -> None: ...
# int
@overload
def __set__(
Expand Down
14 changes: 7 additions & 7 deletions stubs/openpyxl/openpyxl/descriptors/nested.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc]
# str | Blip
@overload
def __set__(
self: NestedValue[str, bool] | NestedValue[Blip, bool],
self: NestedValue[str, _N] | NestedValue[Blip, _N],
instance: Serialisable | Strict,
value: object, # Not[None] when _N = False
) -> None: ...
# bool
@overload
def __set__(
self: NestedValue[bool, bool],
self: NestedValue[bool, _N],
instance: Serialisable | Strict,
value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool,
) -> None: ...
Expand Down Expand Up @@ -145,21 +145,21 @@ class NestedText(NestedValue[_T, _N]):
# str
@overload
def __set__( # type: ignore[misc] # Incompatible return type because of NoReturn
self: NestedValue[str, bool], instance: Serialisable | Strict, value: object # Not[None] when _N = False
self: NestedText[str, _N], instance: Serialisable | Strict, value: object # Not[None] when _N = False
) -> None: ...
# int
@overload
def __set__(
self: NestedValue[int, Literal[True]], instance: Serialisable | Strict, value: _ConvertibleToInt | None
self: NestedText[int, Literal[True]], instance: Serialisable | Strict, value: _ConvertibleToInt | None
) -> None: ...
@overload
def __set__(self: NestedValue[int, Literal[False]], instance: Serialisable | Strict, value: _ConvertibleToInt) -> None: ...
def __set__(self: NestedText[int, Literal[False]], instance: Serialisable | Strict, value: _ConvertibleToInt) -> None: ...
# If expected type (_T) is not str, it's impossible to use an Element as the value
@overload
def __set__(self: NestedValue[_T, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[Any]) -> NoReturn: ...
def __set__(self: NestedText[_T, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[Any]) -> NoReturn: ...
# Anything else
@overload
def __set__(self: NestedValue[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ...
def __set__(self: NestedText[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ...
def from_tree(self, node: _HasTagAndText) -> str: ... # type: ignore[override]
def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None) -> Element: ...

Expand Down

0 comments on commit 5af30e8

Please sign in to comment.