Skip to content

Commit

Permalink
Minor typing fixes (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion committed Jun 17, 2024
1 parent d78f585 commit bb3108b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions pylibjpeg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __call__(self, src: bytes, **kwargs: Any) -> np.ndarray:


class Encoder(Protocol):
def __call__(self, src: np.ndarray, **kwargs: Any) -> Union[bytes, bytearray]:
def __call__(self, src: Union[np.ndarray, bytes], **kwargs: Any) -> Union[bytes, bytearray]:
... # pragma: no cover


Expand Down Expand Up @@ -347,7 +347,10 @@ def get_pixel_data_decoders(

entry_point = "pylibjpeg.pixel_data_decoders"
decoders = cast(
Union[Dict[str, Decoder], Dict[str, Dict[str, Decoder]]],
Union[
Dict[str, Union[Decoder, Encoder]],
Dict[str, Dict[str, Union[Decoder, Encoder]]],
],
_get_pixel_data_plugins(entry_point, version),
)
return decoders
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ license = {text = "MIT"}
name = "pylibjpeg"
readme = "README.md"
requires-python = ">=3.8"
version = "2.0.0"
version = "2.0.1"


[project.optional-dependencies]
Expand Down

0 comments on commit bb3108b

Please sign in to comment.