unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 13c793811af0ef5f6057142a29607b41895410a7 1695 bytes (raw)
name: gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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)

debug log:

solving 13c793811a ...
found 13c793811a in https://yhetil.org/guix-patches/00adf56591326b3694c391c78f6a9613f9e78ba2.1703267366.git.felgru@posteo.net/

applying [1/1] https://yhetil.org/guix-patches/00adf56591326b3694c391c78f6a9613f9e78ba2.1703267366.git.felgru@posteo.net/
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

1:18: trailing whitespace.
 
1:22: trailing whitespace.
+ 
1:27: trailing whitespace.
 
1:28: trailing whitespace.
 
1:36: trailing whitespace.
 
Checking patch gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch...
Applied patch gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

index at:
100644 13c793811af0ef5f6057142a29607b41895410a7	gnu/packages/patches/python-pdfminer-six-fix-imports-in-tests.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).