Skip to content

Remove Pillow stubs - #12732

Merged
srittau merged 2 commits into
python:mainfrom
srittau:rm-pillow
Oct 3, 2024
Merged

srittau merged 2 commits into
python:mainfrom
srittau:rm-pillow

Conversation

@srittau

@srittau srittau commented Oct 3, 2024

Copy link
Copy Markdown
Collaborator

Closes: #11759

Comment thread stubs/qrcode/METADATA.toml
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove types-Pillow (not before October 2024)

2 participants