From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 2H5OLU+uzGMBqAAAbAwnHQ (envelope-from ) for ; Sun, 22 Jan 2023 04:32:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wNVVLU+uzGOqDgEA9RJhRA (envelope-from ) for ; Sun, 22 Jan 2023 04:32:31 +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 66E928BE2 for ; Sun, 22 Jan 2023 04:32:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJR5P-0006J5-Mx; Sat, 21 Jan 2023 22:32: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 1pJR5O-0006Is-4Q for guix-patches@gnu.org; Sat, 21 Jan 2023 22:32: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 1pJR5N-00051g-Sa for guix-patches@gnu.org; Sat, 21 Jan 2023 22:32:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJR5N-0004bz-OK for guix-patches@gnu.org; Sat, 21 Jan 2023 22:32:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60941] [PATCH v2 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 03:32: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.167435826417657 (code B ref 60941); Sun, 22 Jan 2023 03:32:01 +0000 Received: (at 60941) by debbugs.gnu.org; 22 Jan 2023 03:31:04 +0000 Received: from localhost ([127.0.0.1]:50214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJR4S-0004ai-43 for submit@debbugs.gnu.org; Sat, 21 Jan 2023 22:31:04 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:45666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJR4Q-0004aF-CI for 60941@debbugs.gnu.org; Sat, 21 Jan 2023 22:31:03 -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 93E001AB81; Sat, 21 Jan 2023 19:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=reproducible-builds.org; s=1.vagrant; t=1674358256; bh=Z5W3Z78FY9K8IoUhKvmvF5mCSFLCie6bFVQHIfZFIAg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HMFpRqRxXlfR3+pnCiA4dgvffJ8PjjN914sUdR4tTx0Q8Io1rJBL35UY+Kdb0VD4W zSuM5j7L609FzJBXaUxd4vV0GOYMr8AJ1iq6vYJDd8dFLWy/WnQEAgzurJWojfMnqW wXROkZheWAB2GGii0u2lQ2fdJtgkWmiKuCDDkpBqA3kgq3sa0cqZe0DBn3mkXu8vr5 G2OEx+lRjdgEd2RwxA1Eh+f9GUPjcT18wD2AU/PcJvl0QJxAGqRupxf4xGyFgs3c+b 29wE/eE/tzV/HffE7iGdsSQ54KJMYFGMJU6jsTpBZDEpGSdEWiKv2AXhEJPe8lxY2d bzuBhPT/c5v+Q== From: Vagrant Cascadian In-Reply-To: <87edrrz4nd.fsf@contorta> References: <87ilh3z4vo.fsf@contorta> <87edrrz4nd.fsf@contorta> Date: Sat, 21 Jan 2023 19:30:50 -0800 Message-ID: <87bkmr6yad.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=1674358351; a=rsa-sha256; cv=none; b=nLUeyQTV+1r/Ga65/KWFT88gXMZSmP9Ib81tN+FQJEGb6uQmJl+qFCyNZTXdHvSoIMOPvH hJrYXa4CSLCn44BHEmzj73lHCWniM38LxyiUW0awf+NPdkxdqRegFrIxmur4CFmpdgW6So mEUJqD5hup/LanBxQRRQC7dt3j2/83K5lYHIH4EYMpH552TJBasnHSaiWAnFp0wCbHgc96 bGrfjPTovxZWXqgKQXqp/qfZ3LmREbATMIQWClNjQZ3LcT3CIu/ASf/r7OJZV4WHhwVeYK lg/eVmvzdIt65Tw/6DQezvw7unegPqrMGgUvvDHDdQU+AwSupMG8itxJHuSbOQ== 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=HMFpRqRx; 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=1674358351; 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=lPYgEEkf5E4jCL0Nzfe2wK4LOYf5F2nVUqEPHdf5grA=; b=oSTat2OKOd16gCn6GV4fVVJHYGAG6dTZSseLkC4hnk3w7NVgzGJ9avzgjx41vXd+LNlpsC VPjJ5DFesl3pvitRPxfoNnFoSzqBEg4YSCNd6bDYP+pMcp2gLiCDl0ahQPQzEe+BLIn6jq kSYP4RlW/o14gypCcK/3ljffww5b3k4A0ze4695ejy9K1GTd7gQL8p3PAUAM4rKMyh3QYZ j68jrOll6zm7vQeOQE3woNDgtqSJWj9Y8Gd5NCJVHKwVrvJZGkUL53bmOtAPK04ZWoGhFd TVjkbNuIISnFKEH6Z2Vqs6L6vcu0Zu/o7DowxHAx/X7IyoApn4j1+7rZw86PaQ== X-Spam-Score: -0.29 X-Migadu-Queue-Id: 66E928BE2 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reproducible-builds.org header.s=1.vagrant header.b=HMFpRqRx; 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.29 X-TUID: AyFxWxTFG1IY --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-Add-python-pypdf.patch Content-Transfer-Encoding: quoted-printable From=20a7286537cf92b07798d6b537003675555c5f84ba 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/If5cWqgUCY8yt6gAKCRDcUY/If5cW qkalAP9O9Db1R1LYSLcIpVvgGhcr1Or2CJk90EJgbiVDSIAYKwD7BfcJbGa1cELO 1uBSStzk/HwNemjeTyHRL/IGge1wpg4= =pDTE -----END PGP SIGNATURE----- --==-=-=--