Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/jmespath/files/, dev-python/jmespath/
Date: Sat, 14 May 2022 14:21:06
Message-Id: 1652538059.24d4351a4c2575dfcdef0371f0b645981398a9c0.mgorny@gentoo
1 commit: 24d4351a4c2575dfcdef0371f0b645981398a9c0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 14 13:17:17 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat May 14 14:20:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24d4351a
7
8 dev-python/jmespath: Enable py3.11
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../jmespath/files/jmespath-1.0.0-py311.patch | 26 ++++++++++++++++++++++
13 dev-python/jmespath/jmespath-1.0.0.ebuild | 6 ++++-
14 2 files changed, 31 insertions(+), 1 deletion(-)
15
16 diff --git a/dev-python/jmespath/files/jmespath-1.0.0-py311.patch b/dev-python/jmespath/files/jmespath-1.0.0-py311.patch
17 new file mode 100644
18 index 000000000000..90c7bef9beee
19 --- /dev/null
20 +++ b/dev-python/jmespath/files/jmespath-1.0.0-py311.patch
21 @@ -0,0 +1,26 @@
22 +From 325d8111a924a951d8778c9fc1dbce30be267435 Mon Sep 17 00:00:00 2001
23 +From: Karthikeyan Singaravelan <tir.karthi@×××××.com>
24 +Date: Wed, 10 Mar 2021 14:15:36 +0000
25 +Subject: [PATCH] Use list for random.sample since using a set has been
26 + deprecated since Python 3.9
27 +
28 +---
29 + jmespath/parser.py | 2 +-
30 + 1 file changed, 1 insertion(+), 1 deletion(-)
31 +
32 +diff --git a/jmespath/parser.py b/jmespath/parser.py
33 +index eeac38f..4706688 100644
34 +--- a/jmespath/parser.py
35 ++++ b/jmespath/parser.py
36 +@@ -489,7 +489,7 @@ class Parser(object):
37 + lex_position, actual_value, actual_type, message)
38 +
39 + def _free_cache_entries(self):
40 +- for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)):
41 ++ for key in random.sample(list(self._CACHE.keys()), int(self._MAX_SIZE / 2)):
42 + self._CACHE.pop(key, None)
43 +
44 + @classmethod
45 +--
46 +2.35.1
47 +
48
49 diff --git a/dev-python/jmespath/jmespath-1.0.0.ebuild b/dev-python/jmespath/jmespath-1.0.0.ebuild
50 index 18253469abc7..7d281153bda1 100644
51 --- a/dev-python/jmespath/jmespath-1.0.0.ebuild
52 +++ b/dev-python/jmespath/jmespath-1.0.0.ebuild
53 @@ -4,7 +4,7 @@
54 EAPI=8
55
56 DISTUTILS_USE_PEP517=setuptools
57 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
58 +PYTHON_COMPAT=( python3_{8..11} pypy3 )
59
60 inherit distutils-r1
61
62 @@ -32,6 +32,10 @@ BDEPEND="
63
64 distutils_enable_tests pytest
65
66 +PATCHES=(
67 + "${FILESDIR}/${P}-py311.patch"
68 +)
69 +
70 src_prepare() {
71 # leftover import
72 sed -i -e '/nose/d' extra/test_hypothesis.py || die