Commit Graph

49 Commits

Author SHA1 Message Date
Josiah Outram Halstead
540e0b0aa4 PIL: fix image convert palette type (#9331) 2022-12-05 13:36:30 +00:00
Steve Dignam
1c940e8914 PIL: add optimize param to save (#9328) 2022-12-05 00:16:54 +00:00
Nikita Sobolev
18e2ae762b Mark first argument of __[get|set|del]attr__ as str (#9245) 2022-11-22 11:06:50 +00:00
Nikita Sobolev
62a6c3d616 Annotate known magic-method return types (#9131) 2022-11-08 18:28:42 +00:00
github-actions[bot]
ef788b899d [stubsabot] Bump Pillow to 9.3.* (#9039)
Release: https://pypi.org/pypi/Pillow/9.3.0
Homepage: https://python-pillow.org
Changelog: https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst
Diff: https://github.com/python-pillow/Pillow/compare/9.2.0...9.3.0

Stubsabot analysis of the diff between the two releases:
 - Total lines of Python code added: 4163.
 - Total lines of Python code deleted: 3435.

If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR

Note that you will need to close and re-open the PR in order to trigger CI

Co-authored-by: stubsabot <>
2022-10-30 01:29:38 +01:00
Nikita Sobolev
ce4668a132 Use Incomplete instead of Any in __getattr__ (#8903) 2022-10-15 18:54:21 +01:00
Robert Schweizer
c9e6bd2df9 Allow PIL.Image.MAX_IMAGE_PIXELS to be None (#8876)
`_decompression_bomb_check()` explicitly checks for `None` and handles it as "unlimited".
2022-10-10 07:26:07 -07:00
Tdxdxoz
efeff93d21 fix: pillow.ImageDraw.textlength may return float (#8773) 2022-09-20 14:13:29 +01:00
ow0x
f074ef6803 [pillow] add new PIL.Image enums (#8419)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-28 14:20:52 -07:00
Shantanu
fb478f0b58 [stubsabot] Bump Pillow to 9.2.* (#8226) 2022-07-04 10:20:14 +02:00
Andrew Glick
0367fc94d9 Improve_Color type alias of PIL.Image (#8210)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-04 07:46:03 +01:00
eggplants
c383e95286 Fix box parameter type of Pillow.PIL.Image.paste (#8090)
When executing `img.paste(cropped, box=(10.5, 10.5))`:
TypeError: 'float' object cannot be interpreted as an integer

So the `box` parameter's type should be not `tuple[float, float]` but `tuple[int, int]`. (same as `_Box`)
2022-06-16 16:50:14 -07:00
Crozzers
082faf0d29 Pillow: change _Mode type alias to str (#7967) 2022-05-27 11:16:41 +02:00
Crozzers
62a8a6922c Pillow: Add missing image modes to _Mode type alias in Image.pyi stub (issue #7956) (#7960) 2022-05-26 19:00:48 +01:00
Alex Waygood
fa636bc044 Third-party stubs: fix several fictitious type aliases (#7958) 2022-05-26 06:26:26 -07:00
Jaakko Lappalainen
773ddb15bb Pillow: use union type for Image.paste (#7893) 2022-05-25 10:04:59 +01:00
Julian
032d937bdf #7805: Ensure all references to mode are Literals, not str. (#7807) 2022-05-08 16:51:27 +02:00
Sebastian Rittau
2d468966f5 Add various missing generic arguments (#7702)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-04-27 15:25:35 +03:00
Alex Waygood
653f2c6ba4 Third-party stubs: import from collections.abc where possible (#7637) 2022-04-16 14:52:57 +01:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
1ceb486b75 Replace Union with union operator (#7596) 2022-04-05 23:07:31 +02:00
Alex Waygood
85aec034ae Mark many attributes as read-only properties (#7591) 2022-04-05 08:37:24 +02:00
Alex Waygood
ec27c00ca2 Third-party stubs: Improve several __exit__ methods (#7575) 2022-04-01 08:03:12 -07:00
Alex Waygood
1acc8f3bd6 Use PEP 604 syntax wherever possible, part II (#7514)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-19 14:27:35 +00:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Alex Waygood
b4e97a1909 Improve __enter__ & constructor methods (#7114) 2022-02-02 22:14:59 +01:00
Jelle Zijlstra
de5ec6a0d1 fix incorrect tuple[T] (#6996)
Found from PyCQA/flake8-pyi#135.
2022-01-22 09:37:14 -08:00
Alex Waygood
96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: 79ec7b2826/src/filelock/_api.py (L207)

* Improve `opentracing/scope` annotation

Source code here: 3e1d357a34/opentracing/scope.py (L71)

* Improve `redis/client` stub

Source code here: 15f315a496/redis/client.py (L1217)

* Improve `redis/lock` annotation

Source code here: 15f315a496/redis/lock.py (L155)

* Improve `requests/models` annotation

Source code here: d718e75383/requests/models.py (L653)
2022-01-09 19:16:19 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Luca Chiodini
3b73acb06b Pillow: Image fixes (#6848)
* Fix return type of `Image.transform()`.
* Add animation attributes to `Image`.
2022-01-07 17:08:30 +01:00
Sebastian Rittau
4f4068243a Upgrade stubs to Pillow 9 (#6795)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-01-05 14:17:56 +02:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Sebastian Rittau
8b5feeb101 Remove PIL.__main__ (#6665) 2021-12-22 23:17:40 +01:00
Anthony Sottile
3bf165d723 correct border= and fill= kwargs for ImageOps.expand (#6641) 2021-12-20 17:47:01 -08:00
Akuli
a5bc1e037f Add mypy error codes to '# type: ignore' comments (#6379) 2021-11-26 07:07:56 +01:00
Sebastian Rittau
9f86972350 Add star to all non-0.1 versions (#6146) 2021-10-11 13:41:19 -07:00
Nikita Sobolev
2eadf9c174 Annotate PIL.ImageColor (#6151) 2021-10-11 18:20:02 +02:00
Nikita Sobolev
023c4dff67 Color arguments also take (r,g,b,a) tuples (#6148) 2021-10-11 14:56:59 +02:00
Fares Ahmed
d8ec167681 Fix type of stroke_width parameter in Pillow's ImageDraw.*text* functions (#6008) 2021-09-06 13:13:28 +02:00
SeenicRoot
034a5f6aec Fix return type of Image.reduce() in Pillow (#5946)
Image.reduce() should return an Image instead of None.
2021-08-22 20:03:22 -07:00
Jacob Walls
5e0012569d Change stub of Pillow.Image.new() to accept str for color argument (#5851) 2021-08-06 10:56:12 +02:00
Akuli
fdf073627c maybe fix stubtest (#5746)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-07-09 12:06:26 +03:00
Sebastian Rittau
788b20e326 Upgrade Pillow stubs for Pillow 8.3 (#5731)
* Upgrade Pillow stubs for Pillow 8.3

* stubtest: ignore PIL._tkinter_finder

* Annotate TiffTags.py

* Pillow: stubtest and various other fixes

* Remove tkinter modules from stubtest_allowlist
2021-07-08 18:22:07 -07:00
Jake Bailey
bb981bd726 Merge last of PIL stubs from Pylance (#5706)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-06-29 21:05:04 -07:00
Jake Bailey
6b8f047b05 Update some PIL stubs (#5692)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-28 10:29:17 -07:00
Sebastian Rittau
d3ba8a3858 Pillow: fix errors found by stubtest (#5629)
* Update Pillow stubtest allowlist

* Update cryptography allowlist
2021-06-13 15:15:51 +03:00
Sebastian Rittau
a3a355433d Add missing Pillow stubs (#5626)
These were generated with stubgen and then slightly hand edited, mostly
by fixing imports and a few other bits and bobs.
2021-06-12 18:38:59 -07:00
Shantanu
7244ea1f71 Test third party stubs with stubtest (#5615) 2021-06-13 00:17:40 +02:00
Sebastian Rittau
5d811e18b5 Add rudimentary Pillow stubs (#5594)
* Add rudimentary Pillow stubs

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-06-09 17:36:46 +03:00