summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-14 15:17:17 +0200
committerMichał Górny <mgorny@gentoo.org>2022-05-14 16:20:59 +0200
commit24d4351a4c2575dfcdef0371f0b645981398a9c0 (patch)
treebe53ff4139994f821c89a7741f2f4ba325acffca
parentdev-python/PyGithub: Enable py3.11 (diff)
downloadgentoo-24d4351a4c2575dfcdef0371f0b645981398a9c0.tar.gz
gentoo-24d4351a4c2575dfcdef0371f0b645981398a9c0.tar.bz2
gentoo-24d4351a4c2575dfcdef0371f0b645981398a9c0.zip
dev-python/jmespath: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/jmespath/files/jmespath-1.0.0-py311.patch26
-rw-r--r--dev-python/jmespath/jmespath-1.0.0.ebuild6
2 files changed, 31 insertions, 1 deletions
diff --git a/dev-python/jmespath/files/jmespath-1.0.0-py311.patch b/dev-python/jmespath/files/jmespath-1.0.0-py311.patch
new file mode 100644
index 00000000000..90c7bef9bee
--- /dev/null
+++ b/dev-python/jmespath/files/jmespath-1.0.0-py311.patch
@@ -0,0 +1,26 @@
+From 325d8111a924a951d8778c9fc1dbce30be267435 Mon Sep 17 00:00:00 2001
+From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
+Date: Wed, 10 Mar 2021 14:15:36 +0000
+Subject: [PATCH] Use list for random.sample since using a set has been
+ deprecated since Python 3.9
+
+---
+ jmespath/parser.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/jmespath/parser.py b/jmespath/parser.py
+index eeac38f..4706688 100644
+--- a/jmespath/parser.py
++++ b/jmespath/parser.py
+@@ -489,7 +489,7 @@ class Parser(object):
+ lex_position, actual_value, actual_type, message)
+
+ def _free_cache_entries(self):
+- for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)):
++ for key in random.sample(list(self._CACHE.keys()), int(self._MAX_SIZE / 2)):
+ self._CACHE.pop(key, None)
+
+ @classmethod
+--
+2.35.1
+
diff --git a/dev-python/jmespath/jmespath-1.0.0.ebuild b/dev-python/jmespath/jmespath-1.0.0.ebuild
index 18253469abc..7d281153bda 100644
--- a/dev-python/jmespath/jmespath-1.0.0.ebuild
+++ b/dev-python/jmespath/jmespath-1.0.0.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
inherit distutils-r1
@@ -32,6 +32,10 @@ BDEPEND="
distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}/${P}-py311.patch"
+)
+
src_prepare() {
# leftover import
sed -i -e '/nose/d' extra/test_hypothesis.py || die