Skip to content
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

Continuation of WIP: Type Annotations #2941

Closed
wants to merge 84 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
97c2312
Type annotations: Image.py.
neiljp Aug 17, 2017
43b704b
Type annotations: Switch to type alias for Mode & add self.im annotat…
neiljp Aug 18, 2017
bd4e593
Type annotations: Adjust Filter import.
neiljp Aug 18, 2017
cd26623
Type annotations: Adjust __repr__ return & ignore ne/eq.
neiljp Aug 18, 2017
0b00559
Type annotations: Add stubs for _imaging; aliases into aliases.py.
neiljp Aug 18, 2017
9625b79
Type annotations: Mark Image.draft to accept (Mode, Size).
neiljp Aug 19, 2017
850e28a
Type annotations: Add & use Extrema type alias.
neiljp Aug 19, 2017
5979e0e
Type annotations: Improve Image.getproject().
neiljp Aug 19, 2017
cbe9522
Type annotations: Improve imports in Image.py.
neiljp Aug 18, 2017
2c76f3b
Type annotations: Explicitly mark some Image data types.
neiljp Aug 19, 2017
898c83d
Type annotations: Correct Image/ImagingCore annotations.
neiljp Aug 19, 2017
04f7ac3
Type annotations: Annotate exclusive_fp.
neiljp Aug 19, 2017
363e409
Type annotations: Annotate self.tile & add FIXME.
neiljp Aug 19, 2017
4c45a31
Type annotations: Add Union & Any to aliases.py.
neiljp Aug 19, 2017
2d0fb6b
Type annotations: Amend eq/ne to be (object)->bool.
neiljp Aug 20, 2017
cb535be
Type annotations: Amend __setstate__ to accept Tuple.
neiljp Aug 20, 2017
0541e23
Type annotations: Enable Image.filter to also accept Callable returni…
neiljp Aug 20, 2017
2110a7f
Type annotations: Amend Image.point parameter types.
neiljp Aug 20, 2017
cf043ed
Type annotations: Correct pixel_access & specify self.readonly.
neiljp Aug 20, 2017
48e183e
Type annotations: _imaging.pyi: Significantly improve stubs.
neiljp Aug 20, 2017
2ab28d5
Type annotations: Allow Image.putpalette to accept ImagePalette.
neiljp Aug 20, 2017
910236f
Type annotations: Clarify return type of Image.split.
neiljp Aug 20, 2017
5515520
Type annotations: aliases.py: Amend Extrema to use float & int Tuples.
neiljp Aug 21, 2017
636e740
Type annotations: Amend Image.getdata to return ImagingCore.
neiljp Aug 21, 2017
10e2908
Type annotations: Image.rotate bool->int for a parameter.
neiljp Aug 21, 2017
ab40a28
Type annotations: Switch open/save BytesIO->BinaryIO.
neiljp Aug 21, 2017
1af8658
Type annotations: Label all obvious issues and label with 'FIXME TYPI…
neiljp Aug 21, 2017
1c0acf8
Type annotations: aliases.py: Add Color type-alias (no Text).
neiljp Aug 22, 2017
8db8e32
Type annotations: Image.py: Improve many annotations.
neiljp Aug 21, 2017
72393d7
Type annotations: _imaging.pyi: Many improvements.
neiljp Aug 22, 2017
46cb90f
Type annotations: Image.py: Correct _conv_type_shape & add _MODE_CONV.
neiljp Aug 22, 2017
5ee8094
Type annotations: Image.py: Initial annotation for expression analyzer.
neiljp Aug 22, 2017
8929e1e
Type annotations: _imaging.pyi typo.
neiljp Aug 24, 2017
d6f89c1
Type annotations: Image.py: Amend Image.resize given new parameter.
neiljp Aug 31, 2017
c23c755
Type annotations: Image.py: Annotation for not-installed handler.
neiljp Aug 31, 2017
6353c15
Type annotations: Image.py: Add _show and _showxv annotations.
neiljp Aug 31, 2017
f4765c9
Type annotations: _imaging.pyi: Add preliminary merge() stub.
neiljp Aug 31, 2017
9f011aa
Type annotations: _imaging.pyi: Amend Image.resize after API change.
neiljp Aug 31, 2017
be22cc3
Type annotations: aliases.py: Remove Any.
neiljp Aug 31, 2017
af9c0a1
clarifying type annotations
wiredfool Nov 13, 2017
2e94a2e
Move fp handling into ImageFile
wiredfool Nov 13, 2017
b2b035f
Use Color type for fillcolor
wiredfool Dec 29, 2017
79a09a2
src reorg
wiredfool Jan 3, 2018
352c4d0
make target for typecheck
wiredfool Jan 3, 2018
d4604bb
Remove case for when _imaging module is not present
wiredfool Jan 3, 2018
3ebc0f2
Don't reassign crc on close
wiredfool Jan 3, 2018
f55c6eb
Type tags for TiffTags
wiredfool Jan 3, 2018
90a7414
Fix PyAccess type error
wiredfool Jan 3, 2018
e33706b
Typing, return required
wiredfool Jan 3, 2018
a0666cc
Typing: __array_interface__
wiredfool Jan 3, 2018
3697f87
Typing: *args to _getencoder, _getdecoder, tobytes, frombytes
wiredfool Jan 3, 2018
4aaa3cb
Added mypy cache to gitignore
wiredfool Jan 3, 2018
6e79536
Typing: quantize
wiredfool Jan 3, 2018
00fef4b
Typing: ImageFilter Image.filter.
wiredfool Jan 3, 2018
9a0c10e
Typing: Image.getcolors
wiredfool Jan 3, 2018
2ce902a
Typing: Image.getextrema
wiredfool Jan 3, 2018
4d06d70
Typing: Additional extrema types
wiredfool Jan 4, 2018
13e1902
Tabs->spaces
wiredfool Jan 4, 2018
bebece4
Typing: relaxed type for MultiChannelExtrema
wiredfool Jan 4, 2018
a0bdadf
Typing: Clarify that this is a single band extrema
wiredfool Jan 4, 2018
6e45d8d
Typing: UNDONE-- Mostly complete paste with working type annotations
wiredfool Jan 4, 2018
1f1b90f
Ignore that which mypy gets wrong
wiredfool Jan 4, 2018
42086c3
Typing: Image.alphacomposite
wiredfool Jan 5, 2018
02e1080
Typing: Image.putalpha
wiredfool Jan 5, 2018
3ee774e
Typing: Ignore py2/py3 differences
wiredfool Jan 5, 2018
83124c5
Typing: resize -- ignore tuple manipulations
wiredfool Jan 5, 2018
864e953
Typing: Image.transform
wiredfool Jan 5, 2018
4b47177
Typing: Image.save
wiredfool Jan 5, 2018
e220e00
Typing: Image.getchannel
wiredfool Jan 5, 2018
404d6f3
Whitespace
wiredfool Jan 5, 2018
a5c66e4
Typing: Image.transform
wiredfool Jan 5, 2018
95cf0a6
Typing: additional imports
wiredfool Jan 5, 2018
18f5f2c
Typing: Image.frombytes
wiredfool Jan 5, 2018
0bbfb3b
Typing: Image.frombuffer
wiredfool Jan 5, 2018
4b241c4
Typing: Image.fromarray
wiredfool Jan 5, 2018
db0e083
Typing: Image.open
wiredfool Jan 5, 2018
523c450
Typing: _imaging.clear_cache
wiredfool Jan 5, 2018
132ce41
Typing: TiffImagePlugin: ignore meta stuff
wiredfool Jan 5, 2018
bee5068
Typing: ImageShow typehints
wiredfool Jan 5, 2018
4a30b7a
Typing: Ignore forcibly setting things to errors
wiredfool Jan 5, 2018
02a1aa4
Typing: Note about fromarray and the buffer interface
wiredfool Jan 5, 2018
45752d2
Merge branch 'master' into pr_2687
radarhere Feb 15, 2019
14e7f8a
Lint fixes
radarhere Feb 15, 2019
fdebb6f
Merge branch 'master' into pr_2687
radarhere Mar 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ Tests/images/README.md
Tests/images/msp
Tests/images/picins
Tests/images/sunraster
/.mypy_cache/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section of .gitignore is for "Extra test images installed from pillow-depends/test_images". Better place is "Unit test / coverage reports"

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ sdist:
test:
pytest -qq

typecheck:
mypy --ignore-missing-imports -2 src/PIL/Image.py

# https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file
upload-test:
# [test]
Expand Down
Loading