From patchwork Fri Dec 22 17:49:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Gruber X-Patchwork-Id: 57988 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 9238727BBEA; Fri, 22 Dec 2023 17:51:28 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 1D51A27BBE2 for ; Fri, 22 Dec 2023 17:51:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGjfx-0000Ew-NP; Fri, 22 Dec 2023 12:51:09 -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 1rGjfn-0000EE-8X for guix-patches@gnu.org; Fri, 22 Dec 2023 12:50:59 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGjfn-0000kN-01; Fri, 22 Dec 2023 12:50:59 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGjfq-0006XC-GQ; Fri, 22 Dec 2023 12:51:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67970] [PATCH] gnu: python-pdfminer-six: Update to 20221105. Resent-From: Felix Gruber Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Fri, 22 Dec 2023 17:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67970 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67970@debbugs.gnu.org Cc: Felix Gruber , Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , jgart X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , jgart Received: via spool by submit@debbugs.gnu.org id=B.170326740425033 (code B ref -1); Fri, 22 Dec 2023 17:51:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Dec 2023 17:50:04 +0000 Received: from localhost ([127.0.0.1]:47840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGjet-0006Ve-EN for submit@debbugs.gnu.org; Fri, 22 Dec 2023 12:50:04 -0500 Received: from lists.gnu.org ([2001:470:142::17]:33940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGjep-0006V2-9X for submit@debbugs.gnu.org; Fri, 22 Dec 2023 12:50:01 -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 1rGjee-00009z-W7 for guix-patches@gnu.org; Fri, 22 Dec 2023 12:49:49 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGjec-0006XC-BU for guix-patches@gnu.org; Fri, 22 Dec 2023 12:49:48 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5EA09240027 for ; Fri, 22 Dec 2023 18:49:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703267382; bh=wzlGYC+uak40H7q8qGOud73880xV+lDlgfRA8YcJ+hg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=ffC5xKjPI2YWfc65SVqh4lKwbwAqnMx2t/OSJobF95KUwIySHBPYzZ8+07BKpOgft wNEkELZhY4KpV1JujWWe0giu3mMP/tlyHqL8ATiYZOSh0aEZ4Xlm+BV2e+GBvxv4EU 8Qxk+Y9Rp4EeCeCIodyR6+LdugFfeECn7TFZA3c6fp8WhGBLwcf0OfhdqZwqMBrpEZ tqJjDFS8/3aQzohjHZbVU910R0ZRVdea6le73vj3qB8AJcNZr+sPLO6ODU3UyFolT+ VlzNo9urv12y+U/gYys4gBSdlZB0KVR1CVklXWsiRA28fuwkk53Sp8hQ3odVvl2TVo dWZC6APseDVBA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SxZYw53v3z6tvp; Fri, 22 Dec 2023 18:49:40 +0100 (CET) From: Felix Gruber Date: Fri, 22 Dec 2023 17:49:26 +0000 Message-ID: <00adf56591326b3694c391c78f6a9613f9e78ba2.1703267366.git.felgru@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=felgru@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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 * gnu/packages/python-xyz.scm (python-pdfminer-six): Update to 20221105. [build-system]: Use pyproject-build-system. [arguments]: Convert to gexp, remove custom 'check phase and add new phase to fix version. [propagated-inputs]: Remove python-chardet and python-sortedcontainers; add python-charset-normalizer. [native-inputs]: Remove python-nose and python-tox; add python-pytest. * gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Change-Id: I9913385a681b32afde930e32e7379db91357177b --- gnu/local.mk | 1 + ...on-pdfminer-six-fix-imports-in-tests.patch | 41 +++++++++++++++++++ gnu/packages/python-xyz.scm | 33 ++++++++------- 3 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch base-commit: ca813173894360edef35a5d98878a3135e99e62a diff --git a/gnu/local.mk b/gnu/local.mk index caf2bb16fa..6e56c5ed38 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1773,6 +1773,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-feedparser-missing-import.patch \ %D%/packages/patches/python-louvain-fix-test.patch \ %D%/packages/patches/python-random2-getrandbits-test.patch \ + %D%/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch \ %D%/packages/patches/python-poppler-qt5-fix-build.patch \ %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \ %D%/packages/patches/python-sip-include-dirs.patch \ diff --git a/gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch b/gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch new file mode 100644 index 0000000000..13c793811a --- /dev/null +++ b/gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch @@ -0,0 +1,41 @@ +Fix import errors during tests. + +See https://github.com/pdfminer/pdfminer.six/issues/896 + +This patch has been taken from +https://build.opensuse.org/package/view_file/openSUSE:Factory/python-pdfminer.six/import-from-non-pythonpath-files.patch + +diff '--color=auto' -rub pdfminer.six-20221105.orig/tests/test_tools_dumppdf.py pdfminer.six-20221105/tests/test_tools_dumppdf.py +--- pdfminer.six-20221105.orig/tests/test_tools_dumppdf.py 2022-11-05 12:22:08.000000000 -0400 ++++ pdfminer.six-20221105/tests/test_tools_dumppdf.py 2023-12-11 12:12:06.044210731 -0500 +@@ -4,7 +4,11 @@ + + from helpers import absolute_sample_path + from tempfilepath import TemporaryFilePath +-from tools import dumppdf ++ ++import importlib.util ++spec = importlib.util.spec_from_file_location("dumppdf", "tools/dumppdf.py") ++dumppdf = importlib.util.module_from_spec(spec) ++spec.loader.exec_module(dumppdf) + + + def run(filename, options=None): +diff '--color=auto' -rub pdfminer.six-20221105.orig/tests/test_tools_pdf2txt.py pdfminer.six-20221105/tests/test_tools_pdf2txt.py +--- pdfminer.six-20221105.orig/tests/test_tools_pdf2txt.py 2022-11-05 12:22:08.000000000 -0400 ++++ pdfminer.six-20221105/tests/test_tools_pdf2txt.py 2023-12-11 12:12:40.848031179 -0500 +@@ -3,10 +3,13 @@ + from tempfile import mkdtemp + import filecmp + +-import tools.pdf2txt as pdf2txt + from helpers import absolute_sample_path + from tempfilepath import TemporaryFilePath + ++import importlib.util ++spec = importlib.util.spec_from_file_location("pdf2txt", "tools/pdf2txt.py") ++pdf2txt = importlib.util.module_from_spec(spec) ++spec.loader.exec_module(pdf2txt) + + def run(sample_path, options=None): + absolute_path = absolute_sample_path(sample_path) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 404177e9cd..18019cc859 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -18188,7 +18188,7 @@ (define-public python-jellyfish (define-public python-pdfminer-six (package (name "python-pdfminer-six") - (version "20201018") + (version "20221105") ;; There are no tests in the PyPI tarball. (source (origin @@ -18198,23 +18198,26 @@ (define-public python-pdfminer-six (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1a2fxxnnjqbx344znpvx7cnv1881dk6585ibw01inhfq3w6yj2lr")))) - (build-system python-build-system) + (base32 "06gqlpv7vakd3nr20mf2x161z9a9bbvxnvf424i3wzlq3d01w89v")) + (patches + (search-patches "python-pdfminer-six-fix-imports-in-tests.patch")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - ;; Tests write to the source tree. - (add-after 'unpack 'make-git-checkout-writable - (lambda _ - (for-each make-file-writable (find-files ".")) - #t)) - (replace 'check - (lambda _ - (invoke "make" "test")))))) + (list #:phases + #~(modify-phases %standard-phases + ;; Tests write to the source tree. + (add-after 'unpack 'make-git-checkout-writable + (lambda _ + (for-each make-file-writable (find-files ".")))) + (add-after 'make-git-checkout-writable 'patch + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "pdfminer/__init__.py" + ;; Replace version placeholder with actual version. + (("__VERSION__") #$(package-version this-package)))))))) (propagated-inputs - (list python-chardet python-cryptography python-sortedcontainers)) + (list python-charset-normalizer python-cryptography)) (native-inputs - (list python-nose python-tox)) + (list python-pytest)) (home-page "https://github.com/pdfminer/pdfminer.six") (synopsis "PDF parser and analyzer") (description "@code{pdfminer.six} is a community maintained fork of