From 8cdacf8871da5ddbb4505882085d985a8ab65f0e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 12 Oct 2019 21:38:01 +1100 Subject: [PATCH 01/16] Added GitHub Actions badges for platform builds [ci skip] --- README.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e35091bae..e006f5bc7 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Pillow is the friendly PIL fork by `Alex Clark and Contributors Date: Sat, 12 Oct 2019 21:53:49 +1100 Subject: [PATCH 02/16] Rearranged badges [ci skip] Co-Authored-By: Hugo van Kemenade --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e006f5bc7..b8cad5e9d 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Pillow is the friendly PIL fork by `Alex Clark and Contributors Date: Sat, 12 Oct 2019 10:39:21 -0700 Subject: [PATCH 03/16] Simpilify PillowTestCase.delete_tempfile for pytest As the test suite always runs with pytest now, self.currentResult is always None. Using this, can remove unused code. --- Tests/helper.py | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/Tests/helper.py b/Tests/helper.py index 466d04bda..3de828c3b 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -53,29 +53,11 @@ def convert_to_comparable(a, b): class PillowTestCase(unittest.TestCase): - def __init__(self, *args, **kwargs): - unittest.TestCase.__init__(self, *args, **kwargs) - # holds last result object passed to run method: - self.currentResult = None - - def run(self, result=None): - self.currentResult = result # remember result for use later - unittest.TestCase.run(self, result) # call superclass run method - def delete_tempfile(self, path): try: - ok = self.currentResult.wasSuccessful() - except AttributeError: # for pytest - ok = True - - if ok: - # only clean out tempfiles if test passed - try: - os.remove(path) - except OSError: - pass # report? - else: - print("=== orphaned temp file: %s" % path) + os.remove(path) + except OSError: + pass # report? def assert_deep_equal(self, a, b, msg=None): try: From 2ab518edcb0bde133b9306d14e99fa51908fd91c Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 15 Oct 2019 12:44:21 +0300 Subject: [PATCH 04/16] Add support for Python 3.8 --- .appveyor.yml | 2 +- .travis.yml | 6 +++--- docs/installation.rst | 40 +++++++++++++++++++++------------------- setup.py | 3 ++- tox.ini | 2 +- 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index a8562378a..afb0bcb69 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/.travis.yml b/.travis.yml index 2d0f7ed40..0966547a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ matrix: env: LINT="true" - python: "pypy3" name: "PyPy3 Xenial" + - python: "3.8-dev" + name: "3.8-dev 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/docs/installation.rst b/docs/installation.rst index 35547cb55..0e7532845 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -15,23 +15,25 @@ Notes .. note:: Pillow is supported on the following Python versions -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|**Python** |**2.4**|**2.5**|**2.6**|**2.7**|**3.2**|**3.3**|**3.4**|**3.5**|**3.6**|**3.7**| -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow < 2.0.0 | Yes | Yes | Yes | Yes | | | | | | | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow 2.x - 3.x | | | Yes | Yes | Yes | Yes | Yes | Yes | | | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow 4.x | | | | Yes | | Yes | Yes | Yes | Yes | | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow 5.0.x - 5.1.x | | | | Yes | | | Yes | Yes | Yes | | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow 5.2.x - 5.4.x | | | | Yes | | | Yes | Yes | Yes | Yes | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow 6.x | | | | Yes | | | | Yes | Yes | Yes | -+---------------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ -|Pillow >= 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 ------------------ @@ -405,10 +407,10 @@ These platforms are built and tested for every change. +----------------------------------+-------------------------------+-----------------------+ | macOS 10.13 High Sierra* | 2.7, 3.5, 3.6, 3.7 |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/setup.py b/setup.py index 76bdfb159..d54e30dfa 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ from setuptools import Extension, setup # comment this out to disable multi threaded builds. import mp_compile -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 " @@ -867,6 +867,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 :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Multimedia :: Graphics", diff --git a/tox.ini b/tox.ini index 5fee6dbb9..3da68ba7b 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ [tox] envlist = lint - py{27,35,36,37,py3} + py{27,35,36,37,38,py3} minversion = 1.9 [testenv] From fd4707d9d3a6616107433715f3f7357ea6436080 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 15 Oct 2019 20:57:29 +0300 Subject: [PATCH 05/16] Test on Python 3.8 final --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0966547a0..70833de17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,8 @@ matrix: env: LINT="true" - python: "pypy3" name: "PyPy3 Xenial" - - python: "3.8-dev" - name: "3.8-dev Xenial" + - python: "3.8" + name: "3.8 Xenial" services: xvfb - python: '3.7' name: "3.7 Xenial" From 062c4013a48e9442060f8fda259051aa5b145bcb Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 15 Oct 2019 23:02:43 +0300 Subject: [PATCH 06/16] Consistent slash --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index afb0bcb69..5352e9c73 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -13,7 +13,7 @@ environment: TEST_OPTIONS: DEPLOY: YES matrix: - - PYTHON: C:/Python38rc1-x64 + - PYTHON: C:\Python38rc1-x64 - PYTHON: C:/Python37 - PYTHON: C:/Python37-x64 - PYTHON: C:/Python36 From 2b862103086f86fb144d4ff44d75ed13acb57f06 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 19 Oct 2019 09:58:13 +0300 Subject: [PATCH 07/16] Quotes and caps To exactly match the recommend text at https://tidelift.com/lifter/package/pypi/Pillow/tasks/2439 and hopefully mark the task as done. --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From aaf9720c58c5df5dfe46294acde21bdca27c1b33 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 20 Oct 2019 21:00:26 +1100 Subject: [PATCH 08/16] Updated CI target Python versions for macOS [ci skip] --- docs/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index 0e7532845..13333e465 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -405,7 +405,7 @@ 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, 3.8, |x86-64 | | | PyPy, PyPy3 | | From 1bbacf94750f7f486f6c8231b92c55d6937b9466 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 20 Oct 2019 16:13:07 +0300 Subject: [PATCH 09/16] Update CHANGES.rst [CI skip] --- CHANGES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index d4b9170d9..d86f60210 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,6 +20,12 @@ Changelog (Pillow) - Changed default frombuffer raw decoder args #1730 [radarhere] +6.2.1 (unreleased) +------------------ + +- Add support for Python 3.8 #4141 + [hugovk] + 6.2.0 (2019-10-01) ------------------ From 6f3464e1cbf52f1313ca97a5f327036ef809836c Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 20 Oct 2019 16:31:09 +0300 Subject: [PATCH 10/16] Add release notes for Pillow 6.2.1 --- docs/releasenotes/6.2.1.rst | 7 +++++++ docs/releasenotes/index.rst | 1 + 2 files changed, 8 insertions(+) create mode 100644 docs/releasenotes/6.2.1.rst diff --git a/docs/releasenotes/6.2.1.rst b/docs/releasenotes/6.2.1.rst new file mode 100644 index 000000000..2c77fc44a --- /dev/null +++ b/docs/releasenotes/6.2.1.rst @@ -0,0 +1,7 @@ +6.2.1 +----- + +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 From a80a45219f119717b5589673d3bf50944f31b030 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 20 Oct 2019 23:06:22 +0300 Subject: [PATCH 11/16] Pillow 6.2.1 is the last to support Python 2.7 --- CHANGES.rst | 6 +++--- docs/releasenotes/6.2.0.rst | 8 -------- docs/releasenotes/6.2.1.rst | 21 ++++++++++++++++++++- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index d86f60210..1e878c229 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,17 +20,17 @@ Changelog (Pillow) - Changed default frombuffer raw decoder args #1730 [radarhere] -6.2.1 (unreleased) +6.2.1 (2019-10-20) ------------------ +- 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) ------------------ -- This is the last Pillow release to support Python 2.7 #3642 - - Catch buffer overruns #4104 [radarhere] 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 index 2c77fc44a..ca298fa70 100644 --- a/docs/releasenotes/6.2.1.rst +++ b/docs/releasenotes/6.2.1.rst @@ -1,7 +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. From d8003c350f892c7e2392eef71b1aafa604c60a12 Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 21 Oct 2019 21:57:59 +0300 Subject: [PATCH 12/16] Add a check for point releases --- RELEASING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASING.md b/RELEASING.md index feeb7c0d7..9614b133f 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -51,6 +51,7 @@ Released as needed for security, installation or critical bug fixes. make sdist ``` * [ ] Create [binary distributions](https://github.com/python-pillow/Pillow/blob/master/RELEASING.md#binary-distributions) +* [ ] Upload all binaries and source distributions e.g. `twine upload dist/Pillow-5.2.1*` * [ ] Create a [new release on GitHub](https://github.com/python-pillow/Pillow/releases/new) ## Embargoed Release From 41a77fcf27d22e0a0cc8543e0e3a4832ec0e8e1c Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 22 Oct 2019 20:17:47 +1100 Subject: [PATCH 13/16] Updated 6.2.1 release date [ci skip] --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1e878c229..3a0bb1c1d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,7 +20,7 @@ Changelog (Pillow) - Changed default frombuffer raw decoder args #1730 [radarhere] -6.2.1 (2019-10-20) +6.2.1 (2019-10-21) ------------------ - This is the last Pillow release to support Python 2.7 #3642 From cae17eb927a82c89ce096c07a3ec08cc6239872a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 5 Nov 2016 10:31:11 -0700 Subject: [PATCH 14/16] Use more Pythonic super() instead of referencing parent class https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ --- Tests/test_imageqt.py | 4 ++-- src/PIL/BdfFontFile.py | 3 +-- src/PIL/ImageFile.py | 2 +- src/PIL/ImageQt.py | 3 +-- src/PIL/ImageTk.py | 2 +- src/PIL/ImageWin.py | 2 +- src/PIL/PcfFontFile.py | 2 +- src/PIL/PngImagePlugin.py | 3 +-- src/PIL/TarIO.py | 2 +- src/PIL/TiffImagePlugin.py | 2 +- 10 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Tests/test_imageqt.py b/Tests/test_imageqt.py index 9248291c3..5cf14adda 100644 --- a/Tests/test_imageqt.py +++ b/Tests/test_imageqt.py @@ -25,7 +25,7 @@ class PillowQtTestCase(object): class PillowQPixmapTestCase(PillowQtTestCase): def setUp(self): - PillowQtTestCase.setUp(self) + super().setUp() try: if ImageQt.qt_version == "5": from PyQt5.QtGui import QGuiApplication @@ -37,7 +37,7 @@ class PillowQPixmapTestCase(PillowQtTestCase): self.app = QGuiApplication([]) def tearDown(self): - PillowQtTestCase.tearDown(self) + super().tearDown() self.app.quit() diff --git a/src/PIL/BdfFontFile.py b/src/PIL/BdfFontFile.py index fdf2c097e..53a890fb6 100644 --- a/src/PIL/BdfFontFile.py +++ b/src/PIL/BdfFontFile.py @@ -85,8 +85,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 836e6318c..a275f95d2 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 da60cacd0..f49725b5f 100644 --- a/src/PIL/ImageQt.py +++ b/src/PIL/ImageQt.py @@ -180,8 +180,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 fd480007a..bb825f353 100644 --- a/src/PIL/ImageTk.py +++ b/src/PIL/ImageTk.py @@ -296,7 +296,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 IOError("tkinter not initialized") diff --git a/src/PIL/ImageWin.py b/src/PIL/ImageWin.py index ed2c18ec4..c654569c5 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 074124612..7b3075696 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 be237b3ee..84317ceb7 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -293,8 +293,7 @@ class PngInfo(object): 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 e180b802c..92a08aefb 100644 --- a/src/PIL/TarIO.py +++ b/src/PIL/TarIO.py @@ -55,7 +55,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 b0d465fe2..455fbd0ee 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -911,7 +911,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) From 3443c3679531d15b8fea338e9db68dd8f0a3ca6b Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 25 Oct 2019 14:16:51 +0300 Subject: [PATCH 15/16] Explicitly use cmd shell, as GHA changed the default to powershell --- .github/workflows/test-windows.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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')" From 720a1738facdda36815e6659a9117a4c96e603e9 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 26 Oct 2019 09:58:47 +1100 Subject: [PATCH 16/16] Replaced macOS Command Line Tools install with miniconda path --- .github/workflows/macos-install.sh | 2 -- .travis/build.sh | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) 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/.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