We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zune-python currently doesn't have type hint stubs, which makes the type checkers like pyright struggle.
I've made a template version of the stub and this could be polished and added to the repository:
import enum from typing import Literal, overload class ImageFormat(enum.Enum): FarbFeld = ... JPEG = ... PNG = ... PSD = ... Unknown = ... BMP = ... HDR = ... JPEG_XL = ... PPM = ... Qoi = ... class ResizeMethod(enum.Enum): Bilinear = ... Bicubic = ... class Image: @staticmethod def open(file: str) -> Image: ... def save(self, file: str, *, format: ImageFormat) -> None: ... def dimensions(self) -> tuple[int, int]: ... def width(self) -> int: ... def height(self) -> int: ... @overload def auto_orient(self, *, in_place: Literal[False]) -> Image: ... @overload def auto_orient(self, *, in_place: Literal[True]) -> None: ... def auto_orient(self, *, in_place: bool) -> Image | None: ... @overload def resize( self, new_width: int, new_height: int, method: ResizeMethod, *, in_place: Literal[False], ) -> Image: ... @overload def resize( self, new_width: int, new_height: int, method: ResizeMethod, *, in_place: Literal[True], ) -> None: ... def resize( self, new_width: int, new_height: int, method: ResizeMethod, *, in_place: bool ) -> Image | None: ... @overload def crop( self, width: int, height: int, x: int, y: int, *, in_place: Literal[False] ) -> Image: ... @overload def crop( self, width: int, height: int, x: int, y: int, *, in_place: Literal[True] ) -> None: ... def crop( self, width: int, height: int, x: int, y: int, *, in_place: bool ) -> Image | None: ...
The text was updated successfully, but these errors were encountered:
Is this an issue with. how marutin does things or it's an issue with zune -python?
I think maybe marutin should generate type hints or maybe I'm wrong
Sorry, something went wrong.
In my experience with maturin, it doesn't really generate stubs. You have to manually add this.
See PyO3/pyo3#2454
https://www.maturin.rs/project_layout This page also says you need to put a separate .pyi files
Successfully merging a pull request may close this issue.
zune-python currently doesn't have type hint stubs, which makes the type checkers like pyright struggle.
I've made a template version of the stub and this could be polished and added to the repository:
The text was updated successfully, but these errors were encountered: