GNU bug report logs - #69389
[PATCH] gnu: Add python-xmp-toolkit.

Previous Next

Package: guix-patches;

Reported by: Felix Gruber <felgru <at> posteo.net>

Date: Sun, 25 Feb 2024 17:44:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69389 in the body.
You can then email your comments to 69389 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#69389; Package guix-patches. (Sun, 25 Feb 2024 17:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Gruber <felgru <at> posteo.net>:
New bug report received and forwarded. Copy sent to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, jgart <at> dismail.de, guix-patches <at> gnu.org. (Sun, 25 Feb 2024 17:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix Gruber <felgru <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Felix Gruber <felgru <at> posteo.net>
Subject: [PATCH] gnu: Add python-xmp-toolkit.
Date: Sun, 25 Feb 2024 17:42:12 +0000
* gnu/packages/python-xyz.scm (python-xmp-toolkit): New variable.
* gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Change-Id: Ibce05155961eb5ba199754646e08acff2410f95d
---
 gnu/local.mk                                  |  1 +
 ...-xmp-toolkit-add-missing-error-codes.patch | 51 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 51 ++++++++++++++++++-
 3 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 741c72a653..b10063678e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1943,6 +1943,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-versioneer-guix-support.patch	\
   %D%/packages/patches/python-waitress-fix-tests.patch		\
   %D%/packages/patches/python-werkzeug-tests.patch		\
+  %D%/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch	\
   %D%/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch	\
   %D%/packages/patches/qemu-build-info-manual.patch		\
   %D%/packages/patches/qemu-disable-some-qtests-tests.patch	\
diff --git a/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch
new file mode 100644
index 0000000000..17bdae188f
--- /dev/null
+++ b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch
@@ -0,0 +1,51 @@
+From fd9e887a1853d9b4bc3fce20d414d648fb5abbfc Mon Sep 17 00:00:00 2001
+From: Asher Glick <asher.glick <at> gmail.com>
+Date: Mon, 1 Mar 2021 14:35:46 -0600
+Subject: [PATCH] Add missing error codes and graceful handling of possible
+ future missing codes.
+
+---
+ libxmp/exempi.py | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/libxmp/exempi.py b/libxmp/exempi.py
+index 683e240..f58003c 100644
+--- a/libxmp/exempi.py
++++ b/libxmp/exempi.py
+@@ -85,6 +85,7 @@ ERROR_MESSAGE = {    0: "unknown error",
+                    -13: "std exception",
+                    -14: "unknown exception",
+                    -15: "no memory",
++                   -16: "progress abort",
+                   -101: "bad schema",
+                   -102: "bad XPath",
+                   -103: "bad options",
+@@ -95,6 +96,14 @@ ERROR_MESSAGE = {    0: "unknown error",
+                   -108: "bad file format",
+                   -109: "no file handler",
+                   -110: "too large for JPEG",
++                  -111: "no file",
++                  -112: "file permission error",
++                  -113: "disk space",
++                  -114: "read error",
++                  -115: "write error",
++                  -116: "bad block format",
++                  -117: "file path not a file",
++                  -118: "rejected file extension",
+                   -201: "bad XML",
+                   -202: "bad RDF",
+                   -203: "bad XMP",
+@@ -1697,6 +1706,9 @@ def check_error(success):
+     # so we supplement it by explicitly checking the error code.
+     ecode = EXEMPI.xmp_get_error()
+     if not success or ecode != 0:
+-        error_msg = ERROR_MESSAGE[ecode]
++        if ecode in ERROR_MESSAGE:
++            error_msg = ERROR_MESSAGE[ecode]
++        else:
++            error_msg = "Unexpected error code " + str(ecode)
+         msg = 'Exempi function failure ("{0}").'.format(error_msg)
+         raise XMPError(msg)
+-- 
+2.30.2
+
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a051f5a8db..6cbedcb5e9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -108,7 +108,7 @@
 ;;; Copyright © 2021 Simon Streit <simon <at> netpanic.org>
 ;;; Copyright © 2021, 2022, 2023 Daniel Meißner <daniel.meissner-i4k <at> ruhr-uni-bochum.de>
 ;;; Copyright © 2021, 2022 Pradana Aumars <paumars <at> courrier.dev>
-;;; Copyright © 2021, 2022, 2023 Felix Gruber <felgru <at> posteo.net>
+;;; Copyright © 2021–2024 Felix Gruber <felgru <at> posteo.net>
 ;;; Copyright © 2021 Sébastien Lerique <sl <at> eauchat.org>
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte <at> mind.be>
 ;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj <at> protonmail.com>
@@ -35628,6 +35628,55 @@ (define-public python-zeroc-ice-3.6
                (base32
                 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
 
+(define-public python-xmp-toolkit
+  (package
+    (name "python-xmp-toolkit")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-xmp-toolkit" version))
+       (sha256
+        (base32 "12x6lyaxjpbl8ll3cj97039kwvsha2nkx2v8v8irfbi2p0dl721s"))
+        (patches (search-patches
+                   "python-xmp-toolkit-add-missing-error-codes.patch"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      '(list "-k" (string-append "not test_can_put_xmp and "
+                                 "not test_exempi_bad_combinations and "
+                                 "not test_formats and "
+                                 "not test_get_xmp and "
+                                 "not test_open_file_with_options"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'build 'configure-environment
+            (lambda* (#:key outputs inputs #:allow-other-keys)
+              (let ((exempi #$(this-package-input "exempi")))
+                (setenv "LD_LIBRARY_PATH"
+                        (string-append exempi "/lib"))))))))
+    (inputs (list exempi))
+    (propagated-inputs (list python-pytz))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/python-xmp-toolkit/python-xmp-toolkit")
+    (synopsis "Python XMP Toolkit for working with metadata.")
+    (description "Python XMP Toolkit is a library for working with XMP
+metadata, as well as reading/writing XMP metadata stored in many different
+file formats.
+
+Python XMP Toolkit is wrapping Exempi (using ctypes), a C/C++ XMP library
+based on Adobe XMP Toolkit, ensuring that future updates to the XMP standard
+are easily incorporated into the library with a minimum amount of work.
+
+Python XMP Toolkit has been developed by:
+@itemize
+@item ESA/Hubble - European Space Agency
+@item ESO - European Southern Observatory
+@item CRS4 - Centre for Advanced Studies, Research and Development in Sardinia
+@end itemize")
+      (license license:bsd-3)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar

base-commit: b25b94335a3ee8d68d2145da8e5ea0325ecea451
-- 
2.43.0





Information forwarded to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#69389; Package guix-patches. (Sun, 07 Jul 2024 18:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 69389 <at> debbugs.gnu.org (full text, mbox):

From: Felix Gruber <felgru <at> posteo.net>
To: 69389 <at> debbugs.gnu.org
Cc: Felix Gruber <felgru <at> posteo.net>
Subject: [PATCH v2] gnu: Add python-xmp-toolkit.
Date: Sun,  7 Jul 2024 18:04:24 +0000
* gnu/packages/python-xyz.scm (python-xmp-toolkit): New variable.
* gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Change-Id: Ibce05155961eb5ba199754646e08acff2410f95d
---
 gnu/local.mk                                  |  1 +
 ...-xmp-toolkit-add-missing-error-codes.patch | 51 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 49 ++++++++++++++++++
 3 files changed, 101 insertions(+)
 create mode 100644 gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 329eaf9358..7d0cdc7db0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1987,6 +1987,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-versioneer-guix-support.patch	\
   %D%/packages/patches/python-waitress-fix-tests.patch		\
   %D%/packages/patches/python-werkzeug-tests.patch		\
+  %D%/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch	\
   %D%/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch	\
   %D%/packages/patches/qemu-7.2.4-build-info-manual.patch	\
   %D%/packages/patches/qemu-build-info-manual.patch		\
diff --git a/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch
new file mode 100644
index 0000000000..17bdae188f
--- /dev/null
+++ b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch
@@ -0,0 +1,51 @@
+From fd9e887a1853d9b4bc3fce20d414d648fb5abbfc Mon Sep 17 00:00:00 2001
+From: Asher Glick <asher.glick <at> gmail.com>
+Date: Mon, 1 Mar 2021 14:35:46 -0600
+Subject: [PATCH] Add missing error codes and graceful handling of possible
+ future missing codes.
+
+---
+ libxmp/exempi.py | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/libxmp/exempi.py b/libxmp/exempi.py
+index 683e240..f58003c 100644
+--- a/libxmp/exempi.py
++++ b/libxmp/exempi.py
+@@ -85,6 +85,7 @@ ERROR_MESSAGE = {    0: "unknown error",
+                    -13: "std exception",
+                    -14: "unknown exception",
+                    -15: "no memory",
++                   -16: "progress abort",
+                   -101: "bad schema",
+                   -102: "bad XPath",
+                   -103: "bad options",
+@@ -95,6 +96,14 @@ ERROR_MESSAGE = {    0: "unknown error",
+                   -108: "bad file format",
+                   -109: "no file handler",
+                   -110: "too large for JPEG",
++                  -111: "no file",
++                  -112: "file permission error",
++                  -113: "disk space",
++                  -114: "read error",
++                  -115: "write error",
++                  -116: "bad block format",
++                  -117: "file path not a file",
++                  -118: "rejected file extension",
+                   -201: "bad XML",
+                   -202: "bad RDF",
+                   -203: "bad XMP",
+@@ -1697,6 +1706,9 @@ def check_error(success):
+     # so we supplement it by explicitly checking the error code.
+     ecode = EXEMPI.xmp_get_error()
+     if not success or ecode != 0:
+-        error_msg = ERROR_MESSAGE[ecode]
++        if ecode in ERROR_MESSAGE:
++            error_msg = ERROR_MESSAGE[ecode]
++        else:
++            error_msg = "Unexpected error code " + str(ecode)
+         msg = 'Exempi function failure ("{0}").'.format(error_msg)
+         raise XMPError(msg)
+-- 
+2.30.2
+
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1c432e9b65..2e6ffd675a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -37095,6 +37095,55 @@ (define-public python-zeroc-ice-3.6
                (base32
                 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
 
+(define-public python-xmp-toolkit
+  (package
+    (name "python-xmp-toolkit")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-xmp-toolkit" version))
+       (sha256
+        (base32 "12x6lyaxjpbl8ll3cj97039kwvsha2nkx2v8v8irfbi2p0dl721s"))
+        (patches (search-patches
+                   "python-xmp-toolkit-add-missing-error-codes.patch"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      '(list "-k" (string-append "not test_can_put_xmp and "
+                                 "not test_exempi_bad_combinations and "
+                                 "not test_formats and "
+                                 "not test_get_xmp and "
+                                 "not test_open_file_with_options"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'build 'configure-environment
+            (lambda* (#:key outputs inputs #:allow-other-keys)
+              (let ((exempi #$(this-package-input "exempi")))
+                (setenv "LD_LIBRARY_PATH"
+                        (string-append exempi "/lib"))))))))
+    (inputs (list exempi))
+    (propagated-inputs (list python-pytz))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/python-xmp-toolkit/python-xmp-toolkit")
+    (synopsis "Python XMP Toolkit for working with metadata.")
+    (description "Python XMP Toolkit is a library for working with XMP
+metadata, as well as reading/writing XMP metadata stored in many different
+file formats.
+
+Python XMP Toolkit is wrapping Exempi (using ctypes), a C/C++ XMP library
+based on Adobe XMP Toolkit, ensuring that future updates to the XMP standard
+are easily incorporated into the library with a minimum amount of work.
+
+Python XMP Toolkit has been developed by:
+@itemize
+@item ESA/Hubble - European Space Agency
+@item ESO - European Southern Observatory
+@item CRS4 - Centre for Advanced Studies, Research and Development in Sardinia
+@end itemize")
+      (license license:bsd-3)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar

base-commit: 5217ea6d45bef053844d8360a06252b9436783b3
-- 
2.43.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 18 Jul 2024 15:03:01 GMT) Full text and rfc822 format available.

Notification sent to Felix Gruber <felgru <at> posteo.net>:
bug acknowledged by developer. (Thu, 18 Jul 2024 15:03:01 GMT) Full text and rfc822 format available.

Message #13 received at 69389-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Felix Gruber <felgru <at> posteo.net>
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 jgart <jgart <at> dismail.de>, Marius Bakke <marius <at> gnu.org>,
 69389-done <at> debbugs.gnu.org, Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: Re: [bug#69389] [PATCH v2] gnu: Add python-xmp-toolkit.
Date: Thu, 18 Jul 2024 17:01:14 +0200
[Message part 1 (text/plain, inline)]
Hi Felix,

Felix Gruber <felgru <at> posteo.net> skribis:

> * gnu/packages/python-xyz.scm (python-xmp-toolkit): New variable.
> * gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch:
> New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
>
> Change-Id: Ibce05155961eb5ba199754646e08acff2410f95d

Applied with the changes below: I took the liberty to strip the
description of authorship info since that’s not something we usually do.

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 17b4c982c1..fcf01f3d04 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -37518,11 +37518,11 @@ (define-public python-xmp-toolkit
     (arguments
      (list
       #:test-flags
-      '(list "-k" (string-append "not test_can_put_xmp and "
-                                 "not test_exempi_bad_combinations and "
-                                 "not test_formats and "
-                                 "not test_get_xmp and "
-                                 "not test_open_file_with_options"))
+      #~(list "-k" (string-append "not test_can_put_xmp and "
+                                  "not test_exempi_bad_combinations and "
+                                  "not test_formats and "
+                                  "not test_get_xmp and "
+                                  "not test_open_file_with_options"))
       #:phases
       #~(modify-phases %standard-phases
           (add-before 'build 'configure-environment
@@ -37541,14 +37541,7 @@ (define-public python-xmp-toolkit
 
 Python XMP Toolkit is wrapping Exempi (using ctypes), a C/C++ XMP library
 based on Adobe XMP Toolkit, ensuring that future updates to the XMP standard
-are easily incorporated into the library with a minimum amount of work.
-
-Python XMP Toolkit has been developed by:
-@itemize
-@item ESA/Hubble - European Space Agency
-@item ESO - European Southern Observatory
-@item CRS4 - Centre for Advanced Studies, Research and Development in Sardinia
-@end itemize")
+are easily incorporated into the library with a minimum amount of work.")
       (license license:bsd-3)))
 
 ;;;

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Aug 2024 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.