From patchwork Sun Jan 22 07:03:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 46336 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AADA427BBED; Sun, 22 Jan 2023 07:05:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3FBFC27BBEB for ; Sun, 22 Jan 2023 07:05:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJUPa-000370-VB; Sun, 22 Jan 2023 02:05:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJUPW-00036m-Pt for guix-patches@gnu.org; Sun, 22 Jan 2023 02:05:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJUPW-0005Ky-BQ for guix-patches@gnu.org; Sun, 22 Jan 2023 02:05:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJUPV-0001uz-Om for guix-patches@gnu.org; Sun, 22 Jan 2023 02:05:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60941] [PATCH v3 1/2] gnu: Add python-pypdf. Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 22 Jan 2023 07:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60941 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 60941@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 60941-submit@debbugs.gnu.org id=B60941.16743710517310 (code B ref 60941); Sun, 22 Jan 2023 07:05:01 +0000 Received: (at 60941) by debbugs.gnu.org; 22 Jan 2023 07:04:11 +0000 Received: from localhost ([127.0.0.1]:50503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJUOg-0001tp-Cq for submit@debbugs.gnu.org; Sun, 22 Jan 2023 02:04:10 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:54764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJUOd-0001tc-Gy for 60941@debbugs.gnu.org; Sun, 22 Jan 2023 02:04:08 -0500 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:7:77:0:20]) (Authenticated sender: vagrant@aikidev.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 2A6BF1AB85; Sat, 21 Jan 2023 23:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=reproducible-builds.org; s=1.vagrant; t=1674371040; bh=fxXuv779JzSXuxorDLVNrgOo0Uc6QYoTalPp8UazDL4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eHFna6DVFzmoJqMZTgCoqfVHGCWzB9qjvDuILqTab74PJQS4vI5x/ixXJhRwHsyGQ 5n/K29NdJzA2NpLtTXkZiaAjY4nH6M7SPdwVftalA1QFK5xPZdDYgyuiLySnpQvTKc dHYkXN6eYbR6mc8AqXwJmKSuvdmlZOhSAxI7sVowUbuJat1PDvMRHpfkDoxgCjoOv7 ByYPom3uFWGWxBv7P/B2WBMEYlrkiEPQA7MBHuH4yE7fHLs2QYOyJQpID3j12tjoth qh8bnDggiPjmTD45mFW+qsp81DzJvxfn5xl+pCpZtW1Hee4cPUM1EArxX89M12oUfq 53600BmS8XJyw== From: Vagrant Cascadian In-Reply-To: <87bkmr6yad.fsf@contorta> References: <87ilh3z4vo.fsf@contorta> <87edrrz4nd.fsf@contorta> <87bkmr6yad.fsf@contorta> Date: Sat, 21 Jan 2023 23:03:39 -0800 Message-ID: <87ilgzuk38.fsf@contorta> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches No change. From 421c017a26ffa77120a2e8792779296a141ecbb5 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian 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 +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 From patchwork Sun Jan 22 07:06:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 46337 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4EC8827BBED; Sun, 22 Jan 2023 07:07:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8ED9D27BBEB for ; Sun, 22 Jan 2023 07:07:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJURT-0003ll-VJ; Sun, 22 Jan 2023 02:07:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJURS-0003ld-IV for guix-patches@gnu.org; Sun, 22 Jan 2023 02:07:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJURS-0005z9-7U for guix-patches@gnu.org; Sun, 22 Jan 2023 02:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJURR-0001xz-Vo for guix-patches@gnu.org; Sun, 22 Jan 2023 02:07:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60941] [PATCH v3 2/2] gnu: diffoscope: Update to 233. Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 22 Jan 2023 07:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60941 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 60941@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 60941-submit@debbugs.gnu.org id=B60941.16743711927525 (code B ref 60941); Sun, 22 Jan 2023 07:07:01 +0000 Received: (at 60941) by debbugs.gnu.org; 22 Jan 2023 07:06:32 +0000 Received: from localhost ([127.0.0.1]:50507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJUQy-0001xI-8A for submit@debbugs.gnu.org; Sun, 22 Jan 2023 02:06:32 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:45330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJUQx-0001x6-2I for 60941@debbugs.gnu.org; Sun, 22 Jan 2023 02:06:31 -0500 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:7:77:0:20]) (Authenticated sender: vagrant@aikidev.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 5C6291AB85; Sat, 21 Jan 2023 23:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=reproducible-builds.org; s=1.vagrant; t=1674371185; bh=M9i9uMPKhvB98XQfzMwxCIYHaKOnvos24UoeEOuO84E=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=tTxld690GfqZJKHXFGC0krJul7nqZom5hbLVPYOi7GpRrexxVZ11SJ7JHGLZSAbWf ZUbWMW3ps1f/plYnMJT2esaMDZh6QnyE4N5W9D6UlxZbFShBQjChBR5lAGutDO5DcT /PcK28iDrPH6aA+lXtNsR5Vin/DuG+lGJgU/dacrKH3VSQXs32KoGRvFtlchUckYpu tKHneTV/p1bMjauSJFRMwcfcBjA0W8gEn+S6lZN6blyx+KUyjfQsKryPInLKmeLBYF oiReLZQUgwfGrGj5Azm7WJiwGuVfko964BoIGxXUJ2CDDQORR2hblcTny6Gh+u1L4R dz0L9rusRXMdw== From: Vagrant Cascadian In-Reply-To: <87ilgzuk38.fsf@contorta> References: <87ilh3z4vo.fsf@contorta> <87edrrz4nd.fsf@contorta> <87bkmr6yad.fsf@contorta> <87ilgzuk38.fsf@contorta> Date: Sat, 21 Jan 2023 23:06:21 -0800 Message-ID: <87edrnujyq.fsf@contorta> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 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