diff --git a/.appveyor.yml b/.appveyor.yml index 667e6322d..9c6bedee3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,6 +13,7 @@ environment: TEST_OPTIONS: DEPLOY: YES matrix: + - PYTHON: C:\Python38rc1-x64 - PYTHON: C:/Python37 - PYTHON: C:/Python37-x64 - PYTHON: C:/Python36 @@ -28,7 +29,6 @@ environment: EXECUTABLE: bin/pypy.exe PIP_DIR: bin VENV: YES - - PYTHON: C:\Python38rc1-x64 install: diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index ca04afe02..e0e6804bf 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -tidelift: pypi/pillow +tidelift: "pypi/Pillow" diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh index 473a1695e..78eac6162 100755 --- a/.github/workflows/macos-install.sh +++ b/.github/workflows/macos-install.sh @@ -2,8 +2,6 @@ set -e -sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / - brew install libtiff libjpeg webp little-cms2 PYTHONOPTIMIZE=0 pip install cffi diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 2c80090fb..0e368a7c6 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -58,6 +58,7 @@ jobs: run: | "%pythonLocation%\python.exe" -m pip install wheel pytest pytest-cov pip install codecov + shell: cmd - name: Fetch dependencies run: | @@ -96,6 +97,7 @@ jobs: copy /Y /B j*.h %INCLIB% copy /Y /B *.lib %INCLIB% copy /Y /B *.exe %INCLIB% + shell: cmd - name: Build dependencies / libjpeg-turbo run: | @@ -114,6 +116,7 @@ jobs: copy /Y /B jpeg-static.lib %INCLIB%\libjpeg.lib copy /Y /B cjpeg-static.exe %INCLIB%\cjpeg.exe copy /Y /B djpeg-static.exe %INCLIB%\djpeg.exe + shell: cmd - name: Build dependencies / zlib run: | @@ -128,6 +131,7 @@ jobs: copy /Y /B z*.h %INCLIB% copy /Y /B *.lib %INCLIB% copy /Y /B zlib.lib %INCLIB%\z.lib + shell: cmd - name: Build dependencies / LibTIFF run: | @@ -143,6 +147,7 @@ jobs: copy /Y /B libtiff\tiff*.h %INCLIB% copy /Y /B libtiff\*.dll %INCLIB% copy /Y /B libtiff\*.lib %INCLIB% + shell: cmd - name: Build dependencies / WebP run: | @@ -157,6 +162,7 @@ jobs: mkdir %INCLIB%\webp copy /Y /B src\webp\*.h %INCLIB%\webp copy /Y /B output\release-static\${{ matrix.architecture }}\lib\* %INCLIB% + shell: cmd - name: Build dependencies / FreeType run: | @@ -176,6 +182,7 @@ jobs: %MSBUILD% builds\windows\vc2010\freetype.sln /t:Build /p:Configuration="Release Static" /p:Platform=${{ matrix.platform-msbuild }} /m xcopy /Y /E /Q include %INCLIB% copy /Y /B "objs\${{ matrix.platform-msbuild }}\Release Static\freetype.lib" %INCLIB% + shell: cmd - name: Build dependencies / LCMS2 run: | @@ -193,6 +200,7 @@ jobs: %MSBUILD% Projects\VC2015\lcms2.sln /t:Clean;lcms2_static /p:Configuration="Release" /p:Platform=${{ matrix.platform-msbuild }} /m xcopy /Y /E /Q include %INCLIB% copy /Y /B Lib\MS\*.lib %INCLIB% + shell: cmd - name: Build dependencies / OpenJPEG run: | @@ -211,6 +219,7 @@ jobs: mkdir %INCLIB%\openjpeg-2.3.1 copy /Y /B src\lib\openjp2\*.h %INCLIB%\openjpeg-2.3.1 copy /Y /B bin\*.lib %INCLIB% + shell: cmd # GPL licensed; skip if building wheels - name: Build dependencies / libimagequant @@ -233,6 +242,7 @@ jobs: nmake -nologo -f Makefile copy /Y /B *.h %INCLIB% copy /Y /B *.lib %INCLIB% + shell: cmd # for Raqm - name: Build dependencies / HarfBuzz @@ -253,6 +263,7 @@ jobs: nmake -nologo -f Makefile harfbuzz copy /Y /B src\*.h %INCLIB% copy /Y /B *.lib %INCLIB% + shell: cmd # for Raqm - name: Build dependencies / FriBidi @@ -272,6 +283,7 @@ jobs: nmake -nologo -f Makefile fribidi copy /Y /B lib\*.h %INCLIB% copy /Y /B *.lib %INCLIB% + shell: cmd # failing with PyPy3 - name: Build dependencies / Raqm @@ -293,6 +305,7 @@ jobs: nmake -nologo -f Makefile libraqm copy /Y /B src\*.h %INCLIB% copy /Y /B libraqm.dll %INCLIB% + shell: cmd - name: Build dependencies / ghostscript run: | @@ -308,6 +321,7 @@ jobs: nmake -nologo -f psi\msvc.mak rem Add bin to PATH variable: Copy to INCLIB, then add INCLIB to PATH in Test step. copy /Y /B bin\* %INCLIB% + shell: cmd - name: Build Pillow run: | @@ -323,6 +337,7 @@ jobs: rem Add GhostScript and Raqm binaries (copied to INCLIB) to PATH. path %INCLIB%;%PATH% %PYTHON%\python.exe selftest.py --installed + shell: cmd - name: Test Pillow run: | @@ -332,9 +347,11 @@ jobs: path %INCLIB%;%PATH% cd /D %GITHUB_WORKSPACE% %PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests + shell: cmd - name: Upload coverage run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"' + shell: cmd - name: Build wheel id: wheel @@ -351,6 +368,7 @@ jobs: set INCLUDE=%INCLIB%;%GITHUB_WORKSPACE%\depends\tcl86\include;%INCLUDE% call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" ${{ matrix.platform-vcvars }} 8.1 %PYTHON%\python.exe setup.py bdist_wheel + shell: cmd - uses: actions/upload-artifact@v1 if: "github.event_name == 'push' && !contains(matrix.python-version, 'pypy')" diff --git a/.travis.yml b/.travis.yml index b8be9755d..5160d3ec7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ matrix: env: LINT="true" - python: "pypy3" name: "PyPy3 Xenial" + - python: "3.8" + name: "3.8 Xenial" + services: xvfb - python: '3.7' name: "3.7 Xenial" services: xvfb @@ -29,9 +32,6 @@ matrix: name: "3.5 Xenial PYTHONOPTIMIZE=2" env: PYTHONOPTIMIZE=2 services: xvfb - - python: "3.8-dev" - name: "3.8-dev Xenial" - services: xvfb - env: DOCKER="alpine" DOCKER_TAG="master" - env: DOCKER="arch" DOCKER_TAG="master" # contains PyQt5 - env: DOCKER="ubuntu-16.04-xenial-amd64" DOCKER_TAG="master" diff --git a/.travis/build.sh b/.travis/build.sh index 3b286076f..a2e3041bd 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -3,5 +3,8 @@ set -e coverage erase +if [ $(uname) == "Darwin" ]; then + export CPPFLAGS="-I/usr/local/miniconda/include"; +fi make clean make install-coverage diff --git a/CHANGES.rst b/CHANGES.rst index d4b9170d9..3a0bb1c1d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,11 +20,17 @@ Changelog (Pillow) - Changed default frombuffer raw decoder args #1730 [radarhere] -6.2.0 (2019-10-01) +6.2.1 (2019-10-21) ------------------ - This is the last Pillow release to support Python 2.7 #3642 +- Add support for Python 3.8 #4141 + [hugovk] + +6.2.0 (2019-10-01) +------------------ + - Catch buffer overruns #4104 [radarhere] diff --git a/README.rst b/README.rst index e35091bae..b8cad5e9d 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Pillow is the friendly PIL fork by `Alex Clark and Contributors = 7.0.0 | | | | | | | | Yes | Yes | Yes | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|**Python** |**2.4**|**2.5**|**2.6**|**2.7**|**3.2**|**3.3**|**3.4**|**3.5**|**3.6**|**3.7**|**3.8**| ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow < 2 | Yes | Yes | Yes | Yes | | | | | | | | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow 2 - 3 | | | Yes | Yes | Yes | Yes | Yes | Yes | | | | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow 4 | | | | Yes | | Yes | Yes | Yes | Yes | | | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow 5.0 - 5.1 | | | | Yes | | | Yes | Yes | Yes | | | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow 5.2 - 5.4 | | | | Yes | | | Yes | Yes | Yes | Yes | | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow 6.0 - 6.2.0 | | | | Yes | | | | Yes | Yes | Yes | | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow 6.2.1 | | | | Yes | | | | Yes | Yes | Yes | Yes | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ +|Pillow >= 7 | | | | | | | | Yes | Yes | Yes | Yes | ++-------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ Basic Installation ------------------ @@ -402,12 +404,12 @@ These platforms are built and tested for every change. +----------------------------------+-------------------------------+-----------------------+ | Fedora 30 | 2.7, 3.7 |x86-64 | +----------------------------------+-------------------------------+-----------------------+ -| macOS 10.13 High Sierra* | 2.7, 3.5, 3.6, 3.7 |x86-64 | +| macOS 10.13 High Sierra* | 2.7, 3.5, 3.6, 3.7, 3.8 |x86-64 | +----------------------------------+-------------------------------+-----------------------+ -| Ubuntu Linux 16.04 LTS | 2.7, 3.5, 3.6, 3.7, |x86-64 | +| Ubuntu Linux 16.04 LTS | 2.7, 3.5, 3.6, 3.7, 3.8, |x86-64 | | | PyPy, PyPy3 | | +----------------------------------+-------------------------------+-----------------------+ -| Windows Server 2012 R2 | 2.7, 3.5, 3.6, 3.7 |x86, x86-64 | +| Windows Server 2012 R2 | 2.7, 3.5, 3.6, 3.7, 3.8 |x86, x86-64 | | +-------------------------------+-----------------------+ | | PyPy, 3.7/MinGW |x86 | +----------------------------------+-------------------------------+-----------------------+ diff --git a/docs/releasenotes/6.2.0.rst b/docs/releasenotes/6.2.0.rst index 9576e6be8..c31ade197 100644 --- a/docs/releasenotes/6.2.0.rst +++ b/docs/releasenotes/6.2.0.rst @@ -62,14 +62,6 @@ shared instance of ``Image.Exif``. Deprecations ^^^^^^^^^^^^ -Python 2.7 -~~~~~~~~~~ - -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.2.x the last release series to support Python 2. - Image.frombuffer ~~~~~~~~~~~~~~~~ diff --git a/docs/releasenotes/6.2.1.rst b/docs/releasenotes/6.2.1.rst new file mode 100644 index 000000000..ca298fa70 --- /dev/null +++ b/docs/releasenotes/6.2.1.rst @@ -0,0 +1,26 @@ +6.2.1 +----- + +API Changes +=========== + +Deprecations +^^^^^^^^^^^^ + +Python 2.7 +~~~~~~~~~~ + +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.2.x the last release series to support Python 2. + +Other Changes +============= + + + +Support added for Python 3.8 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Pillow 6.2.1 supports Python 3.8. diff --git a/docs/releasenotes/index.rst b/docs/releasenotes/index.rst index 76c0321e7..381643cf3 100644 --- a/docs/releasenotes/index.rst +++ b/docs/releasenotes/index.rst @@ -6,6 +6,7 @@ Release Notes .. toctree:: :maxdepth: 2 + 6.2.1 6.2.0 6.1.0 6.0.0 diff --git a/setup.py b/setup.py index ff68b1e8b..029b80f03 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ from distutils.command.build_ext import build_ext from setuptools import Extension, setup -if sys.platform == "win32" and sys.version_info >= (3, 8): +if sys.platform == "win32" and sys.version_info >= (3, 9): warnings.warn( "Pillow does not yet support Python {}.{} and does not yet provide " "prebuilt Windows binaries. We do not recommend building from " @@ -862,6 +862,7 @@ try: "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", diff --git a/src/PIL/BdfFontFile.py b/src/PIL/BdfFontFile.py index 13c79b460..7a485cf80 100644 --- a/src/PIL/BdfFontFile.py +++ b/src/PIL/BdfFontFile.py @@ -84,8 +84,7 @@ def bdf_char(f): class BdfFontFile(FontFile.FontFile): def __init__(self, fp): - - FontFile.FontFile.__init__(self) + super().__init__() s = fp.readline() if s[:13] != b"STARTFONT 2.1": diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 354159703..2a2da6bfa 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -78,7 +78,7 @@ class ImageFile(Image.Image): "Base class for image file format handlers." def __init__(self, fp=None, filename=None): - Image.Image.__init__(self) + super().__init__() self._min_frame = 0 diff --git a/src/PIL/ImageQt.py b/src/PIL/ImageQt.py index f19ad3df9..dfe2f80bd 100644 --- a/src/PIL/ImageQt.py +++ b/src/PIL/ImageQt.py @@ -173,8 +173,7 @@ if qt_is_installed: # buffer, so this buffer has to hang on for the life of the image. # Fixes https://github.com/python-pillow/Pillow/issues/1370 self.__data = im_data["data"] - QImage.__init__( - self, + super().__init__( self.__data, im_data["im"].size[0], im_data["im"].size[1], diff --git a/src/PIL/ImageTk.py b/src/PIL/ImageTk.py index 31615b838..ee707cffb 100644 --- a/src/PIL/ImageTk.py +++ b/src/PIL/ImageTk.py @@ -290,7 +290,7 @@ def _show(image, title): self.image = BitmapImage(im, foreground="white", master=master) else: self.image = PhotoImage(im, master=master) - tkinter.Label.__init__(self, master, image=self.image, bg="black", bd=0) + super().__init__(master, image=self.image, bg="black", bd=0) if not tkinter._default_root: raise OSError("tkinter not initialized") diff --git a/src/PIL/ImageWin.py b/src/PIL/ImageWin.py index c04e70eb5..927b1694b 100644 --- a/src/PIL/ImageWin.py +++ b/src/PIL/ImageWin.py @@ -224,7 +224,7 @@ class ImageWindow(Window): image = Dib(image) self.image = image width, height = image.size - Window.__init__(self, title, width=width, height=height) + super().__init__(title, width=width, height=height) def ui_handle_repair(self, dc, x0, y0, x1, y1): self.image.draw(dc, (x0, y0, x1, y1)) diff --git a/src/PIL/PcfFontFile.py b/src/PIL/PcfFontFile.py index 63735cecb..605cbbdf3 100644 --- a/src/PIL/PcfFontFile.py +++ b/src/PIL/PcfFontFile.py @@ -62,7 +62,7 @@ class PcfFontFile(FontFile.FontFile): if magic != PCF_MAGIC: raise SyntaxError("not a PCF file") - FontFile.FontFile.__init__(self) + super().__init__() count = l32(fp.read(4)) self.toc = {} diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 49e0c358f..b8c2be454 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -292,8 +292,7 @@ class PngInfo: class PngStream(ChunkStream): def __init__(self, fp): - - ChunkStream.__init__(self, fp) + super().__init__(fp) # local copies of Image attributes self.im_info = {} diff --git a/src/PIL/TarIO.py b/src/PIL/TarIO.py index 06769846e..cf3df4861 100644 --- a/src/PIL/TarIO.py +++ b/src/PIL/TarIO.py @@ -54,7 +54,7 @@ class TarIO(ContainerIO.ContainerIO): self.fh.seek((size + 511) & (~511), io.SEEK_CUR) # Open region - ContainerIO.ContainerIO.__init__(self, self.fh, self.fh.tell(), size) + super().__init__(self.fh, self.fh.tell(), size) # Context manager support def __enter__(self): diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index a6fa412ca..04b87a57d 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -884,7 +884,7 @@ class ImageFileDirectory_v1(ImageFileDirectory_v2): """ def __init__(self, *args, **kwargs): - ImageFileDirectory_v2.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs) self._legacy_api = True tags = property(lambda self: self._tags_v1) diff --git a/tox.ini b/tox.ini index 560291577..0bf833b81 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ [tox] envlist = lint - py{35,36,37,py3} + py{35,36,37,38,py3} minversion = 1.9 [testenv]