summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Kohler <bkohler@gentoo.org>2023-01-05 13:23:29 -0600
committerBen Kohler <bkohler@gentoo.org>2023-01-05 13:24:06 -0600
commite3e8ac48167e35a51288d9cedaf8a5fd8526e9cf (patch)
tree9937db6a17a58981bc4f64ddfb92e9ed3400475c
parentpackage.deprecated: Add dev-python/nox proactively (diff)
downloadgentoo-e3e8ac48167e35a51288d9cedaf8a5fd8526e9cf.tar.gz
gentoo-e3e8ac48167e35a51288d9cedaf8a5fd8526e9cf.tar.bz2
gentoo-e3e8ac48167e35a51288d9cedaf8a5fd8526e9cf.zip
dev-python/stapler: revbump to move to dev-python/pypdf
Signed-off-by: Ben Kohler <bkohler@gentoo.org>
-rw-r--r--dev-python/stapler/files/stapler-1.0.0_p20220330-PyPDF2-to-pypdf.patch39
-rw-r--r--dev-python/stapler/stapler-1.0.0_p20220330-r3.ebuild30
2 files changed, 69 insertions, 0 deletions
diff --git a/dev-python/stapler/files/stapler-1.0.0_p20220330-PyPDF2-to-pypdf.patch b/dev-python/stapler/files/stapler-1.0.0_p20220330-PyPDF2-to-pypdf.patch
new file mode 100644
index 000000000000..e82005743c90
--- /dev/null
+++ b/dev-python/stapler/files/stapler-1.0.0_p20220330-PyPDF2-to-pypdf.patch
@@ -0,0 +1,39 @@
+diff --git a/staplelib/commands.py b/staplelib/commands.py
+index caf75f9..e67f419 100644
+--- a/staplelib/commands.py
++++ b/staplelib/commands.py
+@@ -4,7 +4,7 @@ import math
+ import os
+
+ try:
+- from PyPDF2 import PdfWriter, PdfReader
++ from pypdf import PdfWriter, PdfReader
+ except:
+ from pyPdf import PdfWriter, PdfReader
+
+diff --git a/staplelib/iohelper.py b/staplelib/iohelper.py
+index 8df365c..5474898 100644
+--- a/staplelib/iohelper.py
++++ b/staplelib/iohelper.py
+@@ -7,7 +7,7 @@ import re
+ import sys
+
+ try:
+- from PyPDF2 import PdfWriter, PdfReader
++ from pypdf import PdfWriter, PdfReader
+ except ImportError:
+ from pyPdf import PdfWriter, PdfReader
+
+diff --git a/staplelib/tests.py b/staplelib/tests.py
+index 86db178..423406d 100755
+--- a/staplelib/tests.py
++++ b/staplelib/tests.py
+@@ -5,7 +5,7 @@ import shutil
+ import tempfile
+ import unittest
+
+-from PyPDF2 import PdfReader
++from pypdf import PdfReader
+
+ from staplelib import main, CommandError
+
diff --git a/dev-python/stapler/stapler-1.0.0_p20220330-r3.ebuild b/dev-python/stapler/stapler-1.0.0_p20220330-r3.ebuild
new file mode 100644
index 000000000000..23e77887dad0
--- /dev/null
+++ b/dev-python/stapler/stapler-1.0.0_p20220330-r3.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+DISTUTILS_USE_PEP517=poetry
+
+inherit distutils-r1
+
+COMMIT="382f1edc62296e071093a5419811a2fca9d78d93"
+
+DESCRIPTION="Suite of tools for PDF files manipulation written in Python"
+HOMEPAGE="https://github.com/hellerbarde/stapler"
+SRC_URI="https://github.com/hellerbarde/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="test? ( dev-python/pypdf[${PYTHON_USEDEP}] )"
+RDEPEND="dev-python/pypdf[${PYTHON_USEDEP}]"
+
+distutils_enable_tests unittest
+
+PATCHES=( "${FILESDIR}"/${P}-fix-tests-for-PyPDF2-2.x.patch
+ "${FILESDIR}"/${P}-port-to-PyPDF2-3.0.0.patch
+ "${FILESDIR}"/${P}-use-poetry-core-backend-for-PEP517.patch
+ "${FILESDIR}"/${P}-PyPDF2-to-pypdf.patch )