guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 23a604d98f232ecd239160526502aff9d062e2d1
Author: Nicolas Graves <[email protected]>
AuthorDate: Sat Nov 22 11:24:14 2025 +0100

    gnu: python-piexif: Switch to pyproject.
    
    * gnu/packages/python-xyz.scm (python-piexif):
    [source]: Switch to git-fetch.
    [build-system]: Switch to pyproject-build-system.
    [native-inputs]: Add python-pytest, python-setuptools.
    [description]: Improve style.
    
    * gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch:
    Refresh it. When downloading from git rather than from the tarball,
    line ending change, refresh the patch accordingly.
    
    Change-Id: I3d7b1a76960170cd0e8bbcaba758b9e20a44f17a
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 .../python-piexif-fix-tests-with-pillow-7.2.patch  | 66 +++++++++++-----------
 gnu/packages/python-xyz.scm                        | 29 +++++-----
 2 files changed, 48 insertions(+), 47 deletions(-)

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
index 874264dc25..9e86dfe7c5 100644
--- 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
@@ -1,44 +1,42 @@
-From 5209b53e9689ce28dcd045f384633378d619718f Mon Sep 17 00:00:00 2001
+From db5f4ef3b469a1a412fb2f0e82679e9903452207 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Jan=20Wi=C5=9Bniewski?= <[email protected]>
 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(+)
+ tests/s_test.py | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
 
 diff --git a/tests/s_test.py b/tests/s_test.py
-index 5d105de..a7cad54 100644
+index 5d105de..382d1ef 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)
+@@ -9,6 +9,7 @@ import sys
+ import time
+ import unittest
+ 
++import PIL
+ from PIL import Image
+ import piexif
+ from piexif import _common, ImageIFD, ExifIFD, GPSIFD, TAGS, 
InvalidImageDataError
+@@ -580,6 +581,16 @@ class ExifTests(unittest.TestCase):
+ # 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)
+-- 
+2.51.2
+
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3bf050a619..7d8137b616 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -34075,21 +34075,24 @@ already existing modules and objects docstrings.")
     (name "python-piexif")
     (version "1.1.3")
     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "piexif" version ".zip"))
-        (sha256
-         (base32 "06sz58q4mrw472p8fbnq7wsj8zpi5js5r8phm2hiwfmz0v33bjw3"))
-        (patches
-         (search-patches "python-piexif-fix-tests-with-pillow-7.2.patch"))))
-    (build-system python-build-system)
-    (native-inputs
-     (list unzip python-pillow))
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hMatoba/Piexif";)
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1akmaxq1cjr8wghwaaql1bd3sajl8psshl58lprgfsigrvnklp8b"))
+       (patches
+        (search-patches "python-piexif-fix-tests-with-pillow-7.2.patch"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list unzip python-pillow python-pytest python-setuptools))
     (home-page "https://github.com/hMatoba/Piexif";)
     (synopsis "Simplify exif manipulations with Python")
-    (description "Piexif simplifies interacting with EXIF data in
-Python.  It includes the tools necessary for extracting, creating,
-manipulating, converting and writing EXIF data to JPEG, WebP and TIFF files.")
+    (description
+     "Piexif simplifies interacting with EXIF data in Python.  It includes the
+tools necessary for extracting, creating, manipulating, converting and writing
+EXIF data to JPEG, WebP and TIFF files.")
     (license license:expat)))
 
 (define-public python-pyrss2gen

Reply via email to