sharlatan pushed a commit to branch python-team
in repository guix.

commit 875f3839953298c51fca4f10b74e538a932708f5
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Wed Nov 27 21:09:31 2024 +0000

    gnu: python-pypdf: Update to 5.1.0.
    
    * gnu/packages/pdf.scm (python-pypdf): Update to 5.1.0. Improve style.
    [source]: Remove patch.
    [argumetns]<test-flags>: Silent 2 failing tests.
    [propagated-inputs]: Add python-pillow.
    [native-inputs]: Add python-pytest-socket, python-pytest-timeout,
    python-pyyaml, and python-pytest-xdist.
    
    * gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch:
    Delete file.
    * gnu/local.mk: Deregister patch.
    
    Change-Id: Iba7aea89431f386dff74cb426d8fcbbcbeaaf009
---
 gnu/local.mk                                       |  1 -
 ...python-pypdf-annotate-tests-appropriately.patch | 96 ----------------------
 gnu/packages/pdf.scm                               | 46 +++++++----
 3 files changed, 30 insertions(+), 113 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 903cc9fca6..b63e2daf36 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1928,7 +1928,6 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-pillow-use-zlib-1.3.patch        \
   %D%/packages/patches/python-pyreadstat-link-libiconv.patch   \
   %D%/packages/patches/python-pyls-black-41.patch              \
-  %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \
   %D%/packages/patches/python-sip-include-dirs.patch   \
   %D%/packages/patches/python-sgmllib3k-assertions.patch       \
   %D%/packages/patches/python-sphobjinv-defer-ssl-import.patch \
diff --git 
a/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch 
b/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch
deleted file mode 100644
index 14f1f73924..0000000000
--- a/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-Origin: 
https://github.com/py-pdf/pypdf/commit/767047b98ee3ea7aca331cfbd63502a284bfed93
-From 767047b98ee3ea7aca331cfbd63502a284bfed93 Mon Sep 17 00:00:00 2001
-From: dkg <[email protected]>
-Date: Sat, 14 Jan 2023 03:32:45 -0500
-Subject: [PATCH 03/14] Annotate tests appropriately (#1551)
-
-By annotating these tests, we can use pytest markers to skip external
-tests and tests that depend on sample-files.
----
- tests/test_reader.py | 5 +++++
- tests/test_writer.py | 4 ++++
- 2 files changed, 9 insertions(+)
-
-diff --git a/tests/test_reader.py b/tests/test_reader.py
-index 710e6c5..62eb7b7 100644
---- a/tests/test_reader.py
-+++ b/tests/test_reader.py
-@@ -176,6 +176,7 @@ def test_get_outline(src, outline_elements):
-     assert len(outline) == outline_elements
- 
- 
[email protected]
- @pytest.mark.parametrize(
-     ("src", "expected_images"),
-     [
-@@ -866,6 +867,7 @@ def test_get_fields():
-     assert dict(fields["c1-1"]) == ({"/FT": "/Btn", "/T": "c1-1"})
- 
- 
[email protected]
- def test_get_full_qualified_fields():
-     url = 
"https://github.com/py-pdf/PyPDF2/files/10142389/fields_with_dots.pdf";
-     name = "fields_with_dots.pdf"
-@@ -1214,6 +1216,7 @@ def test_zeroing_xref():
-     len(reader.pages)
- 
- 
[email protected]
- def test_thread():
-     url = 
"https://github.com/py-pdf/pypdf/files/9066120/UTA_OSHA_3115_Fall_Protection_Training_09162021_.pdf";
-     name = "UTA_OSHA.pdf"
-@@ -1226,6 +1229,7 @@ def test_thread():
-     assert len(reader.threads) >= 1
- 
- 
[email protected]
- def test_build_outline_item(caplog):
-     url = "https://github.com/py-pdf/pypdf/files/9464742/shiv_resume.pdf";
-     name = "shiv_resume.pdf"
-@@ -1253,6 +1257,7 @@ def test_build_outline_item(caplog):
-     assert "Unexpected destination 2" in exc.value.args[0]
- 
- 
[email protected]
- @pytest.mark.parametrize(
-     ("src", "page_labels"),
-     [
-diff --git a/tests/test_writer.py b/tests/test_writer.py
-index 60b4a17..20c4de0 100644
---- a/tests/test_writer.py
-+++ b/tests/test_writer.py
-@@ -930,6 +930,7 @@ def test_startup_dest():
-     pdf_file_writer.open_destination = None
- 
- 
[email protected]
- def test_iss471():
-     url = "https://github.com/py-pdf/pypdf/files/9139245/book.pdf";
-     name = "book_471.pdf"
-@@ -942,6 +943,7 @@ def test_iss471():
-     )
- 
- 
[email protected]
- def test_reset_translation():
-     url = "https://corpora.tika.apache.org/base/docs/govdocs1/924/924666.pdf";
-     name = "tika-924666.pdf"
-@@ -977,6 +979,7 @@ def test_threads_empty():
-     assert thr == thr2
- 
- 
[email protected]
- def test_append_without_annots_and_articles():
-     url = "https://corpora.tika.apache.org/base/docs/govdocs1/924/924666.pdf";
-     name = "tika-924666.pdf"
-@@ -993,6 +996,7 @@ def test_append_without_annots_and_articles():
-     assert len(writer.threads) >= 1
- 
- 
[email protected]
- def test_append_multiple():
-     url = "https://corpora.tika.apache.org/base/docs/govdocs1/924/924666.pdf";
-     name = "tika-924666.pdf"
--- 
-2.39.1
-
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 24afadbe80..3421a05e1c 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -1344,26 +1344,40 @@ converter using the Poppler and Cairo libraries.")
 (define-public python-pypdf
   (package
     (name "python-pypdf")
-    (version "3.2.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/py-pdf/pypdf";)
-                    (commit version)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1qwvjr694sabfblx22zd54b9ny40f2gbv3bv6q43myrlxwvvisk6"))
-              (patches (search-patches
-                        "python-pypdf-annotate-tests-appropriately.patch"))))
+    (version "5.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/py-pdf/pypdf";)
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0dl3nmvsk43s2v6a5cwwvfwpyvhsl9wcrdnqbzjsp50zqibi23pz"))))
     (build-system pyproject-build-system)
-    (native-inputs (list python-pytest python-flit))
-    (propagated-inputs (list python-typing-extensions))
-    (home-page "https://github.com/py-pdf/pypdf";)
     (arguments
      (list
       ;; Disable tests that use the network and non-free assets.
-      #:test-flags #~(list "-m" "not external and not samples")))
+      #:test-flags
+      #~(list "-m" "not samples and not enable_socket"
+              "--numprocesses" (number->string (parallel-job-count))
+              "-k" (string-join
+                    ;; ValueError: cannot save mode RGBA
+                    (list "not test_replace_image"
+                          ;; assert None
+                          "test_writer_xmp_metadata_samples")
+                    " and not "))))
+    (native-inputs
+     (list python-flit
+           python-pytest
+           python-pytest-socket
+           python-pytest-timeout
+           python-pyyaml
+           python-pytest-xdist))
+    (propagated-inputs
+     (list python-typing-extensions
+           python-pillow))
+    (home-page "https://github.com/py-pdf/pypdf";)
     (synopsis "Python PDF library")
     (description
      "This package provides a PDF library capable of splitting, merging,

Reply via email to