commit:     14f9b996d4ffbc5f9ea6af578521806332f39c66
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  1 07:06:55 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun  1 07:24:05 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14f9b996

dev-python/pycryptodome: enable py3.12

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../pycryptodome-3.18.0-python3.12-unittest.patch  | 22 ++++++++++++++++++++++
 dev-python/pycryptodome/pycryptodome-3.18.0.ebuild |  7 ++++---
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git 
a/dev-python/pycryptodome/files/pycryptodome-3.18.0-python3.12-unittest.patch 
b/dev-python/pycryptodome/files/pycryptodome-3.18.0-python3.12-unittest.patch
new file mode 100644
index 000000000000..6e49a784af16
--- /dev/null
+++ 
b/dev-python/pycryptodome/files/pycryptodome-3.18.0-python3.12-unittest.patch
@@ -0,0 +1,22 @@
+https://github.com/Legrandin/pycryptodome/pull/746
+
+From 9d70fbca927516b31ef61fd7cc3ed3e0ebc95fa6 Mon Sep 17 00:00:00 2001
+From: Sam James <s...@gentoo.org>
+Date: Thu, 1 Jun 2023 08:03:18 +0100
+Subject: [PATCH] Replace deprecated unittest aliases for Python 3.12
+
+See https://docs.python.org/3.12/whatsnew/3.12.html#removed.
+--- a/lib/Crypto/SelfTest/PublicKey/test_import_ECC.py
++++ b/lib/Crypto/SelfTest/PublicKey/test_import_ECC.py
+@@ -2269,9 +2269,9 @@ def test_import_x509_pem(self):
+     def test_import_openssh_public(self):
+         key_file = load_file("ecc_ed25519_public_openssh.txt")
+         key = ECC._import_openssh_public(key_file)
+-        self.failIf(key.has_private())
++        self.assertFalse(key.has_private())
+         key = ECC.import_key(key_file)
+-        self.failIf(key.has_private())
++        self.assertFalse(key.has_private())
+ 
+     def test_import_openssh_private_clear(self):
+         key_file = load_file("ecc_ed25519_private_openssh.pem")

diff --git a/dev-python/pycryptodome/pycryptodome-3.18.0.ebuild 
b/dev-python/pycryptodome/pycryptodome-3.18.0.ebuild
index 71faf0d17415..cb0b4894d406 100644
--- a/dev-python/pycryptodome/pycryptodome-3.18.0.ebuild
+++ b/dev-python/pycryptodome/pycryptodome-3.18.0.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} pypy3 )
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
 PYTHON_REQ_USE="threads(+)"
 
 inherit distutils-r1
@@ -26,11 +26,11 @@ SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
 
 DEPEND="
-       dev-libs/gmp:0=
+       dev-libs/gmp:=
        >=dev-libs/libtomcrypt-1.18.2-r1:=
 "
 BDEPEND="
-       virtual/python-cffi[${PYTHON_USEDEP}]
+       $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
 "
 RDEPEND="
        ${DEPEND}
@@ -40,6 +40,7 @@ RDEPEND="
 
 PATCHES=(
        "${FILESDIR}/pycryptodome-3.10.1-system-libtomcrypt.patch"
+       "${FILESDIR}/pycryptodome-3.18.0-python3.12-unittest.patch"
 )
 
 python_prepare_all() {

Reply via email to