1 |
commit: 56b7b2d4280e07a09e2d0547eb18330ea159d7a6 |
2 |
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com> |
3 |
AuthorDate: Thu Mar 26 21:32:22 2020 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 26 22:39:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56b7b2d4 |
7 |
|
8 |
dev-python/jaraco-collections-3.0.0: add pypy3 |
9 |
|
10 |
Copyright: Sony Interactive Entertainment Inc. |
11 |
Package-Manager: Portage-2.3.96, Repoman-2.3.21 |
12 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
13 |
|
14 |
.../files/jaraco-collections-3.0.0-pypy.patch | 30 ++++++++++++++++++++++ |
15 |
.../jaraco-collections-3.0.0.ebuild | 9 +++++-- |
16 |
2 files changed, 37 insertions(+), 2 deletions(-) |
17 |
|
18 |
diff --git a/dev-python/jaraco-collections/files/jaraco-collections-3.0.0-pypy.patch b/dev-python/jaraco-collections/files/jaraco-collections-3.0.0-pypy.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..63cee6cb411 |
21 |
--- /dev/null |
22 |
+++ b/dev-python/jaraco-collections/files/jaraco-collections-3.0.0-pypy.patch |
23 |
@@ -0,0 +1,30 @@ |
24 |
+diff --git a/jaraco/collections.py b/jaraco/collections.py |
25 |
+index 3ab9dc9..6a6e342 100644 |
26 |
+--- a/jaraco/collections.py |
27 |
++++ b/jaraco/collections.py |
28 |
+@@ -4,6 +4,7 @@ import collections.abc |
29 |
+ import itertools |
30 |
+ import copy |
31 |
+ import functools |
32 |
++import platform |
33 |
+ |
34 |
+ from jaraco.classes.properties import NonDataProperty |
35 |
+ import jaraco.text |
36 |
+@@ -592,9 +593,14 @@ class DictStack(list, collections.abc.Mapping): |
37 |
+ return list(set(itertools.chain.from_iterable(c.keys() for c in self))) |
38 |
+ |
39 |
+ def __getitem__(self, key): |
40 |
+- for scope in reversed(self): |
41 |
+- if key in scope: |
42 |
+- return scope[key] |
43 |
++ if 'PyPy' in platform.python_implementation(): |
44 |
++ for scope in reversed(list(self)): |
45 |
++ if key in scope: |
46 |
++ return scope[key] |
47 |
++ else: |
48 |
++ for scope in reversed(self): |
49 |
++ if key in scope: |
50 |
++ return scope[key] |
51 |
+ raise KeyError(key) |
52 |
+ |
53 |
+ push = list.append |
54 |
|
55 |
diff --git a/dev-python/jaraco-collections/jaraco-collections-3.0.0.ebuild b/dev-python/jaraco-collections/jaraco-collections-3.0.0.ebuild |
56 |
index 24a897750d9..e89935b5b5c 100644 |
57 |
--- a/dev-python/jaraco-collections/jaraco-collections-3.0.0.ebuild |
58 |
+++ b/dev-python/jaraco-collections/jaraco-collections-3.0.0.ebuild |
59 |
@@ -33,11 +33,16 @@ BDEPEND=" |
60 |
>=dev-python/pytest-2.8[${PYTHON_USEDEP}] |
61 |
) |
62 |
" |
63 |
-distutils_enable_sphinx docs '>=dev-python/jaraco-packaging-3.2' \ |
64 |
- '>=dev-python/rst-linker-1.9' |
65 |
|
66 |
S="${WORKDIR}/${MY_PN}-${PV}" |
67 |
|
68 |
+PATCHES=( |
69 |
+ "${FILESDIR}/jaraco-collections-3.0.0-pypy.patch" |
70 |
+) |
71 |
+ |
72 |
+distutils_enable_sphinx docs '>=dev-python/jaraco-packaging-3.2' \ |
73 |
+ '>=dev-python/rst-linker-1.9' |
74 |
+ |
75 |
python_test() { |
76 |
# Override pytest options to skip flake8 |
77 |
PYTHONPATH=. pytest -vv --override-ini="addopts=--doctest-modules" \ |