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/rope/, dev-python/rope/files/
Date: Wed, 26 May 2021 08:36:27
Message-Id: 1622018163.4cbb923ab46383e84db96d326abcde68e50e676a.mgorny@gentoo
1 commit: 4cbb923ab46383e84db96d326abcde68e50e676a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 26 08:27:47 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed May 26 08:36:03 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4cbb923a
7
8 dev-python/rope: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/rope/Manifest | 1 -
13 .../files/rope-0.18.0-add-python-3.9-support.patch | 155 ---------------------
14 dev-python/rope/rope-0.18.0-r1.ebuild | 45 ------
15 3 files changed, 201 deletions(-)
16
17 diff --git a/dev-python/rope/Manifest b/dev-python/rope/Manifest
18 index 5f56e4e6769..cb27bf18213 100644
19 --- a/dev-python/rope/Manifest
20 +++ b/dev-python/rope/Manifest
21 @@ -1,2 +1 @@
22 -DIST rope-0.18.0.tar.gz 249828 BLAKE2B 2aac0541936c671f9b70528da28b2c016f14c7a3e5f368aecb6a3f2a39d2b447d70943bf00b7a49702f5d341504da7398ca5b1240d625275f749de1e530fb178 SHA512 9f706da345866447ff7e4027e6f9f0719d4b823253155881efcdd3a9e9a6f42fa9e194cd9547df4a6f752ae0cec739045e52bb7edd5cfa04ad4079fe06808298
23 DIST rope-0.19.0.tar.gz 252902 BLAKE2B 41760dc29d26558bdf5f296238b7d59ca949530826953fe5592b763b8d24fb49a90a56b9c7d0e3475daf145185987116a7dd0cbfba74829abfa4bf6a57c79937 SHA512 fd41777d76861837479bf0777ea42cc052eed7ba396bc4531a0c7f101b05b1c5a57c300950b7a3c8a2902e28ff049d146646f83f8a8a447ab9ccd7cd8aa48110
24
25 diff --git a/dev-python/rope/files/rope-0.18.0-add-python-3.9-support.patch b/dev-python/rope/files/rope-0.18.0-add-python-3.9-support.patch
26 deleted file mode 100644
27 index edb5304841d..00000000000
28 --- a/dev-python/rope/files/rope-0.18.0-add-python-3.9-support.patch
29 +++ /dev/null
30 @@ -1,155 +0,0 @@
31 -https://github.com/python-rope/rope/pull/333
32 -
33 -From a63ae26035c5493dc8b7c3bf6a70fc05dba2be98 Mon Sep 17 00:00:00 2001
34 -From: Matt Turner <mattst88@×××××.com>
35 -Date: Sun, 14 Mar 2021 10:17:47 -0400
36 -Subject: [PATCH 1/3] Fix test expectations for Python 3.9 AST changes
37 -
38 -Fixes the following two tests under Python 3.9:
39 -
40 -FAILED ropetest/refactor/patchedasttest.py::PatchedASTTest::test_ext_slice_node - AssertionError: Node <ExtSlice> cannot be found
41 -FAILED ropetest/refactor/patchedasttest.py::PatchedASTTest::test_simple_subscript - AssertionError: False is not true : Expected <Index> but was <Constant>
42 -
43 -The ast module in Python 3.9 has some API changes. Quoting [1]:
44 -
45 - Simplified AST for subscription. Simple indices will be represented
46 - by their value, extended slices will be represented as tuples.
47 - Index(value) will return a value itself, ExtSlice(slices) will
48 - return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
49 - bpo-34822.)
50 -
51 -[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
52 ----
53 - ropetest/refactor/patchedasttest.py | 18 +++++++++++++-----
54 - 1 file changed, 13 insertions(+), 5 deletions(-)
55 -
56 -diff --git a/ropetest/refactor/patchedasttest.py b/ropetest/refactor/patchedasttest.py
57 -index 04df3752..74a9d9a6 100644
58 ---- a/ropetest/refactor/patchedasttest.py
59 -+++ b/ropetest/refactor/patchedasttest.py
60 -@@ -838,8 +838,12 @@ class PatchedASTTest(unittest.TestCase):
61 - source = 'x = xs[0,:]\n'
62 - ast_frag = patchedast.get_patched_ast(source, True)
63 - checker = _ResultChecker(self, ast_frag)
64 -- checker.check_region('ExtSlice', 7, len(source) - 2)
65 -- checker.check_children('ExtSlice', ['Index', '', ',', '', 'Slice'])
66 -+ if sys.version_info >= (3, 9):
67 -+ checker.check_region('Tuple', 7, len(source) - 2)
68 -+ checker.check_children('Tuple', ['Num', '', ',', '', 'Slice'])
69 -+ else:
70 -+ checker.check_region('ExtSlice', 7, len(source) - 2)
71 -+ checker.check_children('ExtSlice', ['Index', '', ',', '', 'Slice'])
72 -
73 - def test_simple_module_node(self):
74 - source = 'pass\n'
75 -@@ -933,9 +937,13 @@ class PatchedASTTest(unittest.TestCase):
76 - source = 'a[1]\n'
77 - ast_frag = patchedast.get_patched_ast(source, True)
78 - checker = _ResultChecker(self, ast_frag)
79 -- checker.check_children(
80 -- 'Subscript', ['Name', '', '[', '', 'Index', '', ']'])
81 -- checker.check_children('Index', ['Num'])
82 -+ if sys.version_info >= (3, 9):
83 -+ checker.check_children(
84 -+ 'Subscript', ['Name', '', '[', '', 'Num', '', ']'])
85 -+ else:
86 -+ checker.check_children(
87 -+ 'Subscript', ['Name', '', '[', '', 'Index', '', ']'])
88 -+ checker.check_children('Index', ['Num'])
89 -
90 - def test_tuple_node(self):
91 - source = '(1, 2)\n'
92 ---
93 -2.26.2
94 -
95 -From 02284e4151c2b1d549a64175ef0e3212b7737c56 Mon Sep 17 00:00:00 2001
96 -From: Matt Turner <mattst88@×××××.com>
97 -Date: Sun, 14 Mar 2021 10:54:48 -0400
98 -Subject: [PATCH 2/3] Handle AST.expr in _Subscript()
99 -
100 -The ast module in Python 3.9 has some API changes. Quoting [1]:
101 -
102 - Simplified AST for subscription. Simple indices will be represented
103 - by their value, extended slices will be represented as tuples.
104 - Index(value) will return a value itself, ExtSlice(slices) will
105 - return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
106 - bpo-34822.)
107 -
108 -[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
109 -
110 -isinstance(thing, ast.Index) always return false in Python >= 3.9, so we
111 -need to handle... whatever the value is now. ast.expr catches 20 of the
112 -remaining 24 failures. The remaining 4 are resolved in the next patch.
113 -
114 -Fixes: #299
115 ----
116 - rope/base/evaluate.py | 3 +++
117 - 1 file changed, 3 insertions(+)
118 -
119 -diff --git a/rope/base/evaluate.py b/rope/base/evaluate.py
120 -index 610d34e0..4634981a 100644
121 ---- a/rope/base/evaluate.py
122 -+++ b/rope/base/evaluate.py
123 -@@ -307,6 +307,9 @@ class StatementEvaluator(object):
124 - elif isinstance(node.slice, ast.Slice):
125 - self._call_function(node.value, '__getitem__',
126 - [node.slice])
127 -+ elif isinstance(node.slice, ast.expr):
128 -+ self._call_function(node.value, '__getitem__',
129 -+ [node.value])
130 -
131 - def _Slice(self, node):
132 - self.result = self._get_builtin_name('slice')
133 ---
134 -2.26.2
135 -
136 -From 46a3403a06aaadf9d17f87b38300c4e3febe47c5 Mon Sep 17 00:00:00 2001
137 -From: Matt Turner <mattst88@×××××.com>
138 -Date: Fri, 19 Mar 2021 18:41:53 -0400
139 -Subject: [PATCH 3/3] Handle AST.expr in static object analysis
140 -
141 -The ast module in Python 3.9 has some API changes. Quoting [1]:
142 -
143 - Simplified AST for subscription. Simple indices will be represented
144 - by their value, extended slices will be represented as tuples.
145 - Index(value) will return a value itself, ExtSlice(slices) will
146 - return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
147 - bpo-34822.)
148 -
149 -[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
150 -
151 -This fixes the remaining 4 failures under Python 3.9.
152 -
153 -FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_append_function
154 -FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_for_loops
155 -FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_update
156 -FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_lists_per_object_for_set_item
157 -
158 -Fixes: #299
159 ----
160 - rope/base/oi/soa.py | 4 ++--
161 - 1 file changed, 2 insertions(+), 2 deletions(-)
162 -
163 -diff --git a/rope/base/oi/soa.py b/rope/base/oi/soa.py
164 -index 8ef17aee..20ab567e 100644
165 ---- a/rope/base/oi/soa.py
166 -+++ b/rope/base/oi/soa.py
167 -@@ -126,7 +126,7 @@ class SOAVisitor(object):
168 - for subscript, levels in nodes:
169 - instance = evaluate.eval_node(self.scope, subscript.value)
170 - args_pynames = [evaluate.eval_node(self.scope,
171 -- subscript.slice.value)]
172 -+ subscript.slice)]
173 - value = rope.base.oi.soi._infer_assignment(
174 - rope.base.pynames.AssignmentValue(node.value, levels,
175 - type_hint=type_hint),
176 -@@ -149,5 +149,5 @@ class _SOAAssignVisitor(astutils._NodeNameCollector):
177 -
178 - def _added(self, node, levels):
179 - if isinstance(node, rope.base.ast.Subscript) and \
180 -- isinstance(node.slice, rope.base.ast.Index):
181 -+ isinstance(node.slice, (rope.base.ast.Index, rope.base.ast.expr)):
182 - self.nodes.append((node, levels))
183 ---
184 -2.26.2
185 -
186
187 diff --git a/dev-python/rope/rope-0.18.0-r1.ebuild b/dev-python/rope/rope-0.18.0-r1.ebuild
188 deleted file mode 100644
189 index f3463196ae8..00000000000
190 --- a/dev-python/rope/rope-0.18.0-r1.ebuild
191 +++ /dev/null
192 @@ -1,45 +0,0 @@
193 -# Copyright 1999-2021 Gentoo Authors
194 -# Distributed under the terms of the GNU General Public License v2
195 -
196 -EAPI=7
197 -
198 -PYTHON_COMPAT=( python3_{7..9} )
199 -
200 -inherit distutils-r1
201 -
202 -DESCRIPTION="Python refactoring library"
203 -HOMEPAGE="https://github.com/python-rope/rope"
204 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
205 -
206 -LICENSE="LGPL-3"
207 -SLOT="0"
208 -KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~x86-linux"
209 -
210 -IUSE="doc"
211 -
212 -# Dependency for docbuild documentation which is not noted in
213 -# setup.py, using standard docutils builds docs successfully.
214 -DEPEND="doc? ( dev-python/docutils[${PYTHON_USEDEP}] )"
215 -
216 -PATCHES=(
217 - "${FILESDIR}"/${P}-add-python-3.9-support.patch
218 -)
219 -
220 -distutils_enable_tests pytest
221 -
222 -python_compile_all() {
223 - if use doc; then
224 - pushd docs > /dev/null || die
225 - mkdir build || die
226 - local i
227 - for i in ./*.rst; do
228 - rst2html.py $i > ./build/${i/rst/html} || die
229 - done
230 - popd > /dev/null || die
231 - fi
232 -}
233 -
234 -python_install_all() {
235 - use doc && local HTML_DOCS=( docs/build/. )
236 - distutils-r1_python_install_all
237 -}