summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2017-03-18 21:36:26 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2017-03-18 22:30:21 +0100
commit7897e8625ed181e6824e415be337239dbb152b0c (patch)
tree9bac640faa062508c54730ddb0637c4117fcd985 /dev-python/PyPDF2
parentdev-python/PyQt5: version bump (diff)
downloadgentoo-7897e8625ed181e6824e415be337239dbb152b0c.tar.gz
gentoo-7897e8625ed181e6824e415be337239dbb152b0c.tar.bz2
gentoo-7897e8625ed181e6824e415be337239dbb152b0c.zip
dev-python/PyPDF2: 1.26.0 version bump, add py3{5,6}, fix tests, EAPI 6
Gentoo-bug: 606466 Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'dev-python/PyPDF2')
-rw-r--r--dev-python/PyPDF2/Manifest1
-rw-r--r--dev-python/PyPDF2/PyPDF2-1.26.0.ebuild32
-rw-r--r--dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch35
3 files changed, 68 insertions, 0 deletions
diff --git a/dev-python/PyPDF2/Manifest b/dev-python/PyPDF2/Manifest
index 3dc667a9eaca..a674fded38f1 100644
--- a/dev-python/PyPDF2/Manifest
+++ b/dev-python/PyPDF2/Manifest
@@ -1,2 +1,3 @@
DIST PyPDF2-1.24.tar.gz 59891 SHA256 aca40d5155524120fceaf2eb4ae054480b8a2b6ffcfa0a2e77e3e45666428c64 SHA512 91a9338b0338eee1cfddc25dd0f21494f73696e630b08a71ff9195fe7b0fc77cf6c07b38a0c6aa4856536be6fe0a474c3b292c13fdd0187b62cb8848e69b29f9 WHIRLPOOL b5d33c209d5e0ce7d2d567d9266faacbbc6c1e49ac714e0063eeeb3879f400482a3fa887bd165b364a7216b4240b5236dec1954683ade632ea802a36a5272303
DIST PyPDF2-1.25.1.tar.gz 194181 SHA256 43d324f70f8994c25a08e6edc02ec2d5c1e84c9231d3537f785b3f97641182eb SHA512 0cb43d4557d17ec82298ceabce5c4731438a0e16ad6c6b2abc54204a3d93373a46b86c995e9b39cec475de1dce325d552da17ce36de3733c7b0471779e3b0899 WHIRLPOOL 71467c2b43d462fde0486a1ca9c300bc3c6b048c21450affa6f09e3b2a5b893b5125fec10cb6ac9d1c1157fdfacdcf5c5b6ed37a1e3742f95595b3f76bd9868a
+DIST PyPDF2-1.26.0.tar.gz 77556 SHA256 e28f902f2f0a1603ea95ebe21dff311ef09be3d0f0ef29a3e44a932729564385 SHA512 7b427f1d099dcd687a718fb8d86e6f677ad45257414c6367e4dfacd8dfef7e3dbe3816027359868764981f36a30721f1731b4c23cbe2f35cfab1c64fb290b034 WHIRLPOOL 0f96818874f77bfef9d60e3bb84a648ec5366911fbb365d2e9ce965ef7321df845a85fede714e14dcb73e87d85bdc72af38ce40c2ed3ae096bd9daf07a7204b2
diff --git a/dev-python/PyPDF2/PyPDF2-1.26.0.ebuild b/dev-python/PyPDF2/PyPDF2-1.26.0.ebuild
new file mode 100644
index 000000000000..97788638f041
--- /dev/null
+++ b/dev-python/PyPDF2/PyPDF2-1.26.0.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python library to work with pdf files"
+HOMEPAGE="https://pypi.python.org/pypi/${PN}/ https://github.com/mstamy2/PyPDF2"
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples"
+
+PATCHES=( "${FILESDIR}/${P}-py3-tests.patch" )
+
+python_test() {
+ "${EPYTHON}" -m unittest Tests.tests || die "Tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+ if use examples; then
+ docinto examples
+ dodoc -r Sample_Code/.
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch b/dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch
new file mode 100644
index 000000000000..c74491b964a3
--- /dev/null
+++ b/dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch
@@ -0,0 +1,35 @@
+From 6b46d03ee3a5bd5c2c18fae8aec8a0020ee68add Mon Sep 17 00:00:00 2001
+From: Venelin Stoykov <vkstoykov@gmail.com>
+Date: Sat, 26 Dec 2015 17:26:00 +0200
+Subject: [PATCH 2/3] Fix tests for Python 3
+
+---
+ Tests/tests.py | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/Tests/tests.py b/Tests/tests.py
+index fa93c10..83b5951 100644
+--- a/Tests/tests.py
++++ b/Tests/tests.py
+@@ -27,14 +27,15 @@ def test_PdfReaderFileLoad(self):
+ ipdf_p1 = ipdf.getPage(0)
+
+ # Retrieve the text of the PDF
+- pdftext_file = open(os.path.join(RESOURCE_ROOT, 'crazyones.txt'), 'r')
+- pdftext = pdftext_file.read()
+- ipdf_p1_text = ipdf_p1.extractText().replace('\n', '')
++ with open(os.path.join(RESOURCE_ROOT, 'crazyones.txt'), 'rb') as pdftext_file:
++ pdftext = pdftext_file.read()
++
++ ipdf_p1_text = ipdf_p1.extractText().replace('\n', '').encode('utf-8')
+
+ # Compare the text of the PDF to a known source
+- self.assertEqual(ipdf_p1_text.encode('utf-8', errors='ignore'), pdftext,
++ self.assertEqual(ipdf_p1_text, pdftext,
+ msg='PDF extracted text differs from expected value.\n\nExpected:\n\n%r\n\nExtracted:\n\n%r\n\n'
+- % (pdftext, ipdf_p1_text.encode('utf-8', errors='ignore')))
++ % (pdftext, ipdf_p1_text))
+
+
+ class AddJsTestCase(unittest.TestCase):
+