GNU bug report logs - #60941
Update diffoscope to 232

Previous Next

Package: guix-patches;

Reported by: Vagrant Cascadian <vagrant <at> reproducible-builds.org>

Date: Thu, 19 Jan 2023 01:33:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

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 60941 in the body.
You can then email your comments to 60941 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 guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Thu, 19 Jan 2023 01:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vagrant Cascadian <vagrant <at> reproducible-builds.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 19 Jan 2023 01:33:01 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: guix-patches <at> gnu.org
Subject: Update diffoscope to 232
Date: Wed, 18 Jan 2023 17:31:55 -0800
[Message part 1 (text/plain, inline)]
Working on updating diffoscope to 232.

Mostly routine changes. Notable differences are:

* Needed a newer version of python-pypdf, as the python-pypdf2 included
  in guix is too old, referred to as PyPDF2 1.x, newer versions include
  PyPDF2 2.x or PyPdf2 3.x... It is also not PyPDF 1.x or PyPDF 2.x,
  which are very old, and I am not sure where PyPDF3 or PyPDF4 fit in,
  but they exist and one is even packaged in guix... For clarity, and I
  try to say this without laughing, this new package is based on the
  very recently released PyPDF 3.2.1.

* Added lzip to native-inputs and upsteam code

* Dropped mono from upstream code

The upstream diffoscope changes were pushed to git upstream, so can
eventually be dropped once diffoscope 233+ is eventually released.

I have less hope for soring out the pypdf versioning madness.

live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Thu, 19 Jan 2023 01:38:02 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: 60941 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add python-pypdf.
Date: Wed, 18 Jan 2023 17:36:54 -0800
[0001-gnu-Add-python-pypdf.patch (text/x-diff, inline)]
From e2082819efee20a72b026eebcfc14af279e424c7 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Date: Wed, 18 Jan 2023 16:26:41 -0800
Subject: [PATCH 1/2] gnu: Add python-pypdf.

* gnu/packages/pdf.scm (python-pypdf): New varaible.
---
 gnu/packages/pdf.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 4b9d0623fe..cb94c29bde 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -1260,6 +1260,45 @@ (define-public pdf2svg
 converter using the Poppler and Cairo libraries.")
     (license license:gpl2+)))
 
+(define-public python-pypdf
+  (package
+    (name "python-pypdf")
+    (version "3.2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pypdf" version))
+              (sha256
+               (base32
+                "1pdq4nbkknx61pk8w75jvx5j921m2676wfkyizsrap5mj92cssxc"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f ;pypi source does not contains tests
+           #:phases #~(modify-phases %standard-phases
+                        (replace 'build
+                          (lambda _
+                            (invoke "flit" "build")))
+                        (replace 'install
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (add-installed-pythonpath inputs outputs)
+                            (for-each (lambda (wheel)
+                                        (invoke "python"
+                                                "-m"
+                                                "pip"
+                                                "install"
+                                                wheel
+                                                (string-append "--prefix="
+                                                               #$output)))
+                                      (find-files "dist" "\\.whl$")))))))
+    (native-inputs (list python-flit))
+    (propagated-inputs (list python-typing-extensions))
+    (home-page "https://github.com/py-pdf/pypdf")
+    (synopsis
+     "A pure-python PDF library")
+    (description
+     "This package provides a pure-python PDF library capable of splitting, merging,
+cropping, and transforming PDF files")
+    (license license:bsd-3)))
+
 (define-public python-pypdf2
   (package
     (name "python-pypdf2")
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Thu, 19 Jan 2023 01:39:02 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: 60941 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: diffoscope: Update to 232.
Date: Wed, 18 Jan 2023 17:38:00 -0800
[0002-gnu-diffoscope-Update-to-232.patch (text/x-diff, inline)]
From 784d33dad1ff114e4f8043b7b766c785e7fef79f Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Date: Wed, 18 Jan 2023 11:00:46 -0800
Subject: [PATCH 2/2] gnu: diffoscope: Update to 232.

* gnu/packages/diffoscope.scm (diffoscope): Update to 232.
  [native-inputs]: Add lzip and python-pdf, drop python-pypdf2.
  [phases]: Add lzip-external-tool and remove-mono-external-tool.
---
 gnu/packages/diffoscope.scm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
index f730d976fe..59875c2e8e 100644
--- a/gnu/packages/diffoscope.scm
+++ b/gnu/packages/diffoscope.scm
@@ -75,7 +75,7 @@ (define-module (gnu packages diffoscope)
 (define-public diffoscope
   (package
     (name "diffoscope")
-    (version "224")
+    (version "232")
     (source
      (origin
        (method git-fetch)
@@ -84,7 +84,7 @@ (define-public diffoscope
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1qdivsf4yygg2az5018pw0q4169zas3hfqjydd0q3bhdrfpl0q4q"))
+        (base32 "0zix2m1rlgj7kyx8bkfjb9dnc5idblz6xhmxqq0w3jpnkxxjj8yq"))
        (patches
         (search-patches "diffoscope-fix-llvm-test.patch"))))
     (build-system python-build-system)
@@ -112,6 +112,21 @@ (define-public diffoscope
                          (string-append "[\"" (which "stat") "\","))
                         (("\\[\"getfacl\",")
                          (string-append "[\"" (which "getfacl") "\",")))))
+                  (add-after 'unpack 'lzip-external-tool
+                    ;; Fixed upstream, remove this phase when updating to
+                    ;; diffoscope 233
+                    (lambda _
+                      (substitute* "diffoscope/external_tools.py"
+                        ((".debian.: .lzip.")
+                         "\"debian\": \"lzip\", \"guix\": \"lzip\""))))
+                  (add-after 'unpack 'remove-mono-external-tool
+                    ;; Fixed upstream, remove this phase when updating to
+                    ;; diffoscope 233
+                    (lambda _
+                      (substitute* "diffoscope/external_tools.py"
+                        ;; "guix": "mono",
+                        ((".guix.: .mono.,")
+                         ""))))
                   (add-after 'build 'build-man-page
                     (lambda* (#:key (make-flags '()) #:allow-other-keys)
                       (apply invoke "make" "-C" "doc" make-flags)))
@@ -160,7 +175,7 @@ (define-public diffoscope
              python-pytest
              python-chardet
              python-h5py
-             python-pypdf2
+             python-pypdf
              python-progressbar33
 
              abootimg
@@ -195,6 +210,7 @@ (define-public diffoscope
              libarchive
              llvm-9
              lz4
+             lzip
              ocaml
              odt2txt
              openssh
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Thu, 19 Jan 2023 01:43:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Cc: 60941 <at> debbugs.gnu.org
Subject: Re: [bug#60941] [PATCH 1/2] gnu: Add python-pypdf.
Date: Wed, 18 Jan 2023 20:42:11 -0500
Hello,

Vagrant Cascadian <vagrant <at> reproducible-builds.org> writes:

> From e2082819efee20a72b026eebcfc14af279e424c7 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
> Date: Wed, 18 Jan 2023 16:26:41 -0800
> Subject: [PATCH 1/2] gnu: Add python-pypdf.
>
> * gnu/packages/pdf.scm (python-pypdf): New varaible.
> ---
>  gnu/packages/pdf.scm | 39 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>
> diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
> index 4b9d0623fe..cb94c29bde 100644
> --- a/gnu/packages/pdf.scm
> +++ b/gnu/packages/pdf.scm
> @@ -1260,6 +1260,45 @@ (define-public pdf2svg
>  converter using the Poppler and Cairo libraries.")
>      (license license:gpl2+)))
>  
> +(define-public python-pypdf
> +  (package
> +    (name "python-pypdf")
> +    (version "3.2.1")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (pypi-uri "pypdf" version))
> +              (sha256
> +               (base32
> +                "1pdq4nbkknx61pk8w75jvx5j921m2676wfkyizsrap5mj92cssxc"))))
> +    (build-system python-build-system)

You should use pyproject-build-system, which knows how to build a
project from a PEP 517 build system.

> +    (arguments
> +     (list #:tests? #f ;pypi source does not contains tests

When this occurs, you can fetch from git instead.  Typically Python
packages come with test suites, and this one is no exception.

> +           #:phases #~(modify-phases %standard-phases
> +                        (replace 'build
> +                          (lambda _
> +                            (invoke "flit" "build")))
> +                        (replace 'install
> +                          (lambda* (#:key inputs outputs #:allow-other-keys)
> +                            (add-installed-pythonpath inputs outputs)
> +                            (for-each (lambda (wheel)
> +                                        (invoke "python"
> +                                                "-m"
> +                                                "pip"
> +                                                "install"
> +                                                wheel
> +                                                (string-append "--prefix="
> +                                                               #$output)))
> +                                      (find-files "dist" "\\.whl$")))))))
> +    (native-inputs (list python-flit))
> +    (propagated-inputs (list python-typing-extensions))
> +    (home-page "https://github.com/py-pdf/pypdf")
> +    (synopsis
> +     "A pure-python PDF library")

guix lint should complain about the leading determinant ("A").

> +    (description
> +     "This package provides a pure-python PDF library capable of splitting, merging,
> +cropping, and transforming PDF files")

Missing period, and "pure-python" is odd.  Perhaps just "This package
provides a Python PDF library [...]"

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Thu, 19 Jan 2023 01:49:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Cc: 60941 <at> debbugs.gnu.org
Subject: Re: bug#60941: Update diffoscope to 232
Date: Wed, 18 Jan 2023 20:48:22 -0500
Hi,

Vagrant Cascadian <vagrant <at> reproducible-builds.org> writes:

> From 784d33dad1ff114e4f8043b7b766c785e7fef79f Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
> Date: Wed, 18 Jan 2023 11:00:46 -0800
> Subject: [PATCH 2/2] gnu: diffoscope: Update to 232.
>
> * gnu/packages/diffoscope.scm (diffoscope): Update to 232.
>   [native-inputs]: Add lzip and python-pdf, drop python-pypdf2.
>   [phases]: Add lzip-external-tool and remove-mono-external-tool.

Nitpick: GNU Change Logs style doesn't use a hanging indent in the left
margin (see: info '(standards) Style of Change Logs').

> ---
>  gnu/packages/diffoscope.scm | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
> index f730d976fe..59875c2e8e 100644
> --- a/gnu/packages/diffoscope.scm
> +++ b/gnu/packages/diffoscope.scm
> @@ -75,7 +75,7 @@ (define-module (gnu packages diffoscope)
>  (define-public diffoscope
>    (package
>      (name "diffoscope")
> -    (version "224")
> +    (version "232")
>      (source
>       (origin
>         (method git-fetch)
> @@ -84,7 +84,7 @@ (define-public diffoscope
>               (commit version)))
>         (file-name (git-file-name name version))
>         (sha256
> -        (base32 "1qdivsf4yygg2az5018pw0q4169zas3hfqjydd0q3bhdrfpl0q4q"))
> +        (base32 "0zix2m1rlgj7kyx8bkfjb9dnc5idblz6xhmxqq0w3jpnkxxjj8yq"))
>         (patches
>          (search-patches "diffoscope-fix-llvm-test.patch"))))
>      (build-system python-build-system)
> @@ -112,6 +112,21 @@ (define-public diffoscope
>                           (string-append "[\"" (which "stat") "\","))
>                          (("\\[\"getfacl\",")
>                           (string-append "[\"" (which "getfacl") "\",")))))
> +                  (add-after 'unpack 'lzip-external-tool
> +                    ;; Fixed upstream, remove this phase when updating to
> +                    ;; diffoscope 233

nitpick: stand-alone comments should end with a period (complete
sentence).

> +                    (lambda _
> +                      (substitute* "diffoscope/external_tools.py"
> +                        ((".debian.: .lzip.")
> +                         "\"debian\": \"lzip\", \"guix\": \"lzip\""))))
> +                  (add-after 'unpack 'remove-mono-external-tool
> +                    ;; Fixed upstream, remove this phase when updating to
> +                    ;; diffoscope 233
> +                    (lambda _
> +                      (substitute* "diffoscope/external_tools.py"
> +                        ;; "guix": "mono",
> +                        ((".guix.: .mono.,")
> +                         ""))))
>                    (add-after 'build 'build-man-page
>                      (lambda* (#:key (make-flags '()) #:allow-other-keys)

There are no #:make-flags argument for the python or pyproject build
systems, so that's useless.

>                        (apply invoke "make" "-C" "doc" make-flags)))
> @@ -160,7 +175,7 @@ (define-public diffoscope
>               python-pytest
>               python-chardet
>               python-h5py
> -             python-pypdf2
> +             python-pypdf
>               python-progressbar33
>  
>               abootimg
> @@ -195,6 +210,7 @@ (define-public diffoscope
>               libarchive
>               llvm-9
>               lz4
> +             lzip
>               ocaml
>               odt2txt
>               openssh

The rest LGTM, thanks for the update!

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Sun, 22 Jan 2023 03:28:01 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 60941 <at> debbugs.gnu.org
Subject: Re: bug#60941: Update diffoscope to 232
Date: Sat, 21 Jan 2023 19:26:47 -0800
[Message part 1 (text/plain, inline)]
On 2023-01-18, Maxim Cournoyer wrote:
> Vagrant Cascadian <vagrant <at> reproducible-builds.org> writes:
>> Subject: [PATCH 2/2] gnu: diffoscope: Update to 232.
>>
>> * gnu/packages/diffoscope.scm (diffoscope): Update to 232.
>>   [native-inputs]: Add lzip and python-pdf, drop python-pypdf2.
>>   [phases]: Add lzip-external-tool and remove-mono-external-tool.
>
> Nitpick: GNU Change Logs style doesn't use a hanging indent in the left
> margin (see: info '(standards) Style of Change Logs').

Wow, I think every single one of my commits to date has that issue... hah!


>> diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
>> index f730d976fe..59875c2e8e 100644
>> --- a/gnu/packages/diffoscope.scm
>> +++ b/gnu/packages/diffoscope.scm
...
>> +                  (add-after 'unpack 'remove-mono-external-tool
>> +                    ;; Fixed upstream, remove this phase when updating to
>> +                    ;; diffoscope 233
>> +                    (lambda _
>> +                      (substitute* "diffoscope/external_tools.py"
>> +                        ;; "guix": "mono",
>> +                        ((".guix.: .mono.,")
>> +                         ""))))
>>                    (add-after 'build 'build-man-page
>>                      (lambda* (#:key (make-flags '()) #:allow-other-keys)
>
> There are no #:make-flags argument for the python or pyproject build
> systems, so that's useless.

I would welcome a fix for that... I could not figure out how to make it
build successfully without it, but that does not say a whole lot. :)

live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Sun, 22 Jan 2023 03:32:01 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: 60941 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 1/2] gnu: Add python-pypdf.
Date: Sat, 21 Jan 2023 19:30:50 -0800
[Message part 1 (text/plain, inline)]
This series switches to pyproject-build-system, git-fetch, and has
tests! Some tests are disabled due to network access requirements and
non-free assets.
[0001-gnu-Add-python-pypdf.patch (text/x-diff, inline)]
From a7286537cf92b07798d6b537003675555c5f84ba Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Date: Sat, 21 Jan 2023 19:17:23 -0800
Subject: [PATCH 1/2] gnu: Add python-pypdf.

* gnu/packages/pdf.scm (python-pypdf): New variable.
* gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add patch.
---
 gnu/local.mk                                  |  1 +
 ...n-pypdf-annotate-tests-appropriately.patch | 96 +++++++++++++++++++
 gnu/packages/pdf.scm                          | 29 ++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3da47858ff..310c9f1f90 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1639,6 +1639,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-louvain-fix-test.patch		\
   %D%/packages/patches/python-random2-getrandbits-test.patch		\
   %D%/packages/patches/python-poppler-qt5-fix-build.patch	\
+  %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
   %D%/packages/patches/python-telingo-fix-comparison.patch	\
   %D%/packages/patches/python-w3lib-fix-test-failure.patch	\
   %D%/packages/patches/sdcc-disable-non-free-code.patch		\
diff --git a/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch b/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch
new file mode 100644
index 0000000000..14f1f73924
--- /dev/null
+++ b/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch
@@ -0,0 +1,96 @@
+Origin: https://github.com/py-pdf/pypdf/commit/767047b98ee3ea7aca331cfbd63502a284bfed93
+From 767047b98ee3ea7aca331cfbd63502a284bfed93 Mon Sep 17 00:00:00 2001
+From: dkg <dkg <at> fifthhorseman.net>
+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
+ 
+ 
++@pytest.mark.samples
+ @pytest.mark.parametrize(
+     ("src", "expected_images"),
+     [
+@@ -866,6 +867,7 @@ def test_get_fields():
+     assert dict(fields["c1-1"]) == ({"/FT": "/Btn", "/T": "c1-1"})
+ 
+ 
++@pytest.mark.external
+ 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)
+ 
+ 
++@pytest.mark.external
+ 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
+ 
+ 
++@pytest.mark.external
+ 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]
+ 
+ 
++@pytest.mark.samples
+ @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
+ 
+ 
++@pytest.mark.external
+ 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():
+     )
+ 
+ 
++@pytest.mark.external
+ 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
+ 
+ 
++@pytest.mark.external
+ 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
+ 
+ 
++@pytest.mark.external
+ 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 4b9d0623fe..446d833e51 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -1260,6 +1260,35 @@ (define-public pdf2svg
 converter using the Poppler and Cairo libraries.")
     (license license:gpl2+)))
 
+(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"))))
+    (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")))
+    (synopsis "Python PDF library")
+    (description
+     "This package provides a PDF library capable of splitting, merging,
+cropping, and transforming PDF files.")
+    (license license:bsd-3)))
+
 (define-public python-pypdf2
   (package
     (name "python-pypdf2")
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Sun, 22 Jan 2023 03:33:02 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: 60941 <at> debbugs.gnu.org
Subject: [PATCH v2 2/2] gnu: diffoscope: Update to 233.
Date: Sat, 21 Jan 2023 19:32:37 -0800
[Message part 1 (text/plain, inline)]
New upstream version which includes some of the changes monkey-patched
in from the previous version.
[0002-gnu-diffoscope-Update-to-233.patch (text/x-diff, inline)]
From 7d56d84b140931d434c8b0178797de5b93474173 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Date: Sat, 21 Jan 2023 19:17:46 -0800
Subject: [PATCH 2/2] gnu: diffoscope: Update to 233.

* gnu/packages/diffoscope.scm (diffoscope): Update to 233.
[native-inputs]: Add lzip and python-pdf, drop python-pypdf2.
---
 gnu/packages/diffoscope.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
index f730d976fe..6decb86f02 100644
--- a/gnu/packages/diffoscope.scm
+++ b/gnu/packages/diffoscope.scm
@@ -75,7 +75,7 @@ (define-module (gnu packages diffoscope)
 (define-public diffoscope
   (package
     (name "diffoscope")
-    (version "224")
+    (version "233")
     (source
      (origin
        (method git-fetch)
@@ -84,7 +84,7 @@ (define-public diffoscope
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1qdivsf4yygg2az5018pw0q4169zas3hfqjydd0q3bhdrfpl0q4q"))
+        (base32 "1m6fc7k8cd7ahra05vqccw1fdbjj6d20vr3q8v67ynnyih5nmbnb"))
        (patches
         (search-patches "diffoscope-fix-llvm-test.patch"))))
     (build-system python-build-system)
@@ -160,7 +160,7 @@ (define-public diffoscope
              python-pytest
              python-chardet
              python-h5py
-             python-pypdf2
+             python-pypdf
              python-progressbar33
 
              abootimg
@@ -195,6 +195,7 @@ (define-public diffoscope
              libarchive
              llvm-9
              lz4
+             lzip
              ocaml
              odt2txt
              openssh
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Sun, 22 Jan 2023 07:05:01 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: 60941 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [PATCH v3 1/2] gnu: Add python-pypdf.
Date: Sat, 21 Jan 2023 23:03:39 -0800
[Message part 1 (text/plain, inline)]
No change.
[0001-gnu-Add-python-pypdf.patch (text/x-diff, inline)]
From 421c017a26ffa77120a2e8792779296a141ecbb5 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Date: Sat, 21 Jan 2023 19:17:23 -0800
Subject: [PATCH 1/2] gnu: Add python-pypdf.

* gnu/packages/pdf.scm (python-pypdf): New variable.
* gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add patch.
---
 gnu/local.mk                                  |  1 +
 ...n-pypdf-annotate-tests-appropriately.patch | 96 +++++++++++++++++++
 gnu/packages/pdf.scm                          | 29 ++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3da47858ff..310c9f1f90 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1639,6 +1639,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-louvain-fix-test.patch		\
   %D%/packages/patches/python-random2-getrandbits-test.patch		\
   %D%/packages/patches/python-poppler-qt5-fix-build.patch	\
+  %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
   %D%/packages/patches/python-telingo-fix-comparison.patch	\
   %D%/packages/patches/python-w3lib-fix-test-failure.patch	\
   %D%/packages/patches/sdcc-disable-non-free-code.patch		\
diff --git a/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch b/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch
new file mode 100644
index 0000000000..14f1f73924
--- /dev/null
+++ b/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch
@@ -0,0 +1,96 @@
+Origin: https://github.com/py-pdf/pypdf/commit/767047b98ee3ea7aca331cfbd63502a284bfed93
+From 767047b98ee3ea7aca331cfbd63502a284bfed93 Mon Sep 17 00:00:00 2001
+From: dkg <dkg <at> fifthhorseman.net>
+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
+ 
+ 
++@pytest.mark.samples
+ @pytest.mark.parametrize(
+     ("src", "expected_images"),
+     [
+@@ -866,6 +867,7 @@ def test_get_fields():
+     assert dict(fields["c1-1"]) == ({"/FT": "/Btn", "/T": "c1-1"})
+ 
+ 
++@pytest.mark.external
+ 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)
+ 
+ 
++@pytest.mark.external
+ 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
+ 
+ 
++@pytest.mark.external
+ 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]
+ 
+ 
++@pytest.mark.samples
+ @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
+ 
+ 
++@pytest.mark.external
+ 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():
+     )
+ 
+ 
++@pytest.mark.external
+ 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
+ 
+ 
++@pytest.mark.external
+ 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
+ 
+ 
++@pytest.mark.external
+ 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 4b9d0623fe..446d833e51 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -1260,6 +1260,35 @@ (define-public pdf2svg
 converter using the Poppler and Cairo libraries.")
     (license license:gpl2+)))
 
+(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"))))
+    (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")))
+    (synopsis "Python PDF library")
+    (description
+     "This package provides a PDF library capable of splitting, merging,
+cropping, and transforming PDF files.")
+    (license license:bsd-3)))
+
 (define-public python-pypdf2
   (package
     (name "python-pypdf2")
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Sun, 22 Jan 2023 07:07:01 GMT) Full text and rfc822 format available.

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

From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
To: 60941 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [PATCH v3 2/2] gnu: diffoscope: Update to 233.
Date: Sat, 21 Jan 2023 23:06:21 -0800
[Message part 1 (text/plain, inline)]
Fix typo in commit message (python-pdf -> python-pypdf).

Hopefully patchwork will correctly identify the python-pypdf patch as a
dependency this time...
[0002-gnu-diffoscope-Update-to-233.patch (text/x-diff, inline)]
From 420781d76b8323df36e27dea0cd7561d150f874b Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Date: Sat, 21 Jan 2023 19:17:46 -0800
Subject: [PATCH 2/2] gnu: diffoscope: Update to 233.

* gnu/packages/diffoscope.scm (diffoscope): Update to 233.
[native-inputs]: Add lzip and python-pypdf, drop python-pypdf2.
---
 gnu/packages/diffoscope.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
index f730d976fe..6decb86f02 100644
--- a/gnu/packages/diffoscope.scm
+++ b/gnu/packages/diffoscope.scm
@@ -75,7 +75,7 @@ (define-module (gnu packages diffoscope)
 (define-public diffoscope
   (package
     (name "diffoscope")
-    (version "224")
+    (version "233")
     (source
      (origin
        (method git-fetch)
@@ -84,7 +84,7 @@ (define-public diffoscope
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1qdivsf4yygg2az5018pw0q4169zas3hfqjydd0q3bhdrfpl0q4q"))
+        (base32 "1m6fc7k8cd7ahra05vqccw1fdbjj6d20vr3q8v67ynnyih5nmbnb"))
        (patches
         (search-patches "diffoscope-fix-llvm-test.patch"))))
     (build-system python-build-system)
@@ -160,7 +160,7 @@ (define-public diffoscope
              python-pytest
              python-chardet
              python-h5py
-             python-pypdf2
+             python-pypdf
              python-progressbar33
 
              abootimg
@@ -195,6 +195,7 @@ (define-public diffoscope
              libarchive
              llvm-9
              lz4
+             lzip
              ocaml
              odt2txt
              openssh
-- 
2.39.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60941; Package guix-patches. (Mon, 23 Jan 2023 01:05:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Cc: 60941 <at> debbugs.gnu.org
Subject: Re: bug#60941: Update diffoscope to 232
Date: Sun, 22 Jan 2023 20:04:45 -0500
Hi,

Vagrant Cascadian <vagrant <at> reproducible-builds.org> writes:

[...]

>>> diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
>>> index f730d976fe..59875c2e8e 100644
>>> --- a/gnu/packages/diffoscope.scm
>>> +++ b/gnu/packages/diffoscope.scm
> ...
>>> +                  (add-after 'unpack 'remove-mono-external-tool
>>> +                    ;; Fixed upstream, remove this phase when updating to
>>> +                    ;; diffoscope 233
>>> +                    (lambda _
>>> +                      (substitute* "diffoscope/external_tools.py"
>>> +                        ;; "guix": "mono",
>>> +                        ((".guix.: .mono.,")
>>> +                         ""))))
>>>                    (add-after 'build 'build-man-page
>>>                      (lambda* (#:key (make-flags '()) #:allow-other-keys)
>>
>> There are no #:make-flags argument for the python or pyproject build
>> systems, so that's useless.
>
> I would welcome a fix for that... I could not figure out how to make it
> build successfully without it, but that does not say a whole lot. :)

I addressed it in a subsequent commit ("gnu: diffoscope: Simplify the
build-man-page phase.").

-- 
Thanks,
Maxim




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Mon, 23 Jan 2023 01:08:01 GMT) Full text and rfc822 format available.

Notification sent to Vagrant Cascadian <vagrant <at> reproducible-builds.org>:
bug acknowledged by developer. (Mon, 23 Jan 2023 01:08:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
Cc: 60941-done <at> debbugs.gnu.org
Subject: Re: [PATCH v3 2/2] gnu: diffoscope: Update to 233.
Date: Sun, 22 Jan 2023 20:07:02 -0500
Hi,

Vagrant Cascadian <vagrant <at> reproducible-builds.org> writes:

> Fix typo in commit message (python-pdf -> python-pypdf).
>
> Hopefully patchwork will correctly identify the python-pypdf patch as a
> dependency this time...
>
> From 420781d76b8323df36e27dea0cd7561d150f874b Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant <at> reproducible-builds.org>
> Date: Sat, 21 Jan 2023 19:17:46 -0800
> Subject: [PATCH 2/2] gnu: diffoscope: Update to 233.
>
> * gnu/packages/diffoscope.scm (diffoscope): Update to 233.
> [native-inputs]: Add lzip and python-pypdf, drop python-pypdf2.

Applied, along with python-pypdf.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Feb 2023 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 66 days ago.

Previous Next


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