-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove Pillow stubs #12732
New issue
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
Merged
Merged
Remove Pillow stubs #12732
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closes: python#11759
AlexWaygood
approved these changes
Oct 3, 2024
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diff from mypy_primer, showing the effect of this PR on open source code: scrapy (https://github.com/scrapy/scrapy)
+ scrapy/pipelines/images.py:280: error: Unused "type: ignore" comment [unused-ignore]
- scrapy/pipelines/images.py:262: error: Argument 2 to "paste" of "Image" has incompatible type "Image"; expected "tuple[int, int] | tuple[int, int, int, int] | None" [arg-type]
- scrapy/pipelines/images.py:267: error: Argument 2 to "paste" of "Image" has incompatible type "Image"; expected "tuple[int, int] | tuple[int, int, int, int] | None" [arg-type]
+ tests/test_pipeline_images.py:31: error: Unused "type: ignore" comment [unused-ignore]
streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/runtime/caching/hashing.py:473:1: error: Library stubs not installed for "PIL.Image" [import-untyped]
+ lib/streamlit/runtime/caching/hashing.py:473:1: note: Hint: "python3 -m pip install types-Pillow"
+ lib/streamlit/runtime/caching/hashing.py:473:1: note: (or run "mypy --install-types" to install all missing stub packages)
+ lib/streamlit/elements/image.py: note: In function "_image_is_gif":
+ lib/streamlit/elements/image.py:185:5: error: Returning Any from function declared to return "bool" [no-any-return]
+ lib/tests/streamlit/elements/image_test.py:22:1: error: Library stubs not installed for "PIL.Image" [import-untyped]
- lib/tests/streamlit/elements/image_test.py: note: In function "create_image":
- lib/tests/streamlit/elements/image_test.py:48:9: error: Argument 1 to "rectangle" of "ImageDraw" has incompatible type "List[Tuple[Any, Any]]"; expected "Union[Tuple[float, float, float, float], Tuple[Tuple[float, float], Tuple[float, float]]]" [arg-type]
- lib/tests/streamlit/elements/image_test.py:68:13: error: Argument 1 to "pieslice" of "ImageDraw" has incompatible type "List[Tuple[Any, Any]]"; expected "Tuple[Tuple[float, float], Tuple[float, float]]" [arg-type]
- lib/tests/streamlit/elements/image_test.py: note: In function "create_gif":
- lib/tests/streamlit/elements/image_test.py:99:28: error: List item 1 has incompatible type "Tuple[int, ...]"; expected "Union[float, Tuple[float, float]]" [list-item]
vision (https://github.com/pytorch/vision)
- torchvision/utils.py:228: error: Incompatible types in assignment (expression has type "FreeTypeFont", variable has type "ImageFont") [assignment]
+ torchvision/utils.py:615: error: Unused "type: ignore" comment [unused-ignore]
+ torchvision/utils.py:616: error: Unused "type: ignore" comment [unused-ignore]
+ torchvision/datasets/widerface.py:95: error: Unused "type: ignore" comment [unused-ignore]
+ torchvision/datasets/cityscapes.py:191: error: Unused "type: ignore" comment [unused-ignore]
- torchvision/transforms/v2/functional/_geometry.py:297: error: Argument "resample" to "resize" of "Image" has incompatible type "int"; expected "Resampling | Literal[0, 1, 2, 3, 4, 5] | None" [arg-type]
bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/io/export.py:50:1: error: Library stubs not installed for "PIL" [import-untyped]
+ src/bokeh/io/export.py:50:1: note: Hint: "python3 -m pip install types-Pillow"
+ src/bokeh/io/export.py: note: In function "get_screenshot_as_png":
+ src/bokeh/io/export.py:223:1: error: Return type becomes "Any" due to an unfollowed import [no-any-unimported]
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/images.py:15:1: error: Library stubs not installed for "PIL" [import-untyped]
+ sphinx/builders/_epub_base.py:30:1: error: Library stubs not installed for "PIL" [import-untyped]
+ sphinx/builders/_epub_base.py:30:1: note: Hint: "python3 -m pip install types-Pillow"
+ sphinx/builders/_epub_base.py:30:1: note: (or run "mypy --install-types" to install all missing stub packages)
+ sphinx/builders/_epub_base.py:30:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- sphinx/testing/fixtures.py:12:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
|
This was referenced Oct 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #11759