* [gentoo-commits] repo/gentoo:master commit in: dev-python/rope/, dev-python/rope/files/
@ 2015-11-10 16:08 Ian Delaney
0 siblings, 0 replies; 4+ messages in thread
From: Ian Delaney @ 2015-11-10 16:08 UTC (permalink / raw
To: gentoo-commits
commit: 0eecef5a873667b89ef6d5d8432b3b2bf827b8bb
Author: Ian Delaney <idella4 <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 10 16:05:48 2015 +0000
Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Tue Nov 10 16:06:35 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0eecef5a
dev-python/rope: bump to 0.10.3 wrt the gentoo bug
thanks to user 'wraeth' for submission of the final patch and
bumped ebuild via the gentoo bug. Added doc build in html from
by docutils, tidy phases to conform to default style according
to the eclass
Gentoo bug: #565018
Package-Manager: portage-2.2.24
dev-python/rope/Manifest | 1 +
.../rope/files/rope-0.10.3-doc-syntax-errors.patch | 35 ++++++++++++++++
dev-python/rope/rope-0.10.3.ebuild | 46 ++++++++++++++++++++++
3 files changed, 82 insertions(+)
diff --git a/dev-python/rope/Manifest b/dev-python/rope/Manifest
index cedad02..8628a1a 100644
--- a/dev-python/rope/Manifest
+++ b/dev-python/rope/Manifest
@@ -1,2 +1,3 @@
DIST rope-0.10.2.tar.gz 221523 SHA256 fffca108c0d6a711121ce11fed286f4ddc5791c7a6c3f079221a9303d1ddb465 SHA512 9d3c3f2197b8eff87301d90dbf58872070e8c352704f50c942c270a05ba08504aeb2bb8f6d00902954abaa4d721d2a246c720f94547d8d3517cb84c0b31d9bc2 WHIRLPOOL 196587c655e6bffb26bc6498e57a833ddfc5c3ec0ccaa0b0baff9618f0e9fc5d18612fdada1a91e3ca8813b2c3c254691d462f2ff622af371a78b22b2024016f
+DIST rope-0.10.3.tar.gz 226123 SHA256 eb45bea0abcf31a1a12ff087b990060e64244b835582ebc7642e6f7ea1fd65a2 SHA512 1d868aeebd086c3fc199316a71e61a8c46c76d85176557842051bb8f51d090f316df6bb84f766db5a46dc164d3e471eb90465805a102e46acb34e39b2b0ce8b4 WHIRLPOOL 16cd8b80f7f3fe729d1d3b4b5b98fcd5b6f16c818ddd67a9d460fe4947e768febf1425e8d20bf0e47c9d49a58b4ba1acac0e6640d61fc187f84fc843128c591d
DIST rope-0.9.4.tar.gz 221516 SHA256 2dc0342604851d8fbdafa198172eab5da7ed422759016669056181e21c54a6ba SHA512 462ce4fec7decdca67400e01fc08cb924019e71011fa0c50c529ff0ba377b277685f34a78796b5c30c20ac063aaba1b0b61bd9ac5b05625399e9d71ac625e534 WHIRLPOOL 7fcdfcd0d82e869b8008cedb7fc0ecbb8f7da302994129273e342346becde8cbd5915f9e04d2a9de57eb2b42b4487329109c159277f8255e386fc2765213a94b
diff --git a/dev-python/rope/files/rope-0.10.3-doc-syntax-errors.patch b/dev-python/rope/files/rope-0.10.3-doc-syntax-errors.patch
new file mode 100644
index 0000000..f219e1b
--- /dev/null
+++ b/dev-python/rope/files/rope-0.10.3-doc-syntax-errors.patch
@@ -0,0 +1,35 @@
+# Fix syntax errors in doc files
+diff --git a/docs/contributing.rst b/docs/contributing.rst
+index c6cb8a8..9efc3cc 100644
+--- a/docs/contributing.rst
++++ b/docs/contributing.rst
+@@ -45,7 +45,7 @@ about them, don't hesitate to discuss it in the mailing list.
+ Getting Ready For Python 3.0
+ ----------------------------
+
+-Checkout http://bitbucket.org/agr/rope_py3k Mercurial_ repository.
++Checkout http://bitbucket.org/agr/rope_py3k Mercurial repository.
+ Contributions are welcome.
+
+ Write Plugins For Other IDEs
+@@ -79,7 +79,7 @@ Source Repository
+ =================
+
+ Rope uses GitHub_. The repository exists at
+-`https://github.com/python-rope/rope`_.
++`https://github.com/python-rope/rope`.
+
+
+ Submitting patches
+diff --git a/docs/library.rst b/docs/library.rst
+index 390b9c8..ee918bc 100644
+--- a/docs/library.rst
++++ b/docs/library.rst
+@@ -72,7 +72,7 @@ In rope, files and folders in a project are accessed through
+ ``Change``\s (we'll talk about them later) use resources.
+
+ There are two options for creating a ``Resource`` for a path in a project.
+-The first approach uses the `Project.get_resource()`_ method.
++The first approach uses the `Project.get_resource()` method.
+
+ .. code-block:: python
diff --git a/dev-python/rope/rope-0.10.3.ebuild b/dev-python/rope/rope-0.10.3.ebuild
new file mode 100644
index 0000000..1e5928a
--- /dev/null
+++ b/dev-python/rope/rope-0.10.3.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Python refactoring library"
+HOMEPAGE="https://github.com/python-rope/rope"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+# Dependency for docbuild documentation which is not noted in
+# setup.py, using standard docutils builds docs successfully.
+DEPEND="doc? ( dev-python/docutils[${PYTHON_USEDEP}] )"
+
+PATCHES=( "${FILESDIR}/${P}-doc-syntax-errors.patch" )
+
+python_test() {
+ PYTHONPATH="${BUILD_DIR}/lib:." ${EPYTHON} ropetest/__init__.py
+}
+
+python_compile_all() {
+ local i;
+ if use doc; then
+ pushd docs > /dev/null
+ mkdir build || die
+ for i in ./*.rst
+ do
+ rst2html.py $i > ./build/${i/rst/html} || die
+ done
+ popd > /dev/null
+ fi
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/. )
+ distutils-r1_python_install_all
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/rope/, dev-python/rope/files/
@ 2020-02-17 15:55 Matt Turner
0 siblings, 0 replies; 4+ messages in thread
From: Matt Turner @ 2020-02-17 15:55 UTC (permalink / raw
To: gentoo-commits
commit: 59aaf1df5546e712d455f0113692e6447b5c6f56
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 17 15:22:29 2020 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Feb 17 15:55:43 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59aaf1df
dev-python/rope: Fix test execution with python3.7
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
dev-python/rope/files/rope-0.16.0-python3.7.patch | 251 ++++++++++++++++++++++
dev-python/rope/rope-0.16.0.ebuild | 10 +-
2 files changed, 257 insertions(+), 4 deletions(-)
diff --git a/dev-python/rope/files/rope-0.16.0-python3.7.patch b/dev-python/rope/files/rope-0.16.0-python3.7.patch
new file mode 100644
index 00000000000..d120a8ecc51
--- /dev/null
+++ b/dev-python/rope/files/rope-0.16.0-python3.7.patch
@@ -0,0 +1,251 @@
+From 5c38f7c8ba23813b475dcb24fa66ed3fc52d1658 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Mon, 13 Jan 2020 15:07:46 +0100
+Subject: [PATCH 1/4] Use .is_alive method instead of a deprecated .isAlive in
+ threading.Thread
+
+---
+ ropetest/type_hinting_test.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ropetest/type_hinting_test.py b/ropetest/type_hinting_test.py
+index 7cc02bb1..afb98e19 100644
+--- a/ropetest/type_hinting_test.py
++++ b/ropetest/type_hinting_test.py
+@@ -198,18 +198,18 @@ def test_hint_parametrized_iterable(self):
+ + self._make_class_hint('collections.Iterable[threading.Thread]') + \
+ ' def a_method(self):\n' \
+ ' for i in self.a_attr:\n' \
+- ' i.isA'
++ ' i.is_a'
+ result = self._assist(code)
+- self.assert_completion_in_result('isAlive', 'attribute', result)
++ self.assert_completion_in_result('is_alive', 'attribute', result)
+
+ def test_hint_parametrized_iterator(self):
+ code = 'class Sample(object):\n' \
+ + self._make_class_hint('collections.Iterator[threading.Thread]') + \
+ ' def a_method(self):\n' \
+ ' for i in self.a_attr:\n' \
+- ' i.isA'
++ ' i.is_a'
+ result = self._assist(code)
+- self.assert_completion_in_result('isAlive', 'attribute', result)
++ self.assert_completion_in_result('is_alive', 'attribute', result)
+
+ def test_hint_parametrized_dict_key(self):
+ code = 'class Sample(object):\n' \
+
+From df3567f2afac8b5c5b50f8b7a01e21259e397f81 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Mon, 13 Jan 2020 15:29:14 +0100
+Subject: [PATCH 2/4] Direct import from collections is getting deprecated.
+
+---
+ rope/base/utils/datastructures.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/rope/base/utils/datastructures.py b/rope/base/utils/datastructures.py
+index 0cb16cf2..3790a6e1 100644
+--- a/rope/base/utils/datastructures.py
++++ b/rope/base/utils/datastructures.py
+@@ -1,10 +1,13 @@
+ # this snippet was taken from this link
+ # http://code.activestate.com/recipes/576694/
+
+-import collections
++try:
++ from collections import MutableSet
++except ImportError:
++ from collections.abc import MutableSet
+
+
+-class OrderedSet(collections.MutableSet):
++class OrderedSet(MutableSet):
+
+ def __init__(self, iterable=None):
+ self.end = end = []
+
+From fa5626ea99a6cac4780184d708108a98bd7e6095 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Mon, 13 Jan 2020 16:36:01 +0100
+Subject: [PATCH 3/4] Don't use underscored _ast, but use ast instead
+
+---
+ rope/base/ast.py | 15 ++++++++-------
+ rope/base/utils/pycompat.py | 6 +++---
+ 2 files changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/rope/base/ast.py b/rope/base/ast.py
+index d43c83c5..d24524e7 100644
+--- a/rope/base/ast.py
++++ b/rope/base/ast.py
+@@ -1,5 +1,6 @@
+-import _ast
+-from _ast import *
++from __future__ import absolute_import
++import ast
++from ast import *
+
+ from rope.base import fscommands
+
+@@ -18,7 +19,7 @@ def parse(source, filename='<string>'):
+ if not source.endswith(b'\n'):
+ source += b'\n'
+ try:
+- return compile(source, filename, 'exec', _ast.PyCF_ONLY_AST)
++ return ast.parse(source, filename='<unknown>')
+ except (TypeError, ValueError) as e:
+ error = SyntaxError()
+ error.lineno = 1
+@@ -32,7 +33,7 @@ def walk(node, walker):
+ method_name = '_' + node.__class__.__name__
+ method = getattr(walker, method_name, None)
+ if method is not None:
+- if isinstance(node, _ast.ImportFrom) and node.module is None:
++ if isinstance(node, ast.ImportFrom) and node.module is None:
+ # In python < 2.7 ``node.module == ''`` for relative imports
+ # but for python 2.7 it is None. Generalizing it to ''.
+ node.module = ''
+@@ -42,7 +43,7 @@ def walk(node, walker):
+
+
+ def get_child_nodes(node):
+- if isinstance(node, _ast.Module):
++ if isinstance(node, ast.Module):
+ return node.body
+ result = []
+ if node._fields is not None:
+@@ -50,9 +51,9 @@ def get_child_nodes(node):
+ child = getattr(node, name)
+ if isinstance(child, list):
+ for entry in child:
+- if isinstance(entry, _ast.AST):
++ if isinstance(entry, ast.AST):
+ result.append(entry)
+- if isinstance(child, _ast.AST):
++ if isinstance(child, ast.AST):
+ result.append(child)
+ return result
+
+diff --git a/rope/base/utils/pycompat.py b/rope/base/utils/pycompat.py
+index 1214658f..de7cf2e4 100644
+--- a/rope/base/utils/pycompat.py
++++ b/rope/base/utils/pycompat.py
+@@ -1,5 +1,5 @@
+ import sys
+-import _ast
++import ast
+ # from rope.base import ast
+
+ PY2 = sys.version_info[0] == 2
+@@ -15,7 +15,7 @@
+ str = str
+ string_types = (str,)
+ import builtins
+- ast_arg_type = _ast.arg
++ ast_arg_type = ast.arg
+
+ def execfile(fn, global_vars=None, local_vars=None):
+ with open(fn) as f:
+@@ -34,7 +34,7 @@ def get_ast_with_items(node):
+
+ string_types = (basestring,)
+ builtins = __import__('__builtin__')
+- ast_arg_type = _ast.Name
++ ast_arg_type = ast.Name
+ execfile = execfile
+
+ def get_ast_arg_arg(node):
+
+From 431d35d3e7ed2286bea2d13908cd80a0e42a9b13 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Tue, 14 Jan 2020 15:00:36 +0100
+Subject: [PATCH 4/4] Work with deprecated types and using aliased ones.
+
+Fixes #247
+---
+ rope/base/oi/type_hinting/utils.py | 50 ++++++++++++++++++++----------
+ 1 file changed, 34 insertions(+), 16 deletions(-)
+
+diff --git a/rope/base/oi/type_hinting/utils.py b/rope/base/oi/type_hinting/utils.py
+index aec82ac0..ce90dfeb 100644
+--- a/rope/base/oi/type_hinting/utils.py
++++ b/rope/base/oi/type_hinting/utils.py
+@@ -1,8 +1,12 @@
+-import rope.base.builtins
++import logging
++try:
++ from typing import Union, Optional
++except ImportError:
++ pass
+ import rope.base.utils as base_utils
+ from rope.base.evaluate import ScopeNameFinder
+ from rope.base.exceptions import AttributeNotFoundError
+-from rope.base.pyobjects import PyClass, PyFunction
++from rope.base.pyobjects import PyClass, PyDefinedObject, PyFunction, PyObject
+ from rope.base.utils import pycompat
+
+
+@@ -66,33 +70,47 @@ def get_lineno_for_node(assign_node):
+
+ def get_mro(pyclass):
+ # FIXME: to use real mro() result
+- l = [pyclass]
+- for cls in l:
++ class_list = [pyclass]
++ for cls in class_list:
+ for super_cls in cls.get_superclasses():
+- if isinstance(super_cls, PyClass) and super_cls not in l:
+- l.append(super_cls)
+- return l
++ if isinstance(super_cls, PyClass) and super_cls not in class_list:
++ class_list.append(super_cls)
++ return class_list
+
+
+ def resolve_type(type_name, pyobject):
++ # type: (str, Union[PyDefinedObject, PyObject]) -> Optional[PyDefinedObject, PyObject]
+ """
+- :type type_name: str
+- :type pyobject: rope.base.pyobjects.PyDefinedObject | rope.base.pyobjects.PyObject
+- :rtype: rope.base.pyobjects.PyDefinedObject | rope.base.pyobjects.PyObject or None
++ Find proper type object from its name.
+ """
++ deprecated_aliases = {'collections': 'collections.abc'}
++ ret_type = None
++ logging.debug('Looking for %s', type_name)
+ if '.' not in type_name:
+ try:
+- return pyobject.get_module().get_scope().get_name(type_name).get_object()
+- except Exception:
+- pass
++ ret_type = pyobject.get_module().get_scope().get_name(
++ type_name).get_object()
++ except AttributeNotFoundError:
++ logging.exception('Cannot resolve type %s', type_name)
+ else:
+ mod_name, attr_name = type_name.rsplit('.', 1)
+ try:
+ mod_finder = ScopeNameFinder(pyobject.get_module())
+ mod = mod_finder._find_module(mod_name).get_object()
+- return mod.get_attribute(attr_name).get_object()
+- except Exception:
+- pass
++ ret_type = mod.get_attribute(attr_name).get_object()
++ except AttributeNotFoundError:
++ if mod_name in deprecated_aliases:
++ try:
++ logging.debug('Looking for %s in %s',
++ attr_name, deprecated_aliases[mod_name])
++ mod = mod_finder._find_module(
++ deprecated_aliases[mod_name]).get_object()
++ ret_type = mod.get_attribute(attr_name).get_object()
++ except AttributeNotFoundError:
++ logging.exception('Cannot resolve type %s in %s',
++ attr_name, dir(mod))
++ logging.debug('ret_type = %s', ret_type)
++ return ret_type
+
+
+ class ParametrizeType(object):
diff --git a/dev-python/rope/rope-0.16.0.ebuild b/dev-python/rope/rope-0.16.0.ebuild
index a60999bb3c8..7854b2c3f39 100644
--- a/dev-python/rope/rope-0.16.0.ebuild
+++ b/dev-python/rope/rope-0.16.0.ebuild
@@ -21,9 +21,11 @@ IUSE="doc"
# setup.py, using standard docutils builds docs successfully.
DEPEND="doc? ( dev-python/docutils[${PYTHON_USEDEP}] )"
-python_test() {
- PYTHONPATH="${BUILD_DIR}/lib:." ${EPYTHON} ropetest/__init__.py
-}
+PATCHES=(
+ "${FILESDIR}"/${P}-python3.7.patch
+)
+
+distutils_enable_tests pytest
python_compile_all() {
if use doc; then
@@ -33,7 +35,7 @@ python_compile_all() {
for i in ./*.rst; do
rst2html.py $i > ./build/${i/rst/html} || die
done
- popd > /dev/null || die
+ popd > /dev/null || die
fi
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/rope/, dev-python/rope/files/
@ 2021-04-06 7:22 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-04-06 7:22 UTC (permalink / raw
To: gentoo-commits
commit: ed3b0f3f4a19ebdb1d0fea0e60fcf6f262e3c111
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 5 22:44:04 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Apr 6 07:22:43 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed3b0f3f
dev-python/rope: Add Python 3.9 support
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/20272
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../files/rope-0.18.0-add-python-3.9-support.patch | 155 +++++++++++++++++++++
dev-python/rope/rope-0.18.0-r1.ebuild | 45 ++++++
2 files changed, 200 insertions(+)
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
new file mode 100644
index 00000000000..edb5304841d
--- /dev/null
+++ b/dev-python/rope/files/rope-0.18.0-add-python-3.9-support.patch
@@ -0,0 +1,155 @@
+https://github.com/python-rope/rope/pull/333
+
+From a63ae26035c5493dc8b7c3bf6a70fc05dba2be98 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Sun, 14 Mar 2021 10:17:47 -0400
+Subject: [PATCH 1/3] Fix test expectations for Python 3.9 AST changes
+
+Fixes the following two tests under Python 3.9:
+
+FAILED ropetest/refactor/patchedasttest.py::PatchedASTTest::test_ext_slice_node - AssertionError: Node <ExtSlice> cannot be found
+FAILED ropetest/refactor/patchedasttest.py::PatchedASTTest::test_simple_subscript - AssertionError: False is not true : Expected <Index> but was <Constant>
+
+The ast module in Python 3.9 has some API changes. Quoting [1]:
+
+ Simplified AST for subscription. Simple indices will be represented
+ by their value, extended slices will be represented as tuples.
+ Index(value) will return a value itself, ExtSlice(slices) will
+ return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
+ bpo-34822.)
+
+[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
+---
+ ropetest/refactor/patchedasttest.py | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/ropetest/refactor/patchedasttest.py b/ropetest/refactor/patchedasttest.py
+index 04df3752..74a9d9a6 100644
+--- a/ropetest/refactor/patchedasttest.py
++++ b/ropetest/refactor/patchedasttest.py
+@@ -838,8 +838,12 @@ class PatchedASTTest(unittest.TestCase):
+ source = 'x = xs[0,:]\n'
+ ast_frag = patchedast.get_patched_ast(source, True)
+ checker = _ResultChecker(self, ast_frag)
+- checker.check_region('ExtSlice', 7, len(source) - 2)
+- checker.check_children('ExtSlice', ['Index', '', ',', '', 'Slice'])
++ if sys.version_info >= (3, 9):
++ checker.check_region('Tuple', 7, len(source) - 2)
++ checker.check_children('Tuple', ['Num', '', ',', '', 'Slice'])
++ else:
++ checker.check_region('ExtSlice', 7, len(source) - 2)
++ checker.check_children('ExtSlice', ['Index', '', ',', '', 'Slice'])
+
+ def test_simple_module_node(self):
+ source = 'pass\n'
+@@ -933,9 +937,13 @@ class PatchedASTTest(unittest.TestCase):
+ source = 'a[1]\n'
+ ast_frag = patchedast.get_patched_ast(source, True)
+ checker = _ResultChecker(self, ast_frag)
+- checker.check_children(
+- 'Subscript', ['Name', '', '[', '', 'Index', '', ']'])
+- checker.check_children('Index', ['Num'])
++ if sys.version_info >= (3, 9):
++ checker.check_children(
++ 'Subscript', ['Name', '', '[', '', 'Num', '', ']'])
++ else:
++ checker.check_children(
++ 'Subscript', ['Name', '', '[', '', 'Index', '', ']'])
++ checker.check_children('Index', ['Num'])
+
+ def test_tuple_node(self):
+ source = '(1, 2)\n'
+--
+2.26.2
+
+From 02284e4151c2b1d549a64175ef0e3212b7737c56 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Sun, 14 Mar 2021 10:54:48 -0400
+Subject: [PATCH 2/3] Handle AST.expr in _Subscript()
+
+The ast module in Python 3.9 has some API changes. Quoting [1]:
+
+ Simplified AST for subscription. Simple indices will be represented
+ by their value, extended slices will be represented as tuples.
+ Index(value) will return a value itself, ExtSlice(slices) will
+ return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
+ bpo-34822.)
+
+[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
+
+isinstance(thing, ast.Index) always return false in Python >= 3.9, so we
+need to handle... whatever the value is now. ast.expr catches 20 of the
+remaining 24 failures. The remaining 4 are resolved in the next patch.
+
+Fixes: #299
+---
+ rope/base/evaluate.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rope/base/evaluate.py b/rope/base/evaluate.py
+index 610d34e0..4634981a 100644
+--- a/rope/base/evaluate.py
++++ b/rope/base/evaluate.py
+@@ -307,6 +307,9 @@ class StatementEvaluator(object):
+ elif isinstance(node.slice, ast.Slice):
+ self._call_function(node.value, '__getitem__',
+ [node.slice])
++ elif isinstance(node.slice, ast.expr):
++ self._call_function(node.value, '__getitem__',
++ [node.value])
+
+ def _Slice(self, node):
+ self.result = self._get_builtin_name('slice')
+--
+2.26.2
+
+From 46a3403a06aaadf9d17f87b38300c4e3febe47c5 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Fri, 19 Mar 2021 18:41:53 -0400
+Subject: [PATCH 3/3] Handle AST.expr in static object analysis
+
+The ast module in Python 3.9 has some API changes. Quoting [1]:
+
+ Simplified AST for subscription. Simple indices will be represented
+ by their value, extended slices will be represented as tuples.
+ Index(value) will return a value itself, ExtSlice(slices) will
+ return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
+ bpo-34822.)
+
+[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
+
+This fixes the remaining 4 failures under Python 3.9.
+
+FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_append_function
+FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_for_loops
+FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_update
+FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_lists_per_object_for_set_item
+
+Fixes: #299
+---
+ rope/base/oi/soa.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/rope/base/oi/soa.py b/rope/base/oi/soa.py
+index 8ef17aee..20ab567e 100644
+--- a/rope/base/oi/soa.py
++++ b/rope/base/oi/soa.py
+@@ -126,7 +126,7 @@ class SOAVisitor(object):
+ for subscript, levels in nodes:
+ instance = evaluate.eval_node(self.scope, subscript.value)
+ args_pynames = [evaluate.eval_node(self.scope,
+- subscript.slice.value)]
++ subscript.slice)]
+ value = rope.base.oi.soi._infer_assignment(
+ rope.base.pynames.AssignmentValue(node.value, levels,
+ type_hint=type_hint),
+@@ -149,5 +149,5 @@ class _SOAAssignVisitor(astutils._NodeNameCollector):
+
+ def _added(self, node, levels):
+ if isinstance(node, rope.base.ast.Subscript) and \
+- isinstance(node.slice, rope.base.ast.Index):
++ isinstance(node.slice, (rope.base.ast.Index, rope.base.ast.expr)):
+ self.nodes.append((node, levels))
+--
+2.26.2
+
diff --git a/dev-python/rope/rope-0.18.0-r1.ebuild b/dev-python/rope/rope-0.18.0-r1.ebuild
new file mode 100644
index 00000000000..30b91ee55c4
--- /dev/null
+++ b/dev-python/rope/rope-0.18.0-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python refactoring library"
+HOMEPAGE="https://github.com/python-rope/rope"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc"
+
+# Dependency for docbuild documentation which is not noted in
+# setup.py, using standard docutils builds docs successfully.
+DEPEND="doc? ( dev-python/docutils[${PYTHON_USEDEP}] )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-add-python-3.9-support.patch
+)
+
+distutils_enable_tests pytest
+
+python_compile_all() {
+ if use doc; then
+ pushd docs > /dev/null || die
+ mkdir build || die
+ local i
+ for i in ./*.rst; do
+ rst2html.py $i > ./build/${i/rst/html} || die
+ done
+ popd > /dev/null || die
+ fi
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/. )
+ distutils-r1_python_install_all
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/rope/, dev-python/rope/files/
@ 2021-05-26 8:36 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-05-26 8:36 UTC (permalink / raw
To: gentoo-commits
commit: 4cbb923ab46383e84db96d326abcde68e50e676a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 26 08:27:47 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 26 08:36:03 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4cbb923a
dev-python/rope: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/rope/Manifest | 1 -
.../files/rope-0.18.0-add-python-3.9-support.patch | 155 ---------------------
dev-python/rope/rope-0.18.0-r1.ebuild | 45 ------
3 files changed, 201 deletions(-)
diff --git a/dev-python/rope/Manifest b/dev-python/rope/Manifest
index 5f56e4e6769..cb27bf18213 100644
--- a/dev-python/rope/Manifest
+++ b/dev-python/rope/Manifest
@@ -1,2 +1 @@
-DIST rope-0.18.0.tar.gz 249828 BLAKE2B 2aac0541936c671f9b70528da28b2c016f14c7a3e5f368aecb6a3f2a39d2b447d70943bf00b7a49702f5d341504da7398ca5b1240d625275f749de1e530fb178 SHA512 9f706da345866447ff7e4027e6f9f0719d4b823253155881efcdd3a9e9a6f42fa9e194cd9547df4a6f752ae0cec739045e52bb7edd5cfa04ad4079fe06808298
DIST rope-0.19.0.tar.gz 252902 BLAKE2B 41760dc29d26558bdf5f296238b7d59ca949530826953fe5592b763b8d24fb49a90a56b9c7d0e3475daf145185987116a7dd0cbfba74829abfa4bf6a57c79937 SHA512 fd41777d76861837479bf0777ea42cc052eed7ba396bc4531a0c7f101b05b1c5a57c300950b7a3c8a2902e28ff049d146646f83f8a8a447ab9ccd7cd8aa48110
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
deleted file mode 100644
index edb5304841d..00000000000
--- a/dev-python/rope/files/rope-0.18.0-add-python-3.9-support.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-https://github.com/python-rope/rope/pull/333
-
-From a63ae26035c5493dc8b7c3bf6a70fc05dba2be98 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Sun, 14 Mar 2021 10:17:47 -0400
-Subject: [PATCH 1/3] Fix test expectations for Python 3.9 AST changes
-
-Fixes the following two tests under Python 3.9:
-
-FAILED ropetest/refactor/patchedasttest.py::PatchedASTTest::test_ext_slice_node - AssertionError: Node <ExtSlice> cannot be found
-FAILED ropetest/refactor/patchedasttest.py::PatchedASTTest::test_simple_subscript - AssertionError: False is not true : Expected <Index> but was <Constant>
-
-The ast module in Python 3.9 has some API changes. Quoting [1]:
-
- Simplified AST for subscription. Simple indices will be represented
- by their value, extended slices will be represented as tuples.
- Index(value) will return a value itself, ExtSlice(slices) will
- return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
- bpo-34822.)
-
-[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
----
- ropetest/refactor/patchedasttest.py | 18 +++++++++++++-----
- 1 file changed, 13 insertions(+), 5 deletions(-)
-
-diff --git a/ropetest/refactor/patchedasttest.py b/ropetest/refactor/patchedasttest.py
-index 04df3752..74a9d9a6 100644
---- a/ropetest/refactor/patchedasttest.py
-+++ b/ropetest/refactor/patchedasttest.py
-@@ -838,8 +838,12 @@ class PatchedASTTest(unittest.TestCase):
- source = 'x = xs[0,:]\n'
- ast_frag = patchedast.get_patched_ast(source, True)
- checker = _ResultChecker(self, ast_frag)
-- checker.check_region('ExtSlice', 7, len(source) - 2)
-- checker.check_children('ExtSlice', ['Index', '', ',', '', 'Slice'])
-+ if sys.version_info >= (3, 9):
-+ checker.check_region('Tuple', 7, len(source) - 2)
-+ checker.check_children('Tuple', ['Num', '', ',', '', 'Slice'])
-+ else:
-+ checker.check_region('ExtSlice', 7, len(source) - 2)
-+ checker.check_children('ExtSlice', ['Index', '', ',', '', 'Slice'])
-
- def test_simple_module_node(self):
- source = 'pass\n'
-@@ -933,9 +937,13 @@ class PatchedASTTest(unittest.TestCase):
- source = 'a[1]\n'
- ast_frag = patchedast.get_patched_ast(source, True)
- checker = _ResultChecker(self, ast_frag)
-- checker.check_children(
-- 'Subscript', ['Name', '', '[', '', 'Index', '', ']'])
-- checker.check_children('Index', ['Num'])
-+ if sys.version_info >= (3, 9):
-+ checker.check_children(
-+ 'Subscript', ['Name', '', '[', '', 'Num', '', ']'])
-+ else:
-+ checker.check_children(
-+ 'Subscript', ['Name', '', '[', '', 'Index', '', ']'])
-+ checker.check_children('Index', ['Num'])
-
- def test_tuple_node(self):
- source = '(1, 2)\n'
---
-2.26.2
-
-From 02284e4151c2b1d549a64175ef0e3212b7737c56 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Sun, 14 Mar 2021 10:54:48 -0400
-Subject: [PATCH 2/3] Handle AST.expr in _Subscript()
-
-The ast module in Python 3.9 has some API changes. Quoting [1]:
-
- Simplified AST for subscription. Simple indices will be represented
- by their value, extended slices will be represented as tuples.
- Index(value) will return a value itself, ExtSlice(slices) will
- return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
- bpo-34822.)
-
-[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
-
-isinstance(thing, ast.Index) always return false in Python >= 3.9, so we
-need to handle... whatever the value is now. ast.expr catches 20 of the
-remaining 24 failures. The remaining 4 are resolved in the next patch.
-
-Fixes: #299
----
- rope/base/evaluate.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/rope/base/evaluate.py b/rope/base/evaluate.py
-index 610d34e0..4634981a 100644
---- a/rope/base/evaluate.py
-+++ b/rope/base/evaluate.py
-@@ -307,6 +307,9 @@ class StatementEvaluator(object):
- elif isinstance(node.slice, ast.Slice):
- self._call_function(node.value, '__getitem__',
- [node.slice])
-+ elif isinstance(node.slice, ast.expr):
-+ self._call_function(node.value, '__getitem__',
-+ [node.value])
-
- def _Slice(self, node):
- self.result = self._get_builtin_name('slice')
---
-2.26.2
-
-From 46a3403a06aaadf9d17f87b38300c4e3febe47c5 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Fri, 19 Mar 2021 18:41:53 -0400
-Subject: [PATCH 3/3] Handle AST.expr in static object analysis
-
-The ast module in Python 3.9 has some API changes. Quoting [1]:
-
- Simplified AST for subscription. Simple indices will be represented
- by their value, extended slices will be represented as tuples.
- Index(value) will return a value itself, ExtSlice(slices) will
- return Tuple(slices, Load()). (Contributed by Serhiy Storchaka in
- bpo-34822.)
-
-[1] https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-python-api
-
-This fixes the remaining 4 failures under Python 3.9.
-
-FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_append_function
-FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_for_loops
-FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_dicts_depending_on_update
-FAILED ropetest/advanced_oi_test.py::NewStaticOITest::test_static_oi_for_lists_per_object_for_set_item
-
-Fixes: #299
----
- rope/base/oi/soa.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/rope/base/oi/soa.py b/rope/base/oi/soa.py
-index 8ef17aee..20ab567e 100644
---- a/rope/base/oi/soa.py
-+++ b/rope/base/oi/soa.py
-@@ -126,7 +126,7 @@ class SOAVisitor(object):
- for subscript, levels in nodes:
- instance = evaluate.eval_node(self.scope, subscript.value)
- args_pynames = [evaluate.eval_node(self.scope,
-- subscript.slice.value)]
-+ subscript.slice)]
- value = rope.base.oi.soi._infer_assignment(
- rope.base.pynames.AssignmentValue(node.value, levels,
- type_hint=type_hint),
-@@ -149,5 +149,5 @@ class _SOAAssignVisitor(astutils._NodeNameCollector):
-
- def _added(self, node, levels):
- if isinstance(node, rope.base.ast.Subscript) and \
-- isinstance(node.slice, rope.base.ast.Index):
-+ isinstance(node.slice, (rope.base.ast.Index, rope.base.ast.expr)):
- self.nodes.append((node, levels))
---
-2.26.2
-
diff --git a/dev-python/rope/rope-0.18.0-r1.ebuild b/dev-python/rope/rope-0.18.0-r1.ebuild
deleted file mode 100644
index f3463196ae8..00000000000
--- a/dev-python/rope/rope-0.18.0-r1.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-
-inherit distutils-r1
-
-DESCRIPTION="Python refactoring library"
-HOMEPAGE="https://github.com/python-rope/rope"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="LGPL-3"
-SLOT="0"
-KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~x86-linux"
-
-IUSE="doc"
-
-# Dependency for docbuild documentation which is not noted in
-# setup.py, using standard docutils builds docs successfully.
-DEPEND="doc? ( dev-python/docutils[${PYTHON_USEDEP}] )"
-
-PATCHES=(
- "${FILESDIR}"/${P}-add-python-3.9-support.patch
-)
-
-distutils_enable_tests pytest
-
-python_compile_all() {
- if use doc; then
- pushd docs > /dev/null || die
- mkdir build || die
- local i
- for i in ./*.rst; do
- rst2html.py $i > ./build/${i/rst/html} || die
- done
- popd > /dev/null || die
- fi
-}
-
-python_install_all() {
- use doc && local HTML_DOCS=( docs/build/. )
- distutils-r1_python_install_all
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-26 8:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-26 8:36 [gentoo-commits] repo/gentoo:master commit in: dev-python/rope/, dev-python/rope/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2021-04-06 7:22 Michał Górny
2020-02-17 15:55 Matt Turner
2015-11-10 16:08 Ian Delaney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox