summaryrefslogtreecommitdiff
path: root/dev-python
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/Manifest.gzbin260504 -> 260505 bytes
-rw-r--r--dev-python/blosc/Manifest6
-rw-r--r--dev-python/blosc/blosc-1.10.6.ebuild2
-rw-r--r--dev-python/blosc/blosc-1.11.0.ebuild2
-rw-r--r--dev-python/blosc/blosc-1.11.1.ebuild2
-rw-r--r--dev-python/pytables/Manifest3
-rw-r--r--dev-python/pytables/files/pytables-3.8.0-blosc2.patch30
-rw-r--r--dev-python/pytables/pytables-3.8.0.ebuild83
-rw-r--r--dev-python/stapler/Manifest6
-rw-r--r--dev-python/stapler/files/stapler-1.0.0_p20220330-fix-tests-for-PyPDF2-2.x.patch13
-rw-r--r--dev-python/stapler/files/stapler-1.0.0_p20220330-port-to-PyPDF2-3.0.0.patch302
-rw-r--r--dev-python/stapler/files/stapler-1.0.0_p20220330-use-poetry-core-backend-for-PEP517.patch32
-rw-r--r--dev-python/stapler/stapler-1.0.0_p20220330-r1.ebuild (renamed from dev-python/stapler/stapler-1.0.0_p20220330.ebuild)4
-rw-r--r--dev-python/stapler/stapler-1.0.0_p20220330-r2.ebuild29
14 files changed, 505 insertions, 9 deletions
diff --git a/dev-python/Manifest.gz b/dev-python/Manifest.gz
index bbc2ccefb474..bfd1fb2462c7 100644
--- a/dev-python/Manifest.gz
+++ b/dev-python/Manifest.gz
Binary files differ
diff --git a/dev-python/blosc/Manifest b/dev-python/blosc/Manifest
index ddce994aeed3..7cacca2d325c 100644
--- a/dev-python/blosc/Manifest
+++ b/dev-python/blosc/Manifest
@@ -1,7 +1,7 @@
DIST python-blosc-1.10.6.gh.tar.gz 1570504 BLAKE2B 44f444fa5050a6198e83649973fc82d6804eec50bf79c332ed6a974e417f2a58baf09480a9bb5c5b7abcef2a961cd7bc61f962c12db625b1a7c48799ace0b39a SHA512 e283b132ebb91e7ce362ec65a1d6760e3793046371ea545a9e842372084182bcc194c3a0e1cb20914de58554063995a238ea0a129214731689e8cd5f4203d3ed
DIST python-blosc-1.11.0.gh.tar.gz 111589 BLAKE2B 6bc5dda4e40ceb9770dd5b6e6db1fced42e257475b220bcb530c8b291bf132f61013ece5934a7d47778fdac716fcea0e6d57b7543b1cc76ccd95201cad072bdd SHA512 94c6f470b9f6e8d1fec0e44709e84582cd595291dddcd07ea174665a6fc12e029c6f0c781c8e506e95d4f9ee9fc27cbbfb5bc2789f341df3e84f342626dcfdb0
DIST python-blosc-1.11.1.gh.tar.gz 111262 BLAKE2B cb348253a24258d2649ebc0604acbf936b8ccc2b28c42c69da2fee72ddf87eb17a24657bc5d3c0530193a60f482555ce4cc5d168a18d9c2d79a13410d40670bc SHA512 21f8a697a3a902860a6ed72233984cf00c464ec0ddde9842a0c24b1e8e5ec4dd57b872096445a873d162d7529cba5c3666ba2a3ee3f9b1b18107d9636011281c
-EBUILD blosc-1.10.6.ebuild 1042 BLAKE2B 2d3b7779dc3e9e7e79e3129bc8edd1257d780f44bb5881fc605a83a3aa3e6da06601647deb040d15c39449b5b5407805deb4e955f89bf74c522d459430ee3640 SHA512 d94ab6390fc8f9164743c21620d6a9f938cf5cad81c95ce066c0ccebafd9613e0c13d121dacb989f0bea37331de616e8c691e1047e0cce9638c6bf1ebcef0e4e
-EBUILD blosc-1.11.0.ebuild 1143 BLAKE2B df20c0359e33412df97a669fe4d4b97b557af0bcac2f1b4a7f4d35db9241cfd3878e7c98da6aca089d421e4563d8b772a0684f5acc70b78e0ad63985edf2b148 SHA512 6aad7c48c61647710bae3dc7fca077928dd45557ec28ed31e390fb4c05b9b795fa8108cc23a5f65ed2618e09cdddec3d53283fb4c705a4e832d3d963c3eb8f0d
-EBUILD blosc-1.11.1.ebuild 1143 BLAKE2B df20c0359e33412df97a669fe4d4b97b557af0bcac2f1b4a7f4d35db9241cfd3878e7c98da6aca089d421e4563d8b772a0684f5acc70b78e0ad63985edf2b148 SHA512 6aad7c48c61647710bae3dc7fca077928dd45557ec28ed31e390fb4c05b9b795fa8108cc23a5f65ed2618e09cdddec3d53283fb4c705a4e832d3d963c3eb8f0d
+EBUILD blosc-1.10.6.ebuild 1042 BLAKE2B 30cefd3a041c9b5c638cc489aaceb58cef67f1dc4d2c0b2ed0f13331c6ff05f651cb5e9a067a270947c1d2702a9f4237c6ff09dc5bfc1442d62f291ad3132523 SHA512 ed84422242255d3efddebc194a69c7860db9ae1ac2731c4d7d1b8411a426126d570e0ba03de34b712cb840a006d47ba1fe1d7564ab2e02ac6a26be47f886db0d
+EBUILD blosc-1.11.0.ebuild 1143 BLAKE2B fbdb450aeeaa031914f32df803859ab83cb422d72622028bc481c1d4c163b4e5ffe27ffc4e84fbc47e5cca6332528d2181f3e22366b1ceee6997c00eafef45d3 SHA512 40cfba9b345bdf31c5b146ae63dd5a7365c0aca4724aaf3d4054103e16971d699af385d8acdda3205137bdf563ea691fd46b74f7434dfdedcac222594daed973
+EBUILD blosc-1.11.1.ebuild 1143 BLAKE2B fbdb450aeeaa031914f32df803859ab83cb422d72622028bc481c1d4c163b4e5ffe27ffc4e84fbc47e5cca6332528d2181f3e22366b1ceee6997c00eafef45d3 SHA512 40cfba9b345bdf31c5b146ae63dd5a7365c0aca4724aaf3d4054103e16971d699af385d8acdda3205137bdf563ea691fd46b74f7434dfdedcac222594daed973
MISC metadata.xml 999 BLAKE2B e8ab94b206c8364bc10de6e57872e6f4264927118269fe74dc040d5fc1c8fae7b3422a62c6d675b47a87168f03eec83a8ea16210bfd1f7e11920ae94844d9546 SHA512 5dec5341aa068659bb74d206ed7ffc96bc47d1128eb48827ec189be38d9112079c37a140dadc6326ba84352ccbeeac453888391920737bbf73153431d8be1720
diff --git a/dev-python/blosc/blosc-1.10.6.ebuild b/dev-python/blosc/blosc-1.10.6.ebuild
index 42cd0539a1e7..73831d084092 100644
--- a/dev-python/blosc/blosc-1.10.6.ebuild
+++ b/dev-python/blosc/blosc-1.10.6.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
S=${WORKDIR}/${MY_P}
SLOT="0"
-LICENSE="MIT"
+LICENSE="BSD"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="!test? ( test )"
diff --git a/dev-python/blosc/blosc-1.11.0.ebuild b/dev-python/blosc/blosc-1.11.0.ebuild
index b7526777e9b2..613432958855 100644
--- a/dev-python/blosc/blosc-1.11.0.ebuild
+++ b/dev-python/blosc/blosc-1.11.0.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
S=${WORKDIR}/${MY_P}
SLOT="0"
-LICENSE="MIT"
+LICENSE="BSD"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="!test? ( test )"
diff --git a/dev-python/blosc/blosc-1.11.1.ebuild b/dev-python/blosc/blosc-1.11.1.ebuild
index b7526777e9b2..613432958855 100644
--- a/dev-python/blosc/blosc-1.11.1.ebuild
+++ b/dev-python/blosc/blosc-1.11.1.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
S=${WORKDIR}/${MY_P}
SLOT="0"
-LICENSE="MIT"
+LICENSE="BSD"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="!test? ( test )"
diff --git a/dev-python/pytables/Manifest b/dev-python/pytables/Manifest
index c20c84cfd05b..4a859791c662 100644
--- a/dev-python/pytables/Manifest
+++ b/dev-python/pytables/Manifest
@@ -1,3 +1,6 @@
+AUX pytables-3.8.0-blosc2.patch 842 BLAKE2B 1ab97a9b0d5c5e435671c00cb8d5ab77048f9eea493a716846e7d350f902487c2098d43d194c5373ca4297f0d266b723a3d9eb59f69836278adfbb4a75c22820 SHA512 b64944a0916b7da5543b518e16fc70ead6b2f7c0bfdb79bf0e49549067464997b9906bb2b1d0d02b32abbe315135c09e64ffec91fc57b8f87117c33564684b25
DIST tables-3.7.0.tar.gz 8227955 BLAKE2B 0d5b7b765375c4787f1210138e5fd02e3c0ce429ef209a3a8d4fd3bc094f68486ab6f4d0a960ce86efea6991ed691ef2a3e9e8f37a49fe91cb8d6372cadea80e SHA512 eaa368d063b5fad87e6d0f9ab6f02da0b2a3542740a52fe8c2bb58e41121495d07b6d2710ad402a28891294aa61a11238c6a7e2cf2933a1bb11391b79cf4fd13
+DIST tables-3.8.0.tar.gz 8014052 BLAKE2B 28d120ad609ebc9ae8cd97286bb3fb9c484bd8a179edcf0de1b96e4400b7a21b4db835d94fae3aaee84924bd46b84b84da12c538b39517362d805651e7aa3aef SHA512 1616c00787a2e88ff3dc2aebe3a1b2ad428b5a8ea48fc94058b49c509f1c040b540b3f62551b16b3246d2fed58e0b33443cbdaaf1dfcba5a6eead5f3e8028029
EBUILD pytables-3.7.0.ebuild 1645 BLAKE2B 1878a51553ea7e069b3968ad92f7eb62490d14e7f47b5e4be71bd9d0e2a792ba1980d011d7571de014a344ea48f35ab8fcb00129f87758c5482e2d206c635f61 SHA512 db1a8c323e04500c581565125d3bbb5da9bcee9049f0b62789223b8320c743533746135169fc94b70094ee82868412eb0fa24d8ec995a3519c6aff0bde401251
+EBUILD pytables-3.8.0.ebuild 1646 BLAKE2B 525f537f398dff01949d29ab3ce4fee4ded8c50b491b5c294f2761658b67c539b690a4020dc7526b0e40b7a71c59f68c7755471e170724c030387a007382b6fa SHA512 80af2622bf243a2c0e8dfb296f9cde63ea067aaad0f5371ccd0d706935246a116d3b6c11f2ae6fc7a8fc8c4668938462e7d82430ccc13641b98f7bb0d926517e
MISC metadata.xml 897 BLAKE2B 7723b2f6b3fb46cd11fb8c80502f472e1539f0fa16b9a73a750515c4450aa62986bbca72646c101b4171972feca60f84de8349df1282b0b03c88a319299b0520 SHA512 ad65bf568eb36d4dc85a2154d52e470362b210c12bfb5a865a884aac04c0973bffde4f345ac3b20bace2fe511c1b0cabebddc40abf928c082ebcfd6280d1c681
diff --git a/dev-python/pytables/files/pytables-3.8.0-blosc2.patch b/dev-python/pytables/files/pytables-3.8.0-blosc2.patch
new file mode 100644
index 000000000000..59403cdec12d
--- /dev/null
+++ b/dev-python/pytables/files/pytables-3.8.0-blosc2.patch
@@ -0,0 +1,30 @@
+From 99a7f336635aaeb666ea8dc791743177a030dc18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 28 Dec 2022 15:53:08 +0100
+Subject: [PATCH] Workaround blosc2 detection via blosc2 package
+
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 966be028..2708deb9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -262,11 +262,11 @@ if __name__ == "__main__":
+
+ debug = "--debug" in sys.argv
+
+- blosc2_inc, blosc2_lib = get_blosc2_directories()
++ blosc2_inc, blosc2_lib = "", ""
+
+ # Global variables
+ lib_dirs = [blosc2_lib]
+- inc_dirs = [Path("hdf5-blosc/src"), Path("hdf5-blosc2/src"), blosc2_inc]
++ inc_dirs = [Path("hdf5-blosc/src"), Path("hdf5-blosc2/src")]
+ optional_libs = []
+ copy_libs = []
+
+--
+2.39.0
+
diff --git a/dev-python/pytables/pytables-3.8.0.ebuild b/dev-python/pytables/pytables-3.8.0.ebuild
new file mode 100644
index 000000000000..889a681566ed
--- /dev/null
+++ b/dev-python/pytables/pytables-3.8.0.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+MY_PN=tables
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Hierarchical datasets for Python"
+HOMEPAGE="
+ https://www.pytables.org/
+ https://github.com/PyTables/PyTables/
+ https://pypi.org/project/tables/
+"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="examples test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ app-arch/bzip2:0=
+ app-arch/lz4:0=
+ >=app-arch/zstd-1.0.0:=
+ >=dev-libs/c-blosc-1.11.1:0=
+ dev-libs/c-blosc2:=
+ dev-libs/lzo:2=
+ >=dev-python/numpy-1.19[${PYTHON_USEDEP}]
+ >=sci-libs/hdf5-1.8.4:=
+"
+RDEPEND="
+ ${DEPEND}
+ >=dev-python/numexpr-2.6.2[${PYTHON_USEDEP}]
+ dev-python/packaging[${PYTHON_USEDEP}]
+ dev-python/py-cpuinfo[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ >=dev-python/cython-0.21[${PYTHON_USEDEP}]
+ dev-python/py-cpuinfo[${PYTHON_USEDEP}]
+ virtual/pkgconfig
+ test? (
+ ${RDEPEND}
+ )
+"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${P}-blosc2.patch
+ )
+
+ export PYTABLES_NO_EMBEDDED_LIBS=1
+ export USE_PKGCONFIG=TRUE
+
+ rm -r c-blosc/{blosc,internal-complibs} || die
+ rm tables/libblosc2.so || die
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ distutils-r1_python_compile -j1
+}
+
+python_test() {
+ cd "${BUILD_DIR}"/lib* || die
+ "${EPYTHON}" tables/tests/test_all.py -v || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use examples; then
+ dodoc -r contrib examples
+ docompress -x /usr/share/doc/${PF}/{contrib,examples}
+ fi
+}
diff --git a/dev-python/stapler/Manifest b/dev-python/stapler/Manifest
index 18bc2b2aa098..68747d923237 100644
--- a/dev-python/stapler/Manifest
+++ b/dev-python/stapler/Manifest
@@ -1,3 +1,7 @@
+AUX stapler-1.0.0_p20220330-fix-tests-for-PyPDF2-2.x.patch 317 BLAKE2B 7000903663d5843388203d4cb4984a93c93cd1524a877df0c1d8a474805b4b85701f903ab813b0afa9ef8b8bef3faae771822b6e28522e17cda014299b933d16 SHA512 c7f35ae69db4eb5d61d63a2a56e15315444696168a080dc81d2839f815d975c2da92cdf36f39e7bd8a38958889b1f588dce38c435fcec7fc5e7cd62e3b25befe
+AUX stapler-1.0.0_p20220330-port-to-PyPDF2-3.0.0.patch 11876 BLAKE2B bcb22eece9e360e32bc6ef40ccdaac176fa6c2b265d962c52b399497f8347291f597a6a3b806fdf315937509d32b68bed79ccc580b2b4eb4789a5b7d4fbba2a6 SHA512 698cdbf12d36549c7e35c636b76e98bffe0f5b826bda8872f6a06a0cdb815bd855a63dc250a4f30aeb459d572db4fd54af81371664fd48cbf35aaf9b3f759061
+AUX stapler-1.0.0_p20220330-use-poetry-core-backend-for-PEP517.patch 1080 BLAKE2B 6342f8cc0931736aa6868749552da18d1c41656815f954826c6e9b2b1be0a18b45f8a8baac95d3e0f364c7c53ec7c6efb888a67b162134a9165f387e6d0c7824 SHA512 26b8d141dd765be117e9df42b78d79f68f1593e09420badb10793df007d031189627d2b3bab36635228a4337bb5b9c199472be41953be3973dd20bdddbffed11
DIST stapler-1.0.0_p20220330.tar.gz 43659 BLAKE2B 10c24868d51086b37dd2d517aa84e3c3fc0b6becc7a29ebf496646bdd65494eb0c43488f725241d7bd7b3083ce5703538db3e05de9976a2e5029731fc2e645d2 SHA512 acd2dfec0dfab46b2cf6b440cba6c0db5399be2ba2194ca12530c311c6c5a8028614164af45b850061e7d22cbec33458ceff7757f1b104c722228dc2d02cae0a
-EBUILD stapler-1.0.0_p20220330.ebuild 772 BLAKE2B 2aa6b23c568e71eefa094778df9b4682b584626c1a123a6e45abde791a712a8a2779e846b6234881b5fba15c6587a183ae53593e0718969b083f3d72f92e315f SHA512 a3ee15f9f513044c3f0aca35e1cd9aa7caee4b3fd8d8c979becfc67a978945e93580dd52e4104670c7042a82f11643a3e63bfe97385260dfc2619089a78a3ad2
+EBUILD stapler-1.0.0_p20220330-r1.ebuild 778 BLAKE2B 85f68550da515ac0c356dabb10758fab37efea3eff6b9c00689d560b60079b38f37a2ea32666a40696039dbbd51d5caf8d4b5266920a2b63c61ec0cdb55735fe SHA512 aad862b317e8179a6700af6eb3e838b2d9b5fcc06b6eaa11373d42329355524106ce262f14ebaf5ebfb1becc1d520acaefe53e8487ebaad2eb40fe4a248eb764
+EBUILD stapler-1.0.0_p20220330-r2.ebuild 861 BLAKE2B 9efdd79049bb7758f55202bf183fa967c680135d5879aabd25d50e535a883945018f788e11aeddd61cbd89501397b7ffa53944ada83321e97baacd29b97e52ce SHA512 fae04dac057c79b38cecdb1004a9495b3a3665f2ffc4a6aee0f5622fa02ed2a7bb4b8b34216c289fdb5458c1bf488ace17a935110f09356d45c6a09122919869
MISC metadata.xml 398 BLAKE2B 3c566702150e77dd0ba58f667336f57c0347422496edeb4fdd53e0f131cb966d15781a5d5b5e13211b2385e410a1d12c064c3ffe66056395b6eeeccdcca1cc72 SHA512 802c118d28a07f7fba6558aaa8f60aef0ebf137395af566e273ba1d218712d1835c74f82c5160f12d120d8776cbaf4fe7d09827a84c1a5e234fef307e0835a18
diff --git a/dev-python/stapler/files/stapler-1.0.0_p20220330-fix-tests-for-PyPDF2-2.x.patch b/dev-python/stapler/files/stapler-1.0.0_p20220330-fix-tests-for-PyPDF2-2.x.patch
new file mode 100644
index 000000000000..125b06a7735a
--- /dev/null
+++ b/dev-python/stapler/files/stapler-1.0.0_p20220330-fix-tests-for-PyPDF2-2.x.patch
@@ -0,0 +1,13 @@
+diff --git a/staplelib/tests.py b/staplelib/tests.py
+index 4d59153..447d48a 100755
+--- a/staplelib/tests.py
++++ b/staplelib/tests.py
+@@ -5,7 +5,7 @@ import shutil
+ import tempfile
+ import unittest
+
+-from PyPDF2.pdf import PdfFileReader
++from PyPDF2 import PdfFileReader
+
+ from staplelib import main, CommandError
+
diff --git a/dev-python/stapler/files/stapler-1.0.0_p20220330-port-to-PyPDF2-3.0.0.patch b/dev-python/stapler/files/stapler-1.0.0_p20220330-port-to-PyPDF2-3.0.0.patch
new file mode 100644
index 000000000000..91eea95ae217
--- /dev/null
+++ b/dev-python/stapler/files/stapler-1.0.0_p20220330-port-to-PyPDF2-3.0.0.patch
@@ -0,0 +1,302 @@
+From 48d6ab21369f1e71dc57890f9bf78fff66c00a90 Mon Sep 17 00:00:00 2001
+From: Ben Kohler <bkohler@gentoo.org>
+Date: Wed, 28 Dec 2022 10:08:30 -0600
+Subject: [PATCH 2/2] Port to PyPDF2-3.0.0
+
+Lots of functions got renamed in the recent PyPDF2-3.0.0 release
+
+Signed-off-by: Ben Kohler <bkohler@gentoo.org>
+---
+ staplelib/commands.py | 46 +++++++++++++++++++++----------------------
+ staplelib/iohelper.py | 12 +++++------
+ staplelib/tests.py | 34 ++++++++++++++++----------------
+ 3 files changed, 46 insertions(+), 46 deletions(-)
+
+diff --git a/staplelib/commands.py b/staplelib/commands.py
+index d37bfa7..caf75f9 100644
+--- a/staplelib/commands.py
++++ b/staplelib/commands.py
+@@ -4,9 +4,9 @@ import math
+ import os
+
+ try:
+- from PyPDF2 import PdfFileWriter, PdfFileReader
++ from PyPDF2 import PdfWriter, PdfReader
+ except:
+- from pyPdf import PdfFileWriter, PdfFileReader
++ from pyPdf import PdfWriter, PdfReader
+
+ from . import CommandError, iohelper
+ import staplelib
+@@ -33,7 +33,7 @@ def select(args, inverse=False):
+ if not filesandranges or not outputfilename:
+ raise CommandError("Both input and output filenames are required.")
+
+- output = PdfFileWriter()
++ output = PdfWriter()
+ try:
+ for input in filesandranges:
+ pdf = input['pdf']
+@@ -44,21 +44,21 @@ def select(args, inverse=False):
+ if not inverse:
+ pagerange = input['pages'] or [
+ (p, iohelper.ROTATION_NONE) for p in
+- range(1, pdf.getNumPages() + 1)]
++ range(1, len(pdf.pages) + 1)]
+ else:
+ excluded = [p for p, r in input['pages']]
+ pagerange = [(p, iohelper.ROTATION_NONE) for p in
+- range(1, pdf.getNumPages() + 1) if
++ range(1, len(pdf.pages) + 1) if
+ p not in excluded]
+
+ for pageno, rotate in pagerange:
+- if 1 <= pageno <= pdf.getNumPages():
++ if 1 <= pageno <= len(pdf.pages):
+ if verbose:
+ print("Using page: {} (rotation: {} deg.)".format(
+ pageno, rotate))
+
+- output.addPage(pdf.getPage(pageno-1)
+- .rotateClockwise(rotate))
++ output.add_page(pdf.pages[pageno-1]
++ .rotate(rotate))
+ else:
+ raise CommandError("Page {} not found in {}.".format(
+ pageno, input['name']))
+@@ -98,14 +98,14 @@ def split(args):
+ base,
+ '_',
+ '%0',
+- str(math.ceil(math.log10(input.getNumPages()))),
++ str(math.ceil(math.log10(len(input.pages)))),
+ 'd',
+ ext
+ ])
+
+- for pageno in range(input.getNumPages()):
+- output = PdfFileWriter()
+- output.addPage(input.getPage(pageno))
++ for pageno in range(len(input.pages)):
++ output = PdfWriter()
++ output.add_page(input.pages[pageno])
+
+ outputname = output_template % (pageno + 1)
+ if verbose:
+@@ -150,17 +150,17 @@ def zip_pdf_pages(filesandranges, verbose):
+ # empty range means "include all pages"
+ pagerange = input['pages'] or [
+ (p, iohelper.ROTATION_NONE) for p in
+- range(1, pdf.getNumPages() + 1)]
++ range(1, len(pdf.pages) + 1)]
+
+ pagestozip = []
+ for pageno, rotate in pagerange:
+- if 1 <= pageno <= pdf.getNumPages():
++ if 1 <= pageno <= len(pdf.pages):
+ if verbose:
+ print("Using page: {} (rotation: {} deg.)".format(
+ pageno, rotate))
+
+- pagestozip.append(pdf.getPage(pageno-1)
+- .rotateClockwise(rotate))
++ pagestozip.append(pdf.pages[pageno-1]
++ .rotate(rotate))
+ else:
+ raise CommandError("Page {} not found in {}.".format(
+ pageno, input['name']))
+@@ -181,7 +181,7 @@ def background(args):
+ try:
+ filestozip = zip_pdf_pages(filesandranges, verbose)
+
+- output = PdfFileWriter()
++ output = PdfWriter()
+ for pageno in range(max(map(len, filestozip))):
+ page = None
+ for listno in range(len(filestozip)):
+@@ -190,8 +190,8 @@ def background(args):
+ if not page:
+ page = p
+ else:
+- page.mergePage(p)
+- output.addPage(page)
++ page.merge_page(p)
++ output.add_page(page)
+
+ except Exception as e:
+ import sys
+@@ -213,11 +213,11 @@ def zip(args):
+ filestozip = zip_pdf_pages(filesandranges, verbose)
+
+ # Interweave pages.
+- output = PdfFileWriter()
++ output = PdfWriter()
+ for pageno in range(max(map(len, filestozip))):
+ for listno in range(len(filestozip)):
+ if pageno < len(filestozip[listno]):
+- output.addPage(filestozip[listno][pageno])
++ output.add_page(filestozip[listno][pageno])
+
+ _write_output(output, outputfilename)
+
+@@ -266,7 +266,7 @@ def pdf_page_enumeration(pdf):
+ pagelabels = pdf.trailer["/Root"]["/PageLabels"]
+ except:
+ # ("No /Root/PageLabels object"), so infer the list.
+- return range(1, pdf.getNumPages() + 1)
++ return range(1, len(pdf.pages) + 1)
+
+ # """Select the item that is most likely to contain the information you desire; e.g.
+ # {'/Nums': [0, IndirectObject(42, 0)]}
+@@ -292,7 +292,7 @@ def pdf_page_enumeration(pdf):
+ style = '/D'
+ prefix = ''
+ next_pageno = 1
+- for i in range(0, pdf.getNumPages()):
++ for i in range(0, len(pdf.pages)):
+ if len(pagelabels_nums_list) > 0 and i >= pagelabels_nums_list[0]:
+ pagelabels_nums_list.pop(0) # discard index
+ pnle = pagelabels_nums_list.pop(0)
+diff --git a/staplelib/iohelper.py b/staplelib/iohelper.py
+index 959e900..8df365c 100644
+--- a/staplelib/iohelper.py
++++ b/staplelib/iohelper.py
+@@ -7,9 +7,9 @@ import re
+ import sys
+
+ try:
+- from PyPDF2 import PdfFileWriter, PdfFileReader
++ from PyPDF2 import PdfWriter, PdfReader
+ except ImportError:
+- from pyPdf import PdfFileWriter, PdfFileReader
++ from pyPdf import PdfWriter, PdfReader
+
+
+ from . import CommandError
+@@ -31,8 +31,8 @@ def read_pdf(filename):
+ """Open a PDF file with PyPDF2."""
+ if not os.path.exists(filename):
+ raise CommandError("{} does not exist".format(filename))
+- pdf = PdfFileReader(open(filename, "rb"))
+- if pdf.isEncrypted:
++ pdf = PdfReader(open(filename, "rb"))
++ if pdf.is_encrypted:
+ while True:
+ pw = prompt_for_pw(filename)
+ matched = pdf.decrypt(pw)
+@@ -46,7 +46,7 @@ def read_pdf(filename):
+ def write_pdf(pdf, filename):
+ force = staplelib.OPTIONS.force
+
+- """Write the content of a PdfFileWriter object to a file."""
++ """Write the content of a PdfWriter object to a file."""
+ if os.path.exists(filename) and not force:
+ raise CommandError("File already exists: {}".format(filename))
+
+@@ -123,7 +123,7 @@ def parse_ranges(handles_files_and_ranges):
+ "page range '{}'".format(handle_key, inputname))
+
+ current = operations[-1]
+- max_page = current['pdf'].getNumPages()
++ max_page = len(current['pdf'].pages)
+ # allow "end" as alias for the last page
+ replace_end = lambda page: (
+ max_page if page.lower() == 'end' else int(page))
+diff --git a/staplelib/tests.py b/staplelib/tests.py
+index 4d59153..3350dfc 100755
+--- a/staplelib/tests.py
++++ b/staplelib/tests.py
+@@ -5,7 +5,7 @@ import shutil
+ import tempfile
+ import unittest
+
+-from PyPDF2 import PdfFileReader
++from PyPDF2 import PdfReader
+
+ from staplelib import main, CommandError
+
+@@ -38,40 +38,40 @@ class TestStapler(unittest.TestCase):
+ self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 6)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 6)
+
+ def test_sel_one_page(self):
+ """Test select of a one page from a PDF file."""
+ run_stapler(['sel', 'A=' + FIVEPAGE_PDF, 'A2', self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 1)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 1)
+
+ def test_sel_range(self):
+ """Test select of more pages from a PDF file."""
+ run_stapler(['cat', 'A=' + FIVEPAGE_PDF, 'A2-4', self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 3)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 3)
+
+ def test_del_one_page(self):
+ """Test del command for inverse select of one page."""
+ run_stapler(['del', 'A=' + FIVEPAGE_PDF, 'A1', self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 4)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 4)
+
+ def test_del_range(self):
+ """Test del command for inverse select multiple pages."""
+ run_stapler(['del', 'A=' + FIVEPAGE_PDF, 'A2-4', self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 2)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 2)
+
+ def test_split(self):
+ """Make sure a file is properly split into pages."""
+@@ -81,24 +81,24 @@ class TestStapler(unittest.TestCase):
+ self.assertEqual(len(filelist), 5)
+ for f in os.listdir(self.tmpdir):
+ with open(os.path.join(self.tmpdir, f), 'rb') as pdf_file:
+- pdf = PdfFileReader(pdf_file)
+- self.assertEqual(pdf.getNumPages(), 1)
++ pdf = PdfReader(pdf_file)
++ self.assertEqual(len(pdf.pages), 1)
+
+ def test_background(self):
+ """Test background."""
+ run_stapler(['background', ONEPAGE_PDF, FIVEPAGE_PDF, self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 5)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 5)
+
+ def test_zip(self):
+ """Test zip."""
+ run_stapler(['zip', ONEPAGE_PDF, FIVEPAGE_PDF, self.outputfile])
+ self.assertTrue(os.path.isfile(self.outputfile))
+ with open(self.outputfile, 'rb') as outputfile:
+- pdf = PdfFileReader(outputfile)
+- self.assertEqual(pdf.getNumPages(), 6)
++ pdf = PdfReader(outputfile)
++ self.assertEqual(len(pdf.pages), 6)
+
+ def test_output_file_already_exists(self):
+ """Test zip."""
+--
+2.39.0
+
diff --git a/dev-python/stapler/files/stapler-1.0.0_p20220330-use-poetry-core-backend-for-PEP517.patch b/dev-python/stapler/files/stapler-1.0.0_p20220330-use-poetry-core-backend-for-PEP517.patch
new file mode 100644
index 000000000000..276df746791f
--- /dev/null
+++ b/dev-python/stapler/files/stapler-1.0.0_p20220330-use-poetry-core-backend-for-PEP517.patch
@@ -0,0 +1,32 @@
+From 3907d86f515ff0e9f042df7111515205e9abaa11 Mon Sep 17 00:00:00 2001
+From: Ben Kohler <bkohler@gentoo.org>
+Date: Thu, 26 May 2022 13:33:38 -0500
+Subject: [PATCH 1/2] pyproject.toml: use poetry-core backend for PEP517
+
+Per poetry upstream, "If your pyproject.toml file still references
+poetry directly as a build backend, you should update it to reference
+poetry-core instead."
+
+https://python-poetry.org/docs/pyproject/#poetry-and-pep-517
+https://projects.gentoo.org/python/guide/distutils.html#deprecated-pep-517-backends
+
+Signed-off-by: Ben Kohler <bkohler@gentoo.org>
+---
+ pyproject.toml | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index efa98ea..d34823e 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -28,5 +28,5 @@ pdf-stapler = 'staplelib:main'
+
+ # this section is for PEP517 compliance. It is technically unnecessary if using Poetry
+ [build-system]
+-requires = ["poetry>=1.0"]
+-build-backend = "poetry.masonry.api"
++requires = ["poetry-core>=1.0.0"]
++build-backend = "poetry.core.masonry.api"
+--
+2.39.0
+
diff --git a/dev-python/stapler/stapler-1.0.0_p20220330.ebuild b/dev-python/stapler/stapler-1.0.0_p20220330-r1.ebuild
index 4f7a695bcf35..ba151de7317e 100644
--- a/dev-python/stapler/stapler-1.0.0_p20220330.ebuild
+++ b/dev-python/stapler/stapler-1.0.0_p20220330-r1.ebuild
@@ -19,8 +19,8 @@ LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-DEPEND="test? ( dev-python/PyPDF2[${PYTHON_USEDEP}] )"
-RDEPEND="dev-python/PyPDF2[${PYTHON_USEDEP}]"
+DEPEND="test? ( <dev-python/PyPDF2-3[${PYTHON_USEDEP}] )"
+RDEPEND="<dev-python/PyPDF2-3[${PYTHON_USEDEP}]"
distutils_enable_tests unittest
diff --git a/dev-python/stapler/stapler-1.0.0_p20220330-r2.ebuild b/dev-python/stapler/stapler-1.0.0_p20220330-r2.ebuild
new file mode 100644
index 000000000000..93ca68b5fcee
--- /dev/null
+++ b/dev-python/stapler/stapler-1.0.0_p20220330-r2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2022 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/PyPDF2-3.0.0[${PYTHON_USEDEP}] )"
+RDEPEND=">=dev-python/PyPDF2-3.0.0[${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 )