all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob a012a92f918c97b5eb3ee0b8dff293448cc4330f 1504 bytes (raw)
name: gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
From 5209b53e9689ce28dcd045f384633378d619718f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Wi=C5=9Bniewski?= <vuko@vuko.pl>
Date: Thu, 5 Nov 2020 16:18:52 +0100
Subject: [PATCH] convert IFDRational to tuples in tests

This fixes tests with Pillow version >= 7.2.0
---
 tests/s_test.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/s_test.py b/tests/s_test.py
index 5d105de..a7cad54 100644
--- a/tests/s_test.py
+++ b/tests/s_test.py
***************
*** 9,14 ****
--- 9,15 ----
  import time
  import unittest
  
+ import PIL
  from PIL import Image
  import piexif
  from piexif import _common, ImageIFD, ExifIFD, GPSIFD, TAGS, InvalidImageDataError
***************
*** 580,585 ****
--- 581,597 ----
  # test utility methods----------------------------------------------
  
      def _compare_value(self, v1, v2):
+         if isinstance(v2, PIL.TiffImagePlugin.IFDRational):
+             v2 = (v2.numerator, v2.denominator)
+         if isinstance(v2, tuple):
+             converted_v2 = []
+             for el in v2:
+                 if isinstance(el, PIL.TiffImagePlugin.IFDRational):
+                     converted_v2.append((el.numerator, el.denominator))
+                 else:
+                     converted_v2.append(el)
+             v2 = tuple(converted_v2)
+ 
          if type(v1) != type(v2):
              if isinstance(v1, tuple):
                  self.assertEqual(pack_byte(*v1), v2)

debug log:

solving a012a92f91 ...
found a012a92f91 in https://yhetil.org/guix/05cc89ec4c7cb0eda6945690544469f519811ecf.1641160577.git.h.goebel@crazy-compilers.com/

applying [1/1] https://yhetil.org/guix/05cc89ec4c7cb0eda6945690544469f519811ecf.1641160577.git.h.goebel@crazy-compilers.com/
diff --git a/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch b/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch
new file mode 100644
index 0000000000..a012a92f91

1:7: trailing whitespace.
From 5209b53e9689ce28dcd045f384633378d619718f Mon Sep 17 00:00:00 2001\r
1:8: trailing whitespace.
From: =?UTF-8?q?Jan=20Wi=C5=9Bniewski?= <vuko@vuko.pl>\r
1:9: trailing whitespace.
Date: Thu, 5 Nov 2020 16:18:52 +0100\r
1:10: trailing whitespace.
Subject: [PATCH] convert IFDRational to tuples in tests\r
1:11: trailing whitespace.
\r
Checking patch gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch...
Applied patch gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch cleanly.
warning: squelched 39 whitespace errors
warning: 44 lines add whitespace errors.

index at:
100644 a012a92f918c97b5eb3ee0b8dff293448cc4330f	gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.