From 0c5895470cf6b02aaa42bec77414781bfb0999e2 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 5 Nov 2019 17:00:34 +0200 Subject: [PATCH 1/6] Remove deprecated __version__ from plugins --- src/PIL/BmpImagePlugin.py | 4 ---- src/PIL/CurImagePlugin.py | 4 ---- src/PIL/DcxImagePlugin.py | 4 ---- src/PIL/EpsImagePlugin.py | 4 ---- src/PIL/FliImagePlugin.py | 5 ----- src/PIL/FpxImagePlugin.py | 4 ---- src/PIL/GdImageFile.py | 5 ----- src/PIL/GifImagePlugin.py | 5 ----- src/PIL/IcoImagePlugin.py | 4 ---- src/PIL/ImImagePlugin.py | 5 ----- src/PIL/ImtImagePlugin.py | 5 ----- src/PIL/IptcImagePlugin.py | 4 ---- src/PIL/Jpeg2KImagePlugin.py | 4 ---- src/PIL/JpegImagePlugin.py | 5 ----- src/PIL/McIdasImagePlugin.py | 4 ---- src/PIL/MicImagePlugin.py | 5 ----- src/PIL/MpegImagePlugin.py | 5 ----- src/PIL/MpoImagePlugin.py | 4 ---- src/PIL/MspImagePlugin.py | 5 ----- src/PIL/PalmImagePlugin.py | 4 ---- src/PIL/PcdImagePlugin.py | 5 ----- src/PIL/PcxImagePlugin.py | 4 ---- src/PIL/PdfImagePlugin.py | 9 ++------- src/PIL/PixarImagePlugin.py | 5 ----- src/PIL/PngImagePlugin.py | 4 ---- src/PIL/PpmImagePlugin.py | 4 ---- src/PIL/PsdImagePlugin.py | 4 ---- src/PIL/SgiImagePlugin.py | 4 ---- src/PIL/SunImagePlugin.py | 4 ---- src/PIL/TgaImagePlugin.py | 5 ----- src/PIL/TiffImagePlugin.py | 3 --- src/PIL/WmfImagePlugin.py | 4 ---- src/PIL/XVThumbImagePlugin.py | 4 ---- src/PIL/XbmImagePlugin.py | 4 ---- src/PIL/XpmImagePlugin.py | 4 ---- 35 files changed, 2 insertions(+), 154 deletions(-) diff --git a/src/PIL/BmpImagePlugin.py b/src/PIL/BmpImagePlugin.py index 8426e2497..e9c2afd10 100644 --- a/src/PIL/BmpImagePlugin.py +++ b/src/PIL/BmpImagePlugin.py @@ -27,10 +27,6 @@ from . import Image, ImageFile, ImagePalette from ._binary import i8, i16le as i16, i32le as i32, o8, o16le as o16, o32le as o32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.7" - # # -------------------------------------------------------------------- # Read BMP file diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index 9e2d8c96f..50bf1a356 100644 --- a/src/PIL/CurImagePlugin.py +++ b/src/PIL/CurImagePlugin.py @@ -21,10 +21,6 @@ from __future__ import print_function from . import BmpImagePlugin, Image from ._binary import i8, i16le as i16, i32le as i32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - # # -------------------------------------------------------------------- diff --git a/src/PIL/DcxImagePlugin.py b/src/PIL/DcxImagePlugin.py index 57c321417..7d2aff325 100644 --- a/src/PIL/DcxImagePlugin.py +++ b/src/PIL/DcxImagePlugin.py @@ -25,10 +25,6 @@ from . import Image from ._binary import i32le as i32 from .PcxImagePlugin import PcxImageFile -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then? diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py index 721ad4c21..37cba79c3 100644 --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -30,10 +30,6 @@ import tempfile from . import Image, ImageFile from ._binary import i32le as i32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.5" - # # -------------------------------------------------------------------- diff --git a/src/PIL/FliImagePlugin.py b/src/PIL/FliImagePlugin.py index 82015e2fc..9bf7d74d6 100644 --- a/src/PIL/FliImagePlugin.py +++ b/src/PIL/FliImagePlugin.py @@ -19,11 +19,6 @@ from . import Image, ImageFile, ImagePalette from ._binary import i8, i16le as i16, i32le as i32, o8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - - # # decoder diff --git a/src/PIL/FpxImagePlugin.py b/src/PIL/FpxImagePlugin.py index 15ebe0e3b..dfb509e15 100644 --- a/src/PIL/FpxImagePlugin.py +++ b/src/PIL/FpxImagePlugin.py @@ -22,10 +22,6 @@ import olefile from . import Image, ImageFile from ._binary import i8, i32le as i32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - # we map from colour field tuples to (mode, rawmode) descriptors MODES = { # opacity diff --git a/src/PIL/GdImageFile.py b/src/PIL/GdImageFile.py index 2d492358c..80235bba6 100644 --- a/src/PIL/GdImageFile.py +++ b/src/PIL/GdImageFile.py @@ -26,11 +26,6 @@ from . import ImageFile, ImagePalette from ._binary import i8, i16be as i16, i32be as i32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - - ## # Image plugin for the GD uncompressed format. Note that this format # is not supported by the standard Image.open function. To use diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index a92c142f0..ec0f1ee71 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -31,11 +31,6 @@ import subprocess from . import Image, ImageChops, ImageFile, ImagePalette, ImageSequence from ._binary import i8, i16le as i16, o8, o16le as o16 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.9" - - # -------------------------------------------------------------------- # Identify/read GIF files diff --git a/src/PIL/IcoImagePlugin.py b/src/PIL/IcoImagePlugin.py index 148e604f8..2e4ad1d65 100644 --- a/src/PIL/IcoImagePlugin.py +++ b/src/PIL/IcoImagePlugin.py @@ -30,10 +30,6 @@ from math import ceil, log from . import BmpImagePlugin, Image, ImageFile, PngImagePlugin from ._binary import i8, i16le as i16, i32le as i32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - # # -------------------------------------------------------------------- diff --git a/src/PIL/ImImagePlugin.py b/src/PIL/ImImagePlugin.py index 77127fae6..12c9237f0 100644 --- a/src/PIL/ImImagePlugin.py +++ b/src/PIL/ImImagePlugin.py @@ -31,11 +31,6 @@ import re from . import Image, ImageFile, ImagePalette from ._binary import i8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.7" - - # -------------------------------------------------------------------- # Standard tags diff --git a/src/PIL/ImtImagePlugin.py b/src/PIL/ImtImagePlugin.py index a9e991fbe..21ffd7475 100644 --- a/src/PIL/ImtImagePlugin.py +++ b/src/PIL/ImtImagePlugin.py @@ -19,11 +19,6 @@ import re from . import Image, ImageFile -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - - # # -------------------------------------------------------------------- diff --git a/src/PIL/IptcImagePlugin.py b/src/PIL/IptcImagePlugin.py index aedf2e48c..cb39aab83 100644 --- a/src/PIL/IptcImagePlugin.py +++ b/src/PIL/IptcImagePlugin.py @@ -23,10 +23,6 @@ import tempfile from . import Image, ImageFile from ._binary import i8, i16be as i16, i32be as i32, o8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.3" - COMPRESSION = {1: "raw", 5: "jpeg"} PAD = o8(0) * 4 diff --git a/src/PIL/Jpeg2KImagePlugin.py b/src/PIL/Jpeg2KImagePlugin.py index 37f111778..2c51d3678 100644 --- a/src/PIL/Jpeg2KImagePlugin.py +++ b/src/PIL/Jpeg2KImagePlugin.py @@ -18,10 +18,6 @@ import struct from . import Image, ImageFile -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - def _parse_codestream(fp): """Parse the JPEG 2000 codestream to extract the size and component diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py index da0759129..42ac025b3 100644 --- a/src/PIL/JpegImagePlugin.py +++ b/src/PIL/JpegImagePlugin.py @@ -47,11 +47,6 @@ from ._binary import i8, i16be as i16, i32be as i32, o8 from ._util import isStringType from .JpegPresets import presets -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.6" - - # # Parser diff --git a/src/PIL/McIdasImagePlugin.py b/src/PIL/McIdasImagePlugin.py index bddd33abb..cd047fe9d 100644 --- a/src/PIL/McIdasImagePlugin.py +++ b/src/PIL/McIdasImagePlugin.py @@ -20,10 +20,6 @@ import struct from . import Image, ImageFile -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - def _accept(s): return s[:8] == b"\x00\x00\x00\x00\x00\x00\x00\x04" diff --git a/src/PIL/MicImagePlugin.py b/src/PIL/MicImagePlugin.py index b48905bda..5396b2014 100644 --- a/src/PIL/MicImagePlugin.py +++ b/src/PIL/MicImagePlugin.py @@ -21,11 +21,6 @@ import olefile from . import Image, TiffImagePlugin -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - - # # -------------------------------------------------------------------- diff --git a/src/PIL/MpegImagePlugin.py b/src/PIL/MpegImagePlugin.py index 9c662fcc2..5988c5be2 100644 --- a/src/PIL/MpegImagePlugin.py +++ b/src/PIL/MpegImagePlugin.py @@ -17,11 +17,6 @@ from . import Image, ImageFile from ._binary import i8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - - # # Bitstream parser diff --git a/src/PIL/MpoImagePlugin.py b/src/PIL/MpoImagePlugin.py index 938f2a5a6..a63e76fe7 100644 --- a/src/PIL/MpoImagePlugin.py +++ b/src/PIL/MpoImagePlugin.py @@ -21,10 +21,6 @@ from . import Image, ImageFile, JpegImagePlugin from ._binary import i16be as i16 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - def _accept(prefix): return JpegImagePlugin._accept(prefix) diff --git a/src/PIL/MspImagePlugin.py b/src/PIL/MspImagePlugin.py index 7315ab66e..21e71e78b 100644 --- a/src/PIL/MspImagePlugin.py +++ b/src/PIL/MspImagePlugin.py @@ -29,11 +29,6 @@ import struct from . import Image, ImageFile from ._binary import i8, i16le as i16, o16le as o16 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - - # # read MSP files diff --git a/src/PIL/PalmImagePlugin.py b/src/PIL/PalmImagePlugin.py index dd068d794..62f13f535 100644 --- a/src/PIL/PalmImagePlugin.py +++ b/src/PIL/PalmImagePlugin.py @@ -10,10 +10,6 @@ from . import Image, ImageFile from ._binary import o8, o16be as o16b -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "1.0" - # fmt: off _Palm8BitColormapValues = ( # noqa: E131 (255, 255, 255), (255, 204, 255), (255, 153, 255), (255, 102, 255), diff --git a/src/PIL/PcdImagePlugin.py b/src/PIL/PcdImagePlugin.py index 6f01845ec..625f55646 100644 --- a/src/PIL/PcdImagePlugin.py +++ b/src/PIL/PcdImagePlugin.py @@ -18,11 +18,6 @@ from . import Image, ImageFile from ._binary import i8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - - ## # Image plugin for PhotoCD images. This plugin only reads the 768x512 # image from the file; higher resolutions are encoded in a proprietary diff --git a/src/PIL/PcxImagePlugin.py b/src/PIL/PcxImagePlugin.py index 397af8c10..6768a38f9 100644 --- a/src/PIL/PcxImagePlugin.py +++ b/src/PIL/PcxImagePlugin.py @@ -33,10 +33,6 @@ from ._binary import i8, i16le as i16, o8, o16le as o16 logger = logging.getLogger(__name__) -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.6" - def _accept(prefix): return i8(prefix[0]) == 10 and i8(prefix[1]) in [0, 2, 3, 5] diff --git a/src/PIL/PdfImagePlugin.py b/src/PIL/PdfImagePlugin.py index 1fd40f5ba..18de6f5a7 100644 --- a/src/PIL/PdfImagePlugin.py +++ b/src/PIL/PdfImagePlugin.py @@ -24,12 +24,7 @@ import io import os import time -from . import Image, ImageFile, ImageSequence, PdfParser - -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.5" - +from . import Image, ImageFile, ImageSequence, PdfParser, __version__ # # -------------------------------------------------------------------- @@ -82,7 +77,7 @@ def _save(im, fp, filename, save_all=False): existing_pdf.start_writing() existing_pdf.write_header() - existing_pdf.write_comment("created by PIL PDF driver " + __version__) + existing_pdf.write_comment("created by Pillow PDF driver " + __version__) # # pages diff --git a/src/PIL/PixarImagePlugin.py b/src/PIL/PixarImagePlugin.py index dc71ca17a..5ea32ba89 100644 --- a/src/PIL/PixarImagePlugin.py +++ b/src/PIL/PixarImagePlugin.py @@ -22,11 +22,6 @@ from . import Image, ImageFile from ._binary import i16le as i16 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - - # # helpers diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 84317ceb7..62a1d1a1e 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -40,10 +40,6 @@ from . import Image, ImageFile, ImagePalette from ._binary import i8, i16be as i16, i32be as i32, o16be as o16, o32be as o32 from ._util import py3 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.9" - logger = logging.getLogger(__name__) is_cid = re.compile(br"\w\w\w\w").match diff --git a/src/PIL/PpmImagePlugin.py b/src/PIL/PpmImagePlugin.py index c3e9eed6d..67c672485 100644 --- a/src/PIL/PpmImagePlugin.py +++ b/src/PIL/PpmImagePlugin.py @@ -17,10 +17,6 @@ from . import Image, ImageFile -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - # # -------------------------------------------------------------------- diff --git a/src/PIL/PsdImagePlugin.py b/src/PIL/PsdImagePlugin.py index f72ad5f44..cf1b4d94d 100644 --- a/src/PIL/PsdImagePlugin.py +++ b/src/PIL/PsdImagePlugin.py @@ -16,10 +16,6 @@ # See the README file for information on usage and redistribution. # -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.4" - import io from . import Image, ImageFile, ImagePalette diff --git a/src/PIL/SgiImagePlugin.py b/src/PIL/SgiImagePlugin.py index 99408fdc3..8b2268104 100644 --- a/src/PIL/SgiImagePlugin.py +++ b/src/PIL/SgiImagePlugin.py @@ -29,10 +29,6 @@ from . import Image, ImageFile from ._binary import i8, i16be as i16, o8 from ._util import py3 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.3" - def _accept(prefix): return len(prefix) >= 2 and i16(prefix) == 474 diff --git a/src/PIL/SunImagePlugin.py b/src/PIL/SunImagePlugin.py index 74fa5f7bd..fd7ca8a40 100644 --- a/src/PIL/SunImagePlugin.py +++ b/src/PIL/SunImagePlugin.py @@ -20,10 +20,6 @@ from . import Image, ImageFile, ImagePalette from ._binary import i32be as i32 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.3" - def _accept(prefix): return len(prefix) >= 4 and i32(prefix) == 0x59A66A95 diff --git a/src/PIL/TgaImagePlugin.py b/src/PIL/TgaImagePlugin.py index b1b351396..40cadbb6b 100644 --- a/src/PIL/TgaImagePlugin.py +++ b/src/PIL/TgaImagePlugin.py @@ -22,11 +22,6 @@ import warnings from . import Image, ImageFile, ImagePalette from ._binary import i8, i16le as i16, o8, o16le as o16 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.3" - - # # -------------------------------------------------------------------- # Read RGA file diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 7f596b9ed..10faa7702 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -64,9 +64,6 @@ except ImportError: from collections import MutableMapping -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "1.3.5" DEBUG = False # Needs to be merged with the new logging approach. # Set these to true to force use of libtiff for reading or writing. diff --git a/src/PIL/WmfImagePlugin.py b/src/PIL/WmfImagePlugin.py index 416af6fd7..151c48ae2 100644 --- a/src/PIL/WmfImagePlugin.py +++ b/src/PIL/WmfImagePlugin.py @@ -25,10 +25,6 @@ from . import Image, ImageFile from ._binary import i16le as word, i32le as dword, si16le as short, si32le as _long from ._util import py3 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - _handler = None if py3: diff --git a/src/PIL/XVThumbImagePlugin.py b/src/PIL/XVThumbImagePlugin.py index aa3536d85..c0d8db09a 100644 --- a/src/PIL/XVThumbImagePlugin.py +++ b/src/PIL/XVThumbImagePlugin.py @@ -20,10 +20,6 @@ from . import Image, ImageFile, ImagePalette from ._binary import i8, o8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.1" - _MAGIC = b"P7 332" # standard color palette for thumbnails (RGB332) diff --git a/src/PIL/XbmImagePlugin.py b/src/PIL/XbmImagePlugin.py index bc825c3f3..4ca101701 100644 --- a/src/PIL/XbmImagePlugin.py +++ b/src/PIL/XbmImagePlugin.py @@ -23,10 +23,6 @@ import re from . import Image, ImageFile -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.6" - # XBM header xbm_head = re.compile( br"\s*#define[ \t]+.*_width[ \t]+(?P[0-9]+)[\r\n]+" diff --git a/src/PIL/XpmImagePlugin.py b/src/PIL/XpmImagePlugin.py index 275148827..d8bd00a1b 100644 --- a/src/PIL/XpmImagePlugin.py +++ b/src/PIL/XpmImagePlugin.py @@ -20,10 +20,6 @@ import re from . import Image, ImageFile, ImagePalette from ._binary import i8, o8 -# __version__ is deprecated and will be removed in a future version. Use -# PIL.__version__ instead. -__version__ = "0.2" - # XPM header xpm_head = re.compile(b'"([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)') From 09e48ae768fb819c9e3c5ba83b455a8a9e3b9f16 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 5 Nov 2019 17:00:51 +0200 Subject: [PATCH 2/6] Remove deprecated __version__ from plugins --- docs/deprecations.rst | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 144661820..db4219528 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -22,31 +22,6 @@ Python 2.7 reaches end-of-life on 2020-01-01. Pillow 7.0.0 will be released on 2020-01-01 and will drop support for Python 2.7, making Pillow 6.x the last series to support Python 2. -PIL.*ImagePlugin.__version__ attributes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 6.0.0 - -The version constants of individual plugins have been deprecated and will be removed in -a future version. Use ``PIL.__version__`` instead. - -=============================== ================================= ================================== -Deprecated Deprecated Deprecated -=============================== ================================= ================================== -``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__`` -``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__`` -``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__`` -``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__`` -``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__`` -``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__`` -``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__`` -``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__`` -``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__`` -``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__`` -``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__`` -``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__`` -=============================== ================================= ================================== - ImageCms.CmsProfile attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -103,6 +78,31 @@ PILLOW_VERSION constant ``PILLOW_VERSION`` has been removed. Use ``__version__`` instead. +PIL.*ImagePlugin.__version__ attributes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +*Removed in version 7.0.0.* + +The version constants of individual plugins have been removed. Use ``PIL.__version__`` +instead. + +=============================== ================================= ================================== +Deprecated Deprecated Deprecated +=============================== ================================= ================================== +``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__`` +``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__`` +``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__`` +``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__`` +``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__`` +``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__`` +``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__`` +``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__`` +``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__`` +``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__`` +``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__`` +``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__`` +=============================== ================================= ================================== + PyQt4 and PySide ~~~~~~~~~~~~~~~~ From 15ee91761bc0250fd7e43747312870d1edc929a9 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 5 Nov 2019 22:04:04 +0200 Subject: [PATCH 3/6] Remove deprecated __version__ from plugins --- docs/deprecations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deprecations.rst b/docs/deprecations.rst index db4219528..a9b534dca 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -87,7 +87,7 @@ The version constants of individual plugins have been removed. Use ``PIL.__versi instead. =============================== ================================= ================================== -Deprecated Deprecated Deprecated +Removed Removed Removed =============================== ================================= ================================== ``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__`` ``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__`` From f273da1b3ef59e16da9c075f2dc77ff46e02857e Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 5 Nov 2019 22:06:57 +0200 Subject: [PATCH 4/6] Remove deprecated __version__ from plugins --- docs/releasenotes/7.0.0.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/releasenotes/7.0.0.rst b/docs/releasenotes/7.0.0.rst index 48660b506..374a8d2dd 100644 --- a/docs/releasenotes/7.0.0.rst +++ b/docs/releasenotes/7.0.0.rst @@ -9,6 +9,29 @@ PILLOW_VERSION constant ``PILLOW_VERSION`` has been removed. Use ``__version__`` instead. +PIL.*ImagePlugin.__version__ attributes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The version constants of individual plugins have been removed. Use ``PIL.__version__`` +instead. + +=============================== ================================= ================================== +Removed Removed Removed +=============================== ================================= ================================== +``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__`` +``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__`` +``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__`` +``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__`` +``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__`` +``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__`` +``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__`` +``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__`` +``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__`` +``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__`` +``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__`` +``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__`` +=============================== ================================= ================================== + PyQt4 and PySide ^^^^^^^^^^^^^^^^ From 197fb91574310ce800419c8b7112ff4cc0cee27f Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 12 Oct 2019 11:59:03 +0100 Subject: [PATCH 5/6] upload image errors to GitHub Actions --- .github/workflows/test-windows.yml | 7 +++++++ .github/workflows/test.yml | 7 +++++++ Tests/helper.py | 18 ++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 50aff6bfe..075707bf6 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -349,6 +349,13 @@ jobs: %PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests shell: cmd + - name: Upload errors + uses: actions/upload-artifact@v1 + if: failure() + with: + name: errors + path: Tests/errors + - name: Upload coverage run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"' shell: cmd diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cab5b642a..163250248 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,13 @@ jobs: run: | .travis/test.sh + - name: Upload errors + uses: actions/upload-artifact@v1 + if: failure() + with: + name: errors + path: Tests/errors + - name: Docs if: matrix.python-version == 3.8 run: | diff --git a/Tests/helper.py b/Tests/helper.py index 93f6c6dda..57bbab0c9 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -24,12 +24,26 @@ if os.environ.get("SHOW_ERRORS", None): HAS_UPLOADER = True class test_image_results: - @classmethod - def upload(self, a, b): + @staticmethod + def upload(a, b): a.show() b.show() +elif "GITHUB_ACTIONS" in os.environ: + HAS_UPLOADER = True + + class test_image_results: + @staticmethod + def upload(a, b): + dir_errors = os.path.join(os.path.dirname(__file__), "errors") + os.makedirs(dir_errors, exist_ok=True) + tmpdir = tempfile.mkdtemp(dir=dir_errors) + a.save(os.path.join(tmpdir, "a.png")) + b.save(os.path.join(tmpdir, "b.png")) + return tmpdir + + else: try: import test_image_results From f81c829e041b14f94750434aa609ba8b9ff9354f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 18 Nov 2019 12:07:02 +0200 Subject: [PATCH 6/6] Update word order Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- src/PIL/PdfImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/PdfImagePlugin.py b/src/PIL/PdfImagePlugin.py index 18de6f5a7..d9bbf6fab 100644 --- a/src/PIL/PdfImagePlugin.py +++ b/src/PIL/PdfImagePlugin.py @@ -77,7 +77,7 @@ def _save(im, fp, filename, save_all=False): existing_pdf.start_writing() existing_pdf.write_header() - existing_pdf.write_comment("created by Pillow PDF driver " + __version__) + existing_pdf.write_comment("created by Pillow {} PDF driver".format(__version__)) # # pages