From aeab3f7ac4e456753c4e45e79b3fc2904650ed46 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 2 Jan 2023 17:45:23 +1100 Subject: [PATCH] try patching failing test on osx --- recipe/meta.yaml | 2 ++ .../0001-Build-without-USE_WIN32_FILEIO.patch | 10 +++--- .../0002-Do-not-quote-PILLOW_VERSION.patch | 10 +++--- .../patches/0003-add-WEBP_ROOT-XCB_ROOT.patch | 10 +++--- ...ed-patch-to-fix-failing-Windows-test.patch | 10 +++--- ...ty-check-to-similarity-for-test_load.patch | 32 +++++++++++++++++++ 6 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 recipe/patches/0005-downgrade-equality-check-to-similarity-for-test_load.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c134125..3523018 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -16,6 +16,8 @@ source: - patches/0003-add-WEBP_ROOT-XCB_ROOT.patch # fix provided by upstream maintainer for failing test - patches/0004-Added-patch-to-fix-failing-Windows-test.patch + # osx failing an equality test with libjpeg-turbo, downgrade to similarity + - patches/0005-downgrade-equality-check-to-similarity-for-test_load.patch # [osx] build: number: 0 diff --git a/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch b/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch index f19d424..a8cf0ce 100644 --- a/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch +++ b/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch @@ -1,7 +1,7 @@ -From 24c396fd36be736d957b92598d71e61637a20469 Mon Sep 17 00:00:00 2001 +From ca799892b3c5bc56bf53e242cf309b934b26a351 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 5 May 2021 12:42:10 -0600 -Subject: [PATCH 1/4] Build without USE_WIN32_FILEIO +Subject: [PATCH 1/5] Build without USE_WIN32_FILEIO This keeps things consistent with current conda-forge builds of tiff (and poppler). @@ -10,10 +10,10 @@ This keeps things consistent with current conda-forge builds of tiff 1 file changed, 6 deletions(-) diff --git a/setup.py b/setup.py -index 23d91a5f..c0124e6b 100755 +index 7a1fabe23..7eabe2d68 100755 --- a/setup.py +++ b/setup.py -@@ -826,12 +826,6 @@ class pil_build_ext(build_ext): +@@ -832,12 +832,6 @@ class pil_build_ext(build_ext): if feature.tiff: libs.append(feature.tiff) defs.append(("HAVE_LIBTIFF", None)) @@ -27,5 +27,5 @@ index 23d91a5f..c0124e6b 100755 libs.append(feature.xcb) defs.append(("HAVE_XCB", None)) -- -2.32.0.windows.2 +2.38.1.windows.1 diff --git a/recipe/patches/0002-Do-not-quote-PILLOW_VERSION.patch b/recipe/patches/0002-Do-not-quote-PILLOW_VERSION.patch index 3aa93d3..07c8db0 100644 --- a/recipe/patches/0002-Do-not-quote-PILLOW_VERSION.patch +++ b/recipe/patches/0002-Do-not-quote-PILLOW_VERSION.patch @@ -1,17 +1,17 @@ -From 3ecfb3f876c8b35657549233657c37d8f5a5727e Mon Sep 17 00:00:00 2001 +From bc391110c03e92331ce568f59e4c21438f1beb2b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 4 Jan 2022 13:54:46 +1100 -Subject: [PATCH 2/4] Do not quote PILLOW_VERSION +Subject: [PATCH 2/5] Do not quote PILLOW_VERSION --- setup.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/setup.py b/setup.py -index c0124e6b..87b73b02 100755 +index 7eabe2d68..133315cbf 100755 --- a/setup.py +++ b/setup.py -@@ -834,14 +834,7 @@ class pil_build_ext(build_ext): +@@ -840,14 +840,7 @@ class pil_build_ext(build_ext): if struct.unpack("h", b"\0\1")[0] == 1: defs.append(("WORDS_BIGENDIAN", None)) @@ -28,5 +28,5 @@ index c0124e6b..87b73b02 100755 self._update_extension("PIL._imaging", libs, defs) -- -2.32.0.windows.2 +2.38.1.windows.1 diff --git a/recipe/patches/0003-add-WEBP_ROOT-XCB_ROOT.patch b/recipe/patches/0003-add-WEBP_ROOT-XCB_ROOT.patch index b489a6a..d1e2d72 100644 --- a/recipe/patches/0003-add-WEBP_ROOT-XCB_ROOT.patch +++ b/recipe/patches/0003-add-WEBP_ROOT-XCB_ROOT.patch @@ -1,14 +1,14 @@ -From 809b8d59fc7fe7eda85125ad78c80f53a96e1331 Mon Sep 17 00:00:00 2001 +From e9a340c5c706f66a87f0ac6e275fcc4dd7f520c7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 5 Jan 2022 18:51:42 +1100 -Subject: [PATCH 3/4] add WEBP_ROOT & XCB_ROOT +Subject: [PATCH 3/5] add WEBP_ROOT & XCB_ROOT --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py -index 87b73b02..50e93e4d 100755 +index 133315cbf..8c52d2085 100755 --- a/setup.py +++ b/setup.py @@ -35,6 +35,8 @@ JPEG2K_ROOT = None @@ -20,7 +20,7 @@ index 87b73b02..50e93e4d 100755 ZLIB_ROOT = None FUZZING_BUILD = "LIB_FUZZING_ENGINE" in os.environ -@@ -445,6 +447,8 @@ class pil_build_ext(build_ext): +@@ -451,6 +453,8 @@ class pil_build_ext(build_ext): HARFBUZZ_ROOT="harfbuzz", FRIBIDI_ROOT="fribidi", LCMS_ROOT="lcms2", @@ -30,5 +30,5 @@ index 87b73b02..50e93e4d 100755 ).items(): root = globals()[root_name] -- -2.32.0.windows.2 +2.38.1.windows.1 diff --git a/recipe/patches/0004-Added-patch-to-fix-failing-Windows-test.patch b/recipe/patches/0004-Added-patch-to-fix-failing-Windows-test.patch index 5f76861..422b679 100644 --- a/recipe/patches/0004-Added-patch-to-fix-failing-Windows-test.patch +++ b/recipe/patches/0004-Added-patch-to-fix-failing-Windows-test.patch @@ -1,17 +1,17 @@ -From 9013aed5294ef34a66a229bfb12f75ef43abb54d Mon Sep 17 00:00:00 2001 +From 85c0dbdaa965352ccf5ceb274dc2ce96395c4bf0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 12 Jan 2022 11:35:32 +1100 -Subject: [PATCH 4/4] Added patch to fix failing Windows test +Subject: [PATCH 4/5] Added patch to fix failing Windows test --- src/PIL/TiffImagePlugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py -index 5df5c4f4..259a8854 100644 +index 1dfd5275f..a957fe352 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py -@@ -1184,6 +1184,10 @@ class TiffImageFile(ImageFile.ImageFile): +@@ -1270,6 +1270,10 @@ class TiffImageFile(ImageFile.ImageFile): # file descriptor, use that instead of reading # into a string in python. # libtiff closes the file descriptor, so pass in a dup. @@ -23,5 +23,5 @@ index 5df5c4f4..259a8854 100644 fp = hasattr(self.fp, "fileno") and os.dup(self.fp.fileno()) # flush the file descriptor, prevents error on pypy 2.4+ -- -2.32.0.windows.2 +2.38.1.windows.1 diff --git a/recipe/patches/0005-downgrade-equality-check-to-similarity-for-test_load.patch b/recipe/patches/0005-downgrade-equality-check-to-similarity-for-test_load.patch new file mode 100644 index 0000000..0a6d30b --- /dev/null +++ b/recipe/patches/0005-downgrade-equality-check-to-similarity-for-test_load.patch @@ -0,0 +1,32 @@ +From baacaf03110e0fd84cd4c0f641c7d0cd9147665d Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Mon, 2 Jan 2023 17:42:56 +1100 +Subject: [PATCH 5/5] downgrade equality check to similarity for test_load_blp1 + +--- + Tests/test_file_blp.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Tests/test_file_blp.py b/Tests/test_file_blp.py +index ba2781820..e1d04fea1 100644 +--- a/Tests/test_file_blp.py ++++ b/Tests/test_file_blp.py +@@ -6,13 +6,14 @@ from .helper import ( + assert_image_equal, + assert_image_equal_tofile, + assert_image_similar, ++ assert_image_similar_tofile, + hopper, + ) + + + def test_load_blp1(): + with Image.open("Tests/images/blp/blp1_jpeg.blp") as im: +- assert_image_equal_tofile(im, "Tests/images/blp/blp1_jpeg.png") ++ assert_image_similar_tofile(im, "Tests/images/blp/blp1_jpeg.png", 1.2) + + with Image.open("Tests/images/blp/blp1_jpeg2.blp") as im: + im.load() +-- +2.38.1.windows.1 +