public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pdfrw/files/, dev-python/pdfrw/
@ 2021-02-17 21:56 Steve Arnold
  0 siblings, 0 replies; only message in thread
From: Steve Arnold @ 2021-02-17 21:56 UTC (permalink / raw
  To: gentoo-commits

commit:     01d2e9ec85aad891e9a7ba4d8a62aab1d1e314fb
Author:     Steve Arnold <nerdboy <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 17 21:55:05 2021 +0000
Commit:     Steve Arnold <nerdboy <AT> gentoo <DOT> org>
CommitDate: Wed Feb 17 21:56:25 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01d2e9ec

dev-python/pdfrw: add missing bits and cleanup cruft

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Steve Arnold <nerdboy <AT> gentoo.org>

 .../pdfrw-fix-import-collections-warning.patch     | 48 ++++++++++++++++++++++
 ...frw-static-fix-import-collections-warning.patch | 26 ++++++++++++
 dev-python/pdfrw/pdfrw-0.4_p1.ebuild               |  8 ++--
 3 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/dev-python/pdfrw/files/pdfrw-fix-import-collections-warning.patch b/dev-python/pdfrw/files/pdfrw-fix-import-collections-warning.patch
new file mode 100644
index 00000000000..fe5971264d8
--- /dev/null
+++ b/dev-python/pdfrw/files/pdfrw-fix-import-collections-warning.patch
@@ -0,0 +1,48 @@
+diff --git a/pdfrw/pdfreader.py b/pdfrw/pdfreader.py
+index 2c9c3a2..feb025b 100644
+--- a/pdfrw/pdfreader.py
++++ b/pdfrw/pdfreader.py
+@@ -12,9 +12,10 @@ of the object.
+ '''
+ import gc
+ import binascii
+-import collections
+ import itertools
+ 
++from collections import defaultdict
++
+ from .errors import PdfParseError, log
+ from .tokens import PdfTokens
+ from .objects import PdfDict, PdfArray, PdfName, PdfObject, PdfIndirect
+@@ -340,7 +341,7 @@ class PdfReader(PdfDict):
+ 
+     def parse_xref_stream(self, source, int=int, range=range,
+                           enumerate=enumerate, islice=itertools.islice,
+-                          defaultdict=collections.defaultdict,
++                          defaultdict=defaultdict,
+                           hexlify=binascii.hexlify):
+         ''' Parse (one of) the cross-reference file section(s)
+         '''
+diff --git a/tests/expected.py b/tests/expected.py
+index d153fc3..62c29aa 100644
+--- a/tests/expected.py
++++ b/tests/expected.py
+@@ -12,8 +12,8 @@
+ '''
+ 
+ import os
+-import collections
+ from pdfrw.py23_diffs import convert_load
++from collections import defaultdict
+ 
+ root_dir = os.path.dirname(__file__)
+ result_dir = 'tmp_results'
+@@ -28,7 +28,7 @@ for sourcef in ('mytests.txt', 'expected.txt'):
+ 
+ 
+ def results():
+-    results = collections.defaultdict(set)
++    results = defaultdict(set)
+     with open(expectedf, 'rb') as f:
+         for line in f:
+             line = convert_load(line)

diff --git a/dev-python/pdfrw/files/pdfrw-static-fix-import-collections-warning.patch b/dev-python/pdfrw/files/pdfrw-static-fix-import-collections-warning.patch
new file mode 100644
index 00000000000..95d20358a4b
--- /dev/null
+++ b/dev-python/pdfrw/files/pdfrw-static-fix-import-collections-warning.patch
@@ -0,0 +1,26 @@
+diff --git a/__main__.py b/__main__.py
+index 55c6e3a..fa9dd47 100644
+--- a/tests/static_pdfs/__main__.py
++++ b/tests/static_pdfs/__main__.py
+@@ -14,10 +14,11 @@ Part of github.com/pmaupin/static_pdfs.
+ 
+ import sys
+ import os
+-import collections
+ import hashlib
+ import static_pdfs
+ 
++from collections import defaultdict
++
+ params = sys.argv[1:]
+ 
+ destroy = params == ['destroy']
+@@ -35,7 +36,7 @@ md5.
+ ''')
+ 
+ 
+-found = collections.defaultdict(list)
++found = defaultdict(list)
+ 
+ sys.stdout.write('\n\nReading PDFs:\n\n')
+ 

diff --git a/dev-python/pdfrw/pdfrw-0.4_p1.ebuild b/dev-python/pdfrw/pdfrw-0.4_p1.ebuild
index 701e68557c1..97423711ace 100644
--- a/dev-python/pdfrw/pdfrw-0.4_p1.ebuild
+++ b/dev-python/pdfrw/pdfrw-0.4_p1.ebuild
@@ -3,16 +3,16 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{7..8} )
 
 inherit distutils-r1
 
 PDFS_COMMIT=d646009a0e3e71daf13a52ab1029e2230920ebf4
 DESCRIPTION="PDF file reader/writer library"
-HOMEPAGE="https://github.com/pmaupin/pdfrw"
+HOMEPAGE="https://github.com/sarnold/pdfrw"
 
 if [[ ${PV} = 9999* ]]; then
-	EGIT_REPO_URI="https://github.com/sarnold/hexdump.git"
+	EGIT_REPO_URI="https://github.com/sarnold/pdfrw.git"
 	EGIT_BRANCH="main"
 	inherit git-r3
 else
@@ -21,7 +21,7 @@ else
 	SRC_URI="https://github.com/sarnold/${PN}/archive/${MY_PV}.tar.gz -> ${PN}-${MY_PV}.tar.gz
 		test? ( https://github.com/pmaupin/static_pdfs/archive/${PDFS_COMMIT}.tar.gz
 			-> pdfrw-static_pdfs-${PDFS_COMMIT}.tar.gz )"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+	KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ppc ppc64 sparc x86"
 	S="${WORKDIR}/${MY_P}"
 fi
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-17 21:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-17 21:56 [gentoo-commits] repo/gentoo:master commit in: dev-python/pdfrw/files/, dev-python/pdfrw/ Steve Arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox