From b9e81de53c16285901447953e0ea7e1db39e78b1 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Mon, 18 Jul 2022 07:46:35 +0000 Subject: [PATCH 01/13] Fix setuptools --- recipe/fix_setuptools_on_win_py37_py38.patch | 32 ++++++++++++++++++++ recipe/meta.yaml | 19 ++++++------ 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 recipe/fix_setuptools_on_win_py37_py38.patch diff --git a/recipe/fix_setuptools_on_win_py37_py38.patch b/recipe/fix_setuptools_on_win_py37_py38.patch new file mode 100644 index 0000000..b8292c4 --- /dev/null +++ b/recipe/fix_setuptools_on_win_py37_py38.patch @@ -0,0 +1,32 @@ +From 08db23c61cce62b19a3b68bf2acf8cdfb8f668fb Mon Sep 17 00:00:00 2001 +From: Andrew Murray +Date: Mon, 18 Jul 2022 16:16:06 +1000 +Subject: [PATCH] Do not quote Pillow version for setuptools >= 60 + +--- + setup.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 71e853dcee..37477216d3 100755 +--- a/setup.py ++++ b/setup.py +@@ -15,7 +15,9 @@ + import sys + import warnings + +-from setuptools import Extension, setup ++from setuptools import Extension ++from setuptools import __version__ as setuptools_version ++from setuptools import setup + from setuptools.command.build_ext import build_ext + + +@@ -850,6 +852,7 @@ def build_extensions(self): + sys.platform == "win32" + and sys.version_info < (3, 9) + and not (PLATFORM_PYPY or PLATFORM_MINGW) ++ and int(setuptools_version.split(".")[0]) < 60 + ): + defs.append(("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""')) + else: \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bf28f58..5d0a2bc 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,9 +10,15 @@ source: sha256: 75e636fd3e0fb872693f23ccb8a5ff2cd578801251f3a4f6854c6a5d437d3c04 patches: - disable_detect.patch # [unix] + # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: + # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. + # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7, + # Looking at the conda-build changelog for v3.21.9, it was noticed some changes to support the new setuptools >=60.0 + # Check if the issue persists in the next releases + - fix_setuptools_on_win_py37_py38.patch # [win and (py==37 or py==38)] build: - number: 1 + number: 2 skip: true # [py<37] ignore_run_exports: - tk @@ -27,16 +33,11 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - patch # [unix] + - m2-patch # [win] host: - python - - pip - # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: - # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. - # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7, - # Looking at the conda-build changelog for v3.21.9, it was noticed some changes to support the new setuptools >=60.0 - # Check if the issue persists in the next releases - - setuptools <60 # [win and (py==37 or py==38)] - - setuptools # [not (win and (py==37 or py==38))] + - pip + - setuptools - wheel # Required by default - jpeg From 945ee1677f1acb4c28b8154e9c2dac11926f362b Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Wed, 14 Dec 2022 15:52:36 -0700 Subject: [PATCH 02/13] Update version and sha256 --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5d0a2bc..f3adca1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "pillow" %} -{% set version = "9.2.0" %} +{% set version = "9.3.0" %} package: name: {{ name|lower }} @@ -7,7 +7,7 @@ package: source: url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/Pillow-{{ version }}.tar.gz - sha256: 75e636fd3e0fb872693f23ccb8a5ff2cd578801251f3a4f6854c6a5d437d3c04 + sha256: c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f patches: - disable_detect.patch # [unix] # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: From 9c6746448490c4a2368d9f50a3870376edf577bb Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Wed, 14 Dec 2022 15:55:33 -0700 Subject: [PATCH 03/13] reset build number --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f3adca1..821da2b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,7 +18,7 @@ source: - fix_setuptools_on_win_py37_py38.patch # [win and (py==37 or py==38)] build: - number: 2 + number: 0 skip: true # [py<37] ignore_run_exports: - tk From 6064dac0d12b5b268a90c9f24804a33ff9ed1c48 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Wed, 14 Dec 2022 16:08:46 -0700 Subject: [PATCH 04/13] Remove setuptools fix patch --- recipe/meta.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 821da2b..4269f0a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,13 +10,7 @@ source: sha256: c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f patches: - disable_detect.patch # [unix] - # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: - # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. - # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7, - # Looking at the conda-build changelog for v3.21.9, it was noticed some changes to support the new setuptools >=60.0 - # Check if the issue persists in the next releases - - fix_setuptools_on_win_py37_py38.patch # [win and (py==37 or py==38)] - + build: number: 0 skip: true # [py<37] From ffa2eee747ad61eb35444f42597f2de0c32c0fd4 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Wed, 14 Dec 2022 16:15:45 -0700 Subject: [PATCH 05/13] Delete patch file --- recipe/fix_setuptools_on_win_py37_py38.patch | 32 -------------------- 1 file changed, 32 deletions(-) delete mode 100644 recipe/fix_setuptools_on_win_py37_py38.patch diff --git a/recipe/fix_setuptools_on_win_py37_py38.patch b/recipe/fix_setuptools_on_win_py37_py38.patch deleted file mode 100644 index b8292c4..0000000 --- a/recipe/fix_setuptools_on_win_py37_py38.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 08db23c61cce62b19a3b68bf2acf8cdfb8f668fb Mon Sep 17 00:00:00 2001 -From: Andrew Murray -Date: Mon, 18 Jul 2022 16:16:06 +1000 -Subject: [PATCH] Do not quote Pillow version for setuptools >= 60 - ---- - setup.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 71e853dcee..37477216d3 100755 ---- a/setup.py -+++ b/setup.py -@@ -15,7 +15,9 @@ - import sys - import warnings - --from setuptools import Extension, setup -+from setuptools import Extension -+from setuptools import __version__ as setuptools_version -+from setuptools import setup - from setuptools.command.build_ext import build_ext - - -@@ -850,6 +852,7 @@ def build_extensions(self): - sys.platform == "win32" - and sys.version_info < (3, 9) - and not (PLATFORM_PYPY or PLATFORM_MINGW) -+ and int(setuptools_version.split(".")[0]) < 60 - ): - defs.append(("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""')) - else: \ No newline at end of file From bfd77cfa53996ce4261ab8b76f33d3ed1bcbcc78 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Wed, 14 Dec 2022 16:17:37 -0700 Subject: [PATCH 06/13] Update doc_url --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4269f0a..5c08aae 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -74,7 +74,7 @@ about: description: | Pillow is the friendly PIL fork. PIL is the Python Imaging Library, adds image processing capabilities to your Python interpreter. - doc_url: https://pillow.readthedocs.io/en/4.2.x/ + doc_url: https://pillow.readthedocs.io/ doc_source_url: https://github.com/python-pillow/Pillow/blob/4.2.x/docs/index.rst dev_url: https://github.com/python-pillow/Pillow From f667f651a27d9853d252064e2a5d9b3816d80b56 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Wed, 14 Dec 2022 16:36:37 -0700 Subject: [PATCH 07/13] Disable PIL.Image import on Win --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5c08aae..106f720 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -58,7 +58,7 @@ requirements: test: imports: - PIL - - PIL.Image + - PIL.Image # [not win] - PIL.ImageCms # [not win] requires: - pip From d33b732782eb9b545d8ec71725b3c9c0fa6d85db Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Fri, 16 Dec 2022 08:44:43 -0700 Subject: [PATCH 08/13] revert last commit --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 106f720..5c08aae 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -58,7 +58,7 @@ requirements: test: imports: - PIL - - PIL.Image # [not win] + - PIL.Image - PIL.ImageCms # [not win] requires: - pip From 8f512c0e9608398c231c19e0fc65be0da39b93fb Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Fri, 16 Dec 2022 09:50:38 -0700 Subject: [PATCH 09/13] Add patch to fix windows mismatch --- recipe/meta.yaml | 1 + recipe/win_imaging_version_fix.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 recipe/win_imaging_version_fix.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5c08aae..db6c961 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,6 +10,7 @@ source: sha256: c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f patches: - disable_detect.patch # [unix] + - win_imaging_version_fix.patch # [win] build: number: 0 diff --git a/recipe/win_imaging_version_fix.patch b/recipe/win_imaging_version_fix.patch new file mode 100644 index 0000000..01d3b3a --- /dev/null +++ b/recipe/win_imaging_version_fix.patch @@ -0,0 +1,13 @@ +diff --git a/src/PIL/Image.py b/src/PIL/Image.py +index c2216e27a..0992fb528 100644 +--- a/src/PIL/Image.py ++++ b/src/PIL/Image.py +@@ -106,7 +106,7 @@ try: + # and should be considered private and subject to change. + from . import _imaging as core + +- if __version__ != getattr(core, "PILLOW_VERSION", None): ++ if __version__ != getattr(core, "PILLOW_VERSION", None).strip('"'): + raise ImportError( + "The _imaging extension was built for another version of Pillow or PIL:\n" + f"Core version: {getattr(core, 'PILLOW_VERSION', None)}\n" From 38dc63f14f66940ec0f4296ec06feba5e7951400 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Fri, 16 Dec 2022 10:54:36 -0700 Subject: [PATCH 10/13] Swap back to previous win setuptools patch --- recipe/fix_setuptools_on_win_py37_py38.patch | 23 ++++++++++++++++++++ recipe/meta.yaml | 7 +++++- recipe/win_imaging_version_fix.patch | 13 ----------- 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 recipe/fix_setuptools_on_win_py37_py38.patch delete mode 100644 recipe/win_imaging_version_fix.patch diff --git a/recipe/fix_setuptools_on_win_py37_py38.patch b/recipe/fix_setuptools_on_win_py37_py38.patch new file mode 100644 index 0000000..bc64c7f --- /dev/null +++ b/recipe/fix_setuptools_on_win_py37_py38.patch @@ -0,0 +1,23 @@ +diff --git a/setup.py b/setup.py +index 7a1fabe23..14c404752 100755 +--- a/setup.py ++++ b/setup.py +@@ -15,7 +15,9 @@ import subprocess + import sys + import warnings + +-from setuptools import Extension, setup ++from setuptools import Extension ++from setuptools import __version__ as setuptools_version ++from setuptools import setup + from setuptools.command.build_ext import build_ext + + +@@ -850,6 +852,7 @@ class pil_build_ext(build_ext): + sys.platform == "win32" + and sys.version_info < (3, 9) + and not (PLATFORM_PYPY or PLATFORM_MINGW) ++ and int(setuptools_version.split(".")[0]) < 60 + ): + defs.append(("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""')) + else: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index db6c961..620a0cf 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,12 @@ source: sha256: c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f patches: - disable_detect.patch # [unix] - - win_imaging_version_fix.patch # [win] + # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: + # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. + # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7, + # Looking at the conda-build changelog for v3.21.9, it was noticed some changes to support the new setuptools >=60.0 + # Check if the issue persists in the next releases + - fix_setuptools_on_win_py37_py38.patch # [win] build: number: 0 diff --git a/recipe/win_imaging_version_fix.patch b/recipe/win_imaging_version_fix.patch deleted file mode 100644 index 01d3b3a..0000000 --- a/recipe/win_imaging_version_fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/PIL/Image.py b/src/PIL/Image.py -index c2216e27a..0992fb528 100644 ---- a/src/PIL/Image.py -+++ b/src/PIL/Image.py -@@ -106,7 +106,7 @@ try: - # and should be considered private and subject to change. - from . import _imaging as core - -- if __version__ != getattr(core, "PILLOW_VERSION", None): -+ if __version__ != getattr(core, "PILLOW_VERSION", None).strip('"'): - raise ImportError( - "The _imaging extension was built for another version of Pillow or PIL:\n" - f"Core version: {getattr(core, 'PILLOW_VERSION', None)}\n" From 7b1f92db4f7e5dda07bd89536e6a6e4a4150f277 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Fri, 16 Dec 2022 10:57:26 -0700 Subject: [PATCH 11/13] Change win and py37/38 setuptools fix --- recipe/fix_setuptools_on_win_py37_py38.patch | 23 -------------------- recipe/meta.yaml | 16 +++++++------- 2 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 recipe/fix_setuptools_on_win_py37_py38.patch diff --git a/recipe/fix_setuptools_on_win_py37_py38.patch b/recipe/fix_setuptools_on_win_py37_py38.patch deleted file mode 100644 index bc64c7f..0000000 --- a/recipe/fix_setuptools_on_win_py37_py38.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/setup.py b/setup.py -index 7a1fabe23..14c404752 100755 ---- a/setup.py -+++ b/setup.py -@@ -15,7 +15,9 @@ import subprocess - import sys - import warnings - --from setuptools import Extension, setup -+from setuptools import Extension -+from setuptools import __version__ as setuptools_version -+from setuptools import setup - from setuptools.command.build_ext import build_ext - - -@@ -850,6 +852,7 @@ class pil_build_ext(build_ext): - sys.platform == "win32" - and sys.version_info < (3, 9) - and not (PLATFORM_PYPY or PLATFORM_MINGW) -+ and int(setuptools_version.split(".")[0]) < 60 - ): - defs.append(("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""')) - else: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 620a0cf..d4c4ed8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,12 +10,6 @@ source: sha256: c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f patches: - disable_detect.patch # [unix] - # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: - # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. - # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7, - # Looking at the conda-build changelog for v3.21.9, it was noticed some changes to support the new setuptools >=60.0 - # Check if the issue persists in the next releases - - fix_setuptools_on_win_py37_py38.patch # [win] build: number: 0 @@ -36,8 +30,14 @@ requirements: - m2-patch # [win] host: - python - - pip - - setuptools + - pip + # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: + # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. + # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7, + # Looking at the conda-build changelog for v3.21.9, it was noticed some changes to support the new setuptools >=60.0 + # Check if the issue persists in the next releases + - setuptools <60 # [win and (py==37 or py==38)] + - setuptools # [not (win and (py==37 or py==38))] - wheel # Required by default - jpeg From ebba07e67a125edf6a24aeea1703684cde570ebb Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Fri, 16 Dec 2022 11:15:30 -0700 Subject: [PATCH 12/13] remove m2-patch --- recipe/meta.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d4c4ed8..c302c32 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -27,7 +27,6 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - patch # [unix] - - m2-patch # [win] host: - python - pip From 5a8a3c84d21a94b3f44894f3c5e364bcac1d24b4 Mon Sep 17 00:00:00 2001 From: ViridianMelody Date: Fri, 16 Dec 2022 12:44:19 -0700 Subject: [PATCH 13/13] Remove trailing whitespace --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c302c32..44eba1a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,7 @@ source: sha256: c935a22a557a560108d780f9a0fc426dd7459940dc54faa49d83249c8d3e760f patches: - disable_detect.patch # [unix] - + build: number: 0 skip: true # [py<37] @@ -29,7 +29,7 @@ requirements: - patch # [unix] host: - python - - pip + - pip # 2022/7/14: The issue was observed with 'import PIL.Image' in v9.2.0: # Additional double quotes for Core version: "9.2.0" on win-64 for python 3.7 and python 3.8. # The last version of pillow we built (v9.0.1) was built using conda-build-3.21.7,