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

Remove deprecated __version__ from plugins #4197

Merged
merged 5 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 25 additions & 25 deletions docs/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -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.

=============================== ================================= ==================================
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
~~~~~~~~~~~~~~~~

Expand Down
23 changes: 23 additions & 0 deletions docs/releasenotes/7.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/BmpImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/PIL/CurImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
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"

#
# --------------------------------------------------------------------

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/DcxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
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?


Expand Down
4 changes: 0 additions & 4 deletions src/PIL/EpsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
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"

#
# --------------------------------------------------------------------

Expand Down
5 changes: 0 additions & 5 deletions src/PIL/FliImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/FpxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
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
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/GdImageFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <b>Image.open</b> function. To use
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/GifImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
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

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/IcoImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
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"

#
# --------------------------------------------------------------------

Expand Down
5 changes: 0 additions & 5 deletions src/PIL/ImImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
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

Expand Down
5 changes: 0 additions & 5 deletions src/PIL/ImtImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

from . import Image, ImageFile

# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.2"


#
# --------------------------------------------------------------------

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/IptcImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
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
Expand Down
4 changes: 0 additions & 4 deletions src/PIL/Jpeg2KImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

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
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/JpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
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

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/McIdasImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@

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"
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/MicImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@

from . import Image, TiffImagePlugin

# __version__ is deprecated and will be removed in a future version. Use
# PIL.__version__ instead.
__version__ = "0.1"


#
# --------------------------------------------------------------------

Expand Down
5 changes: 0 additions & 5 deletions src/PIL/MpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/MpoImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/MspImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
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

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/PalmImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/PcdImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/PIL/PcxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@

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]
Expand Down
9 changes: 2 additions & 7 deletions src/PIL/PdfImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@
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__

#
# --------------------------------------------------------------------
Expand Down Expand Up @@ -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__)
hugovk marked this conversation as resolved.
Show resolved Hide resolved

#
# pages
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/PixarImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions src/PIL/PngImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
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
Expand Down