summaryrefslogtreecommitdiff
path: root/dev-python/PyPDF2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/PyPDF2
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/PyPDF2')
-rw-r--r--dev-python/PyPDF2/Manifest4
-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
-rw-r--r--dev-python/PyPDF2/metadata.xml12
4 files changed, 83 insertions, 0 deletions
diff --git a/dev-python/PyPDF2/Manifest b/dev-python/PyPDF2/Manifest
new file mode 100644
index 000000000000..b741ae19548d
--- /dev/null
+++ b/dev-python/PyPDF2/Manifest
@@ -0,0 +1,4 @@
+AUX PyPDF2-1.26.0-py3-tests.patch 1452 BLAKE2B bdeb36156cf9b6eec975f0b92f85cb6794259081ec8766b316e94efdf90ddf4bd2401fe1954d87e841628aa90b0978e9899f7562c5c15d71c2c271c6e8537894 SHA512 434d1cb0fb934149054d16521ca414291cbb83618de1468a2a9e630e75fddad4c33c3ba254ae00315b2075faad333b9b027625adda3a0cf064df3366989ea399
+DIST PyPDF2-1.26.0.tar.gz 77556 BLAKE2B 8ce9b95165a3841154b6e38e24ca5a4db434ceef9c55fbf2d146b379586160cb985948e0feb7aed135f601535d034ef79ddc1af58a670b07ff7d3621907022ec SHA512 7b427f1d099dcd687a718fb8d86e6f677ad45257414c6367e4dfacd8dfef7e3dbe3816027359868764981f36a30721f1731b4c23cbe2f35cfab1c64fb290b034
+EBUILD PyPDF2-1.26.0.ebuild 746 BLAKE2B 41d693906689e39d3aaa7d0bd49995420f72204ee19446c27bad89f865a45f31a2ce39d2625f9c415c5dbcc6d304e612678755225c6f080a5b79c5e30dea84a9 SHA512 cb892d15e7d9102f89f24539cb305cda2af9026ee2069b5d85040d32f57166652f8ae222e5b2696263df5d3841cdc78d6ba50ad39d6e4b2f0abf7cb4344403f1
+MISC metadata.xml 375 BLAKE2B 70bd4053cc8b7a65a31c3480f4205ff4945af86675b5f58a22efd3d27947b40cf49591746ae90d314e24d69d44dce606ef32b2c6fd7fac8aa1d431c6256c6c59 SHA512 9da6355a60e212e6e5ee3ac1c5cd1c357b243ab3131b2f6d261a4039c6cbc67c1e375be8685c900c533a0273b017b6d4428c7521539b917a2c380f9435b3cefa
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..9f803913a9b2
--- /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.org/project/${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):
+
diff --git a/dev-python/PyPDF2/metadata.xml b/dev-python/PyPDF2/metadata.xml
new file mode 100644
index 000000000000..ad27f68ce22a
--- /dev/null
+++ b/dev-python/PyPDF2/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">PyPDF2</remote-id>
+ <remote-id type="github">mstamy2/PyPDF2</remote-id>
+ </upstream>
+</pkgmetadata>