From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sLdLJDjgzGM6zAAAbAwnHQ (envelope-from ) for ; Sun, 22 Jan 2023 08:05:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aLxnIzjgzGN6pwAAG6o9tA (envelope-from ) for ; Sun, 22 Jan 2023 08:05:28 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4A75DDCBA for ; Sun, 22 Jan 2023 08:05:28 +0100 (CET) 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 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674371128; a=rsa-sha256; cv=none; b=kRjo/0n73nJ9HotRcV6fzUiuI4q22krQVDlHMG+IBnh7vtrT3p3NnOJ6jTwIphTxcv5bS7 x/F5acQnwKaGIXh2jG1NoNJcDai3G63Qv7fPnrA83m7sdqsXRyEVMQBjVfrSn7RiUm9E51 FGxRnde7mdg/miNmb9lHH8MmV3NFONgoFGP2VvD1UDrr24D8IRK9dC68/W5X7RCh5mLr8+ 943MI2DTokLGnnGykLEIj/TRARh1egTIKoczE269QD/Q+3UVKSOMIfp3zkEV+3Af7+Wyw/ ejfBb9njURcka+8AOFvnt7NXSpRLwkOxmrtAmhY1xZuEaX9led5Ed5+T10HUrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reproducible-builds.org header.s=1.vagrant header.b=eHFna6DV; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674371128; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=lIOA41XNY0RXnaHTtvfLQMS8zZFCVSu+kJcdlTxawxo=; b=QiP9hvbUfC7wcsvG6UyzTV1KN/g5aSMqYh7cEgaOxSAw215412a7U0DVMrasNgcRRA86KM dozX5u1QnzmxMOy4wN6JOSv1oYKNuuON+xwaY62+MGYnwP2dUioy+uEYGx/hcnMhiHNJbQ ACPurexRskmcqVXpK5y4xRYgjNcuCg3P6Oy5gW4630RUyXGQcGuP6hET3qNZjwbip5c71m ppBH4AG9nx6bWfK+gkUvceeAcClbJKcduRmMm0fquSy2H4jZA3Sy3fL+0QYZzwplaAibQz Iy0vJ2y56dRCAlcWBFc92JUEN2gqnfxHpwwODj+TYDqK5aVw9GunfvzpilZDOw== X-Spam-Score: 0.21 X-Migadu-Queue-Id: 4A75DDCBA Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reproducible-builds.org header.s=1.vagrant header.b=eHFna6DV; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: 0.21 X-TUID: fhDZksZ/znwP --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain No change. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-Add-python-pypdf.patch Content-Transfer-Encoding: quoted-printable From=20421c017a26ffa77120a2e8792779296a141ecbb5 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. =2D-- 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-approp= riately.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3da47858ff..310c9f1f90 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -1639,6 +1639,7 @@ dist_patch_DATA =3D \ %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.pat= ch new file mode 100644 index 0000000000..14f1f73924 =2D-- /dev/null +++ b/gnu/packages/patches/python-pypdf-annotate-tests-appropriately.patch @@ -0,0 +1,96 @@ +Origin: https://github.com/py-pdf/pypdf/commit/767047b98ee3ea7aca331cfbd63= 502a284bfed93 +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) =3D=3D outline_elements +=20 +=20 ++@pytest.mark.samples + @pytest.mark.parametrize( + ("src", "expected_images"), + [ +@@ -866,6 +867,7 @@ def test_get_fields(): + assert dict(fields["c1-1"]) =3D=3D ({"/FT": "/Btn", "/T": "c1-1"}) +=20 +=20 ++@pytest.mark.external + def test_get_full_qualified_fields(): + url =3D "https://github.com/py-pdf/PyPDF2/files/10142389/fields_with_= dots.pdf" + name =3D "fields_with_dots.pdf" +@@ -1214,6 +1216,7 @@ def test_zeroing_xref(): + len(reader.pages) +=20 +=20 ++@pytest.mark.external + def test_thread(): + url =3D "https://github.com/py-pdf/pypdf/files/9066120/UTA_OSHA_3115_= Fall_Protection_Training_09162021_.pdf" + name =3D "UTA_OSHA.pdf" +@@ -1226,6 +1229,7 @@ def test_thread(): + assert len(reader.threads) >=3D 1 +=20 +=20 ++@pytest.mark.external + def test_build_outline_item(caplog): + url =3D "https://github.com/py-pdf/pypdf/files/9464742/shiv_resume.pd= f" + name =3D "shiv_resume.pdf" +@@ -1253,6 +1257,7 @@ def test_build_outline_item(caplog): + assert "Unexpected destination 2" in exc.value.args[0] +=20 +=20 ++@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 =3D None +=20 +=20 ++@pytest.mark.external + def test_iss471(): + url =3D "https://github.com/py-pdf/pypdf/files/9139245/book.pdf" + name =3D "book_471.pdf" +@@ -942,6 +943,7 @@ def test_iss471(): + ) +=20 +=20 ++@pytest.mark.external + def test_reset_translation(): + url =3D "https://corpora.tika.apache.org/base/docs/govdocs1/924/92466= 6.pdf" + name =3D "tika-924666.pdf" +@@ -977,6 +979,7 @@ def test_threads_empty(): + assert thr =3D=3D thr2 +=20 +=20 ++@pytest.mark.external + def test_append_without_annots_and_articles(): + url =3D "https://corpora.tika.apache.org/base/docs/govdocs1/924/92466= 6.pdf" + name =3D "tika-924666.pdf" +@@ -993,6 +996,7 @@ def test_append_without_annots_and_articles(): + assert len(writer.threads) >=3D 1 +=20 +=20 ++@pytest.mark.external + def test_append_multiple(): + url =3D "https://corpora.tika.apache.org/base/docs/govdocs1/924/92466= 6.pdf" + name =3D "tika-924666.pdf" +--=20 +2.39.1 + diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 4b9d0623fe..446d833e51 100644 =2D-- 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+))) =20 +(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") =2D-=20 2.39.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCY8zfzAAKCRDcUY/If5cW quOtAP48C8oh/a7gOUVQH+5r/M+AhdthE+/knTKzd3a8ukd5XgEA0Vk3qrD1J7WX P+awPkgfldAw9Zq8ApNxImDmCv1yBwg= =maXQ -----END PGP SIGNATURE----- --==-=-=--