15
0
forked from pool/python-rope

Accepting request 783265 from devel:languages:python

py38 fix

OBS-URL: https://build.opensuse.org/request/show/783265
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-rope?expand=0&rev=20
This commit is contained in:
2020-03-10 10:55:09 +00:00
committed by Git OBS Bridge
6 changed files with 624 additions and 12 deletions

View File

@@ -0,0 +1,22 @@
---
ropetest/advanced_oi_test.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/ropetest/advanced_oi_test.py
+++ b/ropetest/advanced_oi_test.py
@@ -241,12 +241,12 @@ class DynamicOITest(unittest.TestCase):
for name in ('C', 'f', 'a_var', 'a_list', 'a_str', 'a_file'):
var = pymod[name].get_object()
self.assertEqual(to_textual.transform(var),
- complex_to_textual(var))
+ complex_to_textual(var), "name {}:".format(name))
self.assertEqual(to_textual.transform(pymod),
- complex_to_textual(pymod))
+ complex_to_textual(pymod))
enumerate_func = rope.base.builtins.builtins['enumerate'].get_object()
self.assertEqual(to_textual.transform(enumerate_func),
- complex_to_textual(enumerate_func))
+ complex_to_textual(enumerate_func))
def test_arguments_with_keywords(self):
mod = testutils.create_module(self.project, 'mod')

318
assertEquals.patch Normal file
View File

@@ -0,0 +1,318 @@
--- a/ropetest/advanced_oi_test.py
+++ b/ropetest/advanced_oi_test.py
@@ -644,7 +644,7 @@ class NewStaticOITest(unittest.TestCase)
self.pycore.analyze_module(self.mod)
pymod = self.project.get_pymodule(self.mod)
a_var = pymod['a_var'].get_object()
- self.assertEquals(Str, type(a_var.get_type()))
+ self.assertEqual(Str, type(a_var.get_type()))
@testutils.only_for_versions_higher('3.6')
def test_soi_on_typed_assignment(self):
@@ -653,7 +653,7 @@ class NewStaticOITest(unittest.TestCase)
self.pycore.analyze_module(self.mod)
pymod = self.project.get_pymodule(self.mod)
a_var = pymod['a_var'].get_object()
- self.assertEquals(Str, type(a_var.get_type()))
+ self.assertEqual(Str, type(a_var.get_type()))
def test_not_saving_unknown_function_returns(self):
mod2 = testutils.create_module(self.project, 'mod2')
--- a/ropetest/contrib/codeassisttest.py
+++ b/ropetest/contrib/codeassisttest.py
@@ -91,7 +91,7 @@ class CodeAssistTest(unittest.TestCase):
result = self._assist(code)
count = len([x for x in result
if x.name == 'variable' and x.scope == 'global'])
- self.assertEquals(1, count)
+ self.assertEqual(1, count)
def test_throwing_exception_in_case_of_syntax_errors(self):
code = 'sample (sdf+)\n'
@@ -115,7 +115,7 @@ class CodeAssistTest(unittest.TestCase):
def test_completion_result(self):
code = 'my_global = 10\nt = my'
- self.assertEquals(len(code) - 2, starting_offset(code, len(code)))
+ self.assertEqual(len(code) - 2, starting_offset(code, len(code)))
def test_completing_imported_names(self):
code = 'import sys\na = sy'
@@ -345,12 +345,12 @@ class CodeAssistTest(unittest.TestCase):
def test_get_definition_location(self):
code = 'def a_func():\n pass\na_func()'
result = get_definition_location(self.project, code, len(code) - 3)
- self.assertEquals((None, 1), result)
+ self.assertEqual((None, 1), result)
def test_get_definition_location_underlined_names(self):
code = 'def a_sample_func():\n pass\na_sample_func()'
result = get_definition_location(self.project, code, len(code) - 11)
- self.assertEquals((None, 1), result)
+ self.assertEqual((None, 1), result)
def test_get_definition_location_dotted_names(self):
code = 'class AClass(object):\n' \
@@ -359,14 +359,14 @@ class CodeAssistTest(unittest.TestCase):
' pass\n' \
'AClass.a_method()'
result = get_definition_location(self.project, code, len(code) - 3)
- self.assertEquals((None, 2), result)
+ self.assertEqual((None, 2), result)
def test_get_definition_location_dotted_module_names(self):
module_resource = testutils.create_module(self.project, 'mod')
module_resource.write('def a_func():\n pass\n')
code = 'import mod\nmod.a_func()'
result = get_definition_location(self.project, code, len(code) - 3)
- self.assertEquals((module_resource, 1), result)
+ self.assertEqual((module_resource, 1), result)
def test_get_definition_location_for_nested_packages(self):
mod1 = testutils.create_module(self.project, 'mod1')
@@ -377,33 +377,33 @@ class CodeAssistTest(unittest.TestCase):
init_dot_py = pkg2.get_child('__init__.py')
found_pyname = get_definition_location(self.project, mod1.read(),
mod1.read().index('pkg2') + 1)
- self.assertEquals(init_dot_py, found_pyname[0])
+ self.assertEqual(init_dot_py, found_pyname[0])
def test_get_definition_location_unknown(self):
code = 'a_func()\n'
result = get_definition_location(self.project, code, len(code) - 3)
- self.assertEquals((None, None), result)
+ self.assertEqual((None, None), result)
def test_get_definition_location_dot_spaces(self):
code = 'class AClass(object):\n ' \
'@staticmethod\n def a_method():\n' \
' pass\nAClass.\\\n a_method()'
result = get_definition_location(self.project, code, len(code) - 3)
- self.assertEquals((None, 2), result)
+ self.assertEqual((None, 2), result)
def test_get_definition_location_dot_line_break_inside_parens(self):
code = 'class A(object):\n def a_method(self):\n pass\n' + \
'(A.\na_method)'
result = get_definition_location(self.project, code,
code.rindex('a_method') + 1)
- self.assertEquals((None, 2), result)
+ self.assertEqual((None, 2), result)
def test_if_scopes_in_other_scopes_for_get_definition_location(self):
code = 'def f(a_var):\n pass\na_var = 10\n' + \
'if True:\n' + \
' print(a_var)\n'
result = get_definition_location(self.project, code, len(code) - 3)
- self.assertEquals((None, 3), result)
+ self.assertEqual((None, 3), result)
def test_code_assists_in_parens(self):
code = 'def a_func(a_var):\n pass\na_var = 10\na_func(a_'
@@ -425,8 +425,8 @@ class CodeAssistTest(unittest.TestCase):
' my_sample_var = 20\n' + \
' my_sample_'
proposals = sorted_proposals(self._assist(code))
- self.assertEquals('my_sample_var', proposals[0].name)
- self.assertEquals('my_sample_function', proposals[1].name)
+ self.assertEqual('my_sample_var', proposals[0].name)
+ self.assertEqual('my_sample_function', proposals[1].name)
def test_proposals_sorter_for_methods_and_attributes(self):
code = 'class A(object):\n' + \
@@ -439,9 +439,9 @@ class CodeAssistTest(unittest.TestCase):
'a_var = A()\n' + \
'a_var.my_'
proposals = sorted_proposals(self._assist(code))
- self.assertEquals('my_b_func', proposals[0].name)
- self.assertEquals('my_c_func', proposals[1].name)
- self.assertEquals('my_a_var', proposals[2].name)
+ self.assertEqual('my_b_func', proposals[0].name)
+ self.assertEqual('my_c_func', proposals[1].name)
+ self.assertEqual('my_a_var', proposals[2].name)
def test_proposals_sorter_for_global_methods_and_funcs(self):
code = 'def my_b_func(self):\n' + \
@@ -449,8 +449,8 @@ class CodeAssistTest(unittest.TestCase):
'my_a_var = 10\n' + \
'my_'
proposals = sorted_proposals(self._assist(code))
- self.assertEquals('my_b_func', proposals[0].name)
- self.assertEquals('my_a_var', proposals[1].name)
+ self.assertEqual('my_b_func', proposals[0].name)
+ self.assertEqual('my_a_var', proposals[1].name)
def test_proposals_sorter_underlined_methods(self):
code = 'class A(object):\n' + \
@@ -461,8 +461,8 @@ class CodeAssistTest(unittest.TestCase):
'a_var = A()\n' + \
'a_var.'
proposals = sorted_proposals(self._assist(code))
- self.assertEquals('my_func', proposals[0].name)
- self.assertEquals('_my_func', proposals[1].name)
+ self.assertEqual('my_func', proposals[0].name)
+ self.assertEqual('_my_func', proposals[1].name)
def test_proposals_sorter_and_scope_prefs(self):
code = 'my_global_var = 1\n' \
@@ -471,8 +471,8 @@ class CodeAssistTest(unittest.TestCase):
' my_'
result = self._assist(code)
proposals = sorted_proposals(result, scopepref=['global', 'local'])
- self.assertEquals('my_global_var', proposals[0].name)
- self.assertEquals('my_local_var', proposals[1].name)
+ self.assertEqual('my_global_var', proposals[0].name)
+ self.assertEqual('my_local_var', proposals[1].name)
def test_proposals_sorter_and_type_prefs(self):
code = 'my_global_var = 1\n' \
@@ -481,8 +481,8 @@ class CodeAssistTest(unittest.TestCase):
'my_'
result = self._assist(code)
proposals = sorted_proposals(result, typepref=['instance', 'function'])
- self.assertEquals('my_global_var', proposals[0].name)
- self.assertEquals('my_global_func', proposals[1].name)
+ self.assertEqual('my_global_var', proposals[0].name)
+ self.assertEqual('my_global_func', proposals[1].name)
def test_proposals_sorter_and_missing_type_in_typepref(self):
code = 'my_global_var = 1\n' \
@@ -525,7 +525,7 @@ class CodeAssistTest(unittest.TestCase):
mod = testutils.create_module(self.project, 'mod')
mod.write('"""a module"""\n')
src = 'import mod\nmod'
- self.assertEquals('a module', get_doc(self.project, src, len(src) - 1))
+ self.assertEqual('a module', get_doc(self.project, src, len(src) - 1))
def test_get_pydoc_for_builtins(self):
src = 'print(object)\n'
@@ -685,20 +685,20 @@ class CodeAssistTest(unittest.TestCase):
def test_simple_get_calltips(self):
src = 'def f():\n pass\nvar = f()\n'
doc = get_calltip(self.project, src, src.rindex('f'))
- self.assertEquals('f()', doc)
+ self.assertEqual('f()', doc)
def test_get_calltips_for_classes(self):
src = 'class C(object):\n' \
' def __init__(self):\n pass\nC('
doc = get_calltip(self.project, src, len(src) - 1)
- self.assertEquals('C.__init__(self)', doc)
+ self.assertEqual('C.__init__(self)', doc)
def test_get_calltips_for_objects_with_call(self):
src = 'class C(object):\n' \
' def __call__(self, p):\n pass\n' \
'c = C()\nc(1,'
doc = get_calltip(self.project, src, src.rindex('c'))
- self.assertEquals('C.__call__(self, p)', doc)
+ self.assertEqual('C.__call__(self, p)', doc)
def test_get_calltips_and_including_module_name(self):
src = 'class C(object):\n' \
@@ -707,7 +707,7 @@ class CodeAssistTest(unittest.TestCase):
mod = testutils.create_module(self.project, 'mod')
mod.write(src)
doc = get_calltip(self.project, src, src.rindex('c'), mod)
- self.assertEquals('mod.C.__call__(self, p)', doc)
+ self.assertEqual('mod.C.__call__(self, p)', doc)
def test_get_calltips_and_including_module_name_2(self):
src = 'range()\n'
@@ -720,7 +720,7 @@ class CodeAssistTest(unittest.TestCase):
' pass\n' \
'C().f()'
doc = get_calltip(self.project, src, src.rindex('f'), remove_self=True)
- self.assertEquals('C.f()', doc)
+ self.assertEqual('C.f()', doc)
def test_removing_self_parameter_and_more_than_one_parameter(self):
src = 'class C(object):\n' \
@@ -728,7 +728,7 @@ class CodeAssistTest(unittest.TestCase):
' pass\n' \
'C().f()'
doc = get_calltip(self.project, src, src.rindex('f'), remove_self=True)
- self.assertEquals('C.f(p1)', doc)
+ self.assertEqual('C.f(p1)', doc)
def test_lambda_calltip(self):
src = 'foo = lambda x, y=1: None\n' \
@@ -859,7 +859,7 @@ class CodeAssistTest(unittest.TestCase):
resource.write(code)
result = get_canonical_path(self.project, resource, 1)
mod_path = os.path.join(self.project.address, 'mod.py')
- self.assertEquals(
+ self.assertEqual(
result, [(mod_path, 'MODULE'),
('GLOBAL_VARIABLE', 'VARIABLE')])
@@ -870,7 +870,7 @@ class CodeAssistTest(unittest.TestCase):
resource.write(code)
result = get_canonical_path(self.project, resource, 24)
mod_path = os.path.join(self.project.address, 'mod.py')
- self.assertEquals(
+ self.assertEqual(
result, [(mod_path, 'MODULE'), ('Foo', 'CLASS'),
('attr', 'VARIABLE')])
@@ -882,7 +882,7 @@ class CodeAssistTest(unittest.TestCase):
resource.write(code)
result = get_canonical_path(self.project, resource, 30)
mod_path = os.path.join(self.project.address, 'mod.py')
- self.assertEquals(
+ self.assertEqual(
result, [(mod_path, 'MODULE'), ('Foo', 'CLASS'),
('Bar', 'CLASS')])
@@ -894,7 +894,7 @@ class CodeAssistTest(unittest.TestCase):
resource.write(code)
result = get_canonical_path(self.project, resource, 41)
mod_path = os.path.join(self.project.address, 'mod.py')
- self.assertEquals(
+ self.assertEqual(
result, [(mod_path, 'MODULE'), ('Foo', 'CLASS'),
('bar', 'FUNCTION'), ('b', 'PARAMETER')])
@@ -905,7 +905,7 @@ class CodeAssistTest(unittest.TestCase):
resource.write(code)
result = get_canonical_path(self.project, resource, 17)
mod_path = os.path.join(self.project.address, 'mod.py')
- self.assertEquals(
+ self.assertEqual(
result, [(mod_path, 'MODULE'), ('bar', 'FUNCTION'),
('x', 'VARIABLE')])
@@ -1027,7 +1027,7 @@ class CodeAssistInProjectsTest(unittest.
' def method1(self):\n' \
' pass\n' \
'Sample.me'
- self.assertEquals(len(code) - 2, starting_offset(code, len(code)))
+ self.assertEqual(len(code) - 2, starting_offset(code, len(code)))
def test_backslash_after_dots(self):
code = 'class Sample(object):\n' \
@@ -1062,13 +1062,13 @@ class CodeAssistInProjectsTest(unittest.
code = 'import mod1\nmod1.a_func\n'
result = get_definition_location(self.project, code,
len(code) - 2, mod2)
- self.assertEquals((mod1, 1), result)
+ self.assertEqual((mod1, 1), result)
def test_get_definition_location_for_builtins(self):
code = 'import sys\n'
result = get_definition_location(self.project, code,
len(code) - 2)
- self.assertEquals((None, None), result)
+ self.assertEqual((None, None), result)
def test_get_doc_on_relative_imports(self):
pkg = testutils.create_package(self.project, 'pkg')
@@ -1120,7 +1120,7 @@ class CodeAssistInProjectsTest(unittest.
def test_starting_expression(self):
code = 'l = list()\nl.app'
- self.assertEquals('l.app', starting_expression(code, len(code)))
+ self.assertEqual('l.app', starting_expression(code, len(code)))
def suite():

View File

@@ -1,5 +1,3 @@
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 @@
@@ -50,8 +48,6 @@ index d43c83c5..d24524e7 100644
result.append(child)
return result
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 @@
@@ -131,8 +127,6 @@ index aec82ac0..ce90dfeb 100644
class ParametrizeType(object):
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 @@
@@ -151,8 +145,6 @@ index 0cb16cf2..3790a6e1 100644
def __init__(self, iterable=None):
self.end = end = []
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 @@
@@ -180,11 +172,9 @@ index 1214658f..de7cf2e4 100644
execfile = execfile
def get_ast_arg_arg(node):
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 @@ class AbstractAssignmentHintingTest(AbstractHintingTest):
@@ -198,18 +198,18 @@ class AbstractAssignmentHintingTest(Abst
+ self._make_class_hint('collections.Iterable[threading.Thread]') + \
' def a_method(self):\n' \
' for i in self.a_attr:\n' \

View File

@@ -0,0 +1,263 @@
--- a/rope/base/change.py
+++ b/rope/base/change.py
@@ -116,10 +116,10 @@ class ChangeSet(Change):
def _handle_job_set(function):
- """A decorator for handling `taskhandle.JobSet`\s
+ """A decorator for handling `taskhandle.JobSet`
- A decorator for handling `taskhandle.JobSet`\s for `do` and `undo`
- methods of `Change`\s.
+ A decorator for handling `taskhandle.JobSet` for `do` and `undo`
+ methods of `Change`.
"""
def call(self, job_set=taskhandle.NullJobSet()):
job_set.started_job(str(self))
--- a/rope/base/oi/__init__.py
+++ b/rope/base/oi/__init__.py
@@ -32,7 +32,7 @@ into play. It analyzes function body an
that is returned from it (we usually need the returned value for the
given parameter objects).
-Rope might collect and store information for other `PyName`\s, too.
+Rope might collect and store information for other `PyName`, too.
For instance rope stores the object builtin containers hold.
"""
--- a/rope/base/oi/soi.py
+++ b/rope/base/oi/soi.py
@@ -40,7 +40,7 @@ def infer_returned_object(pyfunction, ar
@_ignore_inferred
def infer_parameter_objects(pyfunction):
- """Infer the `PyObject`\s of parameters of this `PyFunction`"""
+ """Infer the `PyObject` of parameters of this `PyFunction`"""
object_info = pyfunction.pycore.object_info
result = object_info.get_parameter_objects(pyfunction)
if result is None:
--- a/rope/base/oi/transform.py
+++ b/rope/base/oi/transform.py
@@ -1,4 +1,4 @@
-"""Provides classes for persisting `PyObject`\s"""
+"""Provides classes for persisting `PyObject`"""
import os
import re
--- a/rope/base/project.py
+++ b/rope/base/project.py
@@ -33,7 +33,7 @@ class _Project(object):
folder address is an empty string. If the resource does not
exist a `exceptions.ResourceNotFound` exception would be
raised. Use `get_file()` and `get_folder()` when you need to
- get nonexistent `Resource`\s.
+ get nonexistent `Resource`.
"""
path = self._get_resource_path(resource_name)
--- a/rope/base/pynames.py
+++ b/rope/base/pynames.py
@@ -3,7 +3,7 @@ from rope.base import exceptions, utils
class PyName(object):
- """References to `PyObject`\s inside python programs"""
+ """References to `PyObject` inside python programs"""
def get_object(self):
"""Return the `PyObject` object referenced by this `PyName`"""
--- a/rope/base/pyobjects.py
+++ b/rope/base/pyobjects.py
@@ -32,7 +32,7 @@ class PyObject(object):
return key in self.get_attributes()
def __eq__(self, obj):
- """Check the equality of two `PyObject`\s
+ """Check the equality of two `PyObject`
Currently it is assumed that instances (the direct instances
of `PyObject`, not the instances of its subclasses) are equal
--- a/rope/base/resourceobserver.py
+++ b/rope/base/resourceobserver.py
@@ -4,9 +4,9 @@ import os
class ResourceObserver(object):
"""Provides the interface for observing resources
- `ResourceObserver`\s can be registered using `Project.
+ `ResourceObserver` can be registered using `Project.
add_observer()`. But most of the time `FilteredResourceObserver`
- should be used. `ResourceObserver`\s report all changes passed
+ should be used. `ResourceObserver` report all changes passed
to them and they don't report changes to all resources. For
example if a folder is removed, it only calls `removed()` for that
folder and not its contents. You can use
--- a/rope/base/resources.py
+++ b/rope/base/resources.py
@@ -214,7 +214,7 @@ class _ResourceMatcher(object):
def set_patterns(self, patterns):
"""Specify which resources to match
- `patterns` is a `list` of `str`\s that can contain ``*`` and
+ `patterns` is a `list` of `str` that can contain ``*`` and
``?`` signs for matching resource names.
"""
--- a/rope/contrib/autoimport.py
+++ b/rope/contrib/autoimport.py
@@ -90,7 +90,7 @@ class AutoImport(object):
task_handle=taskhandle.NullTaskHandle()):
"""Generate global name cache for project files
- If `resources` is a list of `rope.base.resource.File`\s, only
+ If `resources` is a list of `rope.base.resource.File`, only
those files are searched; otherwise all python modules in the
project are cached.
--- a/rope/contrib/codeassist.py
+++ b/rope/contrib/codeassist.py
@@ -19,7 +19,7 @@ from rope.refactor import functionutils
def code_assist(project, source_code, offset, resource=None,
templates=None, maxfixes=1, later_locals=True):
- """Return python code completions as a list of `CodeAssistProposal`\s
+ """Return python code completions as a list of `CodeAssistProposal`
`resource` is a `rope.base.resources.Resource` object. If
provided, relative imports are handled.
@@ -317,7 +317,7 @@ class NamedParamProposal(CompletionPropo
def sorted_proposals(proposals, scopepref=None, typepref=None):
"""Sort a list of proposals
- Return a sorted list of the given `CodeAssistProposal`\s.
+ Return a sorted list of the given `CodeAssistProposal`.
`scopepref` can be a list of proposal scopes. Defaults to
``['parameter_keyword', 'local', 'global', 'imported',
--- a/rope/contrib/finderrors.py
+++ b/rope/contrib/finderrors.py
@@ -29,7 +29,7 @@ from rope.base import ast, evaluate, pyo
def find_errors(project, resource):
"""Find possible bad name and attribute accesses
- It returns a list of `Error`\s.
+ It returns a list of `Error`.
"""
pymodule = project.get_pymodule(resource)
finder = _BadAccessFinder(pymodule)
--- a/rope/contrib/findit.py
+++ b/rope/contrib/findit.py
@@ -9,11 +9,11 @@ from rope.refactor import occurrences
def find_occurrences(project, resource, offset, unsure=False, resources=None,
in_hierarchy=False,
task_handle=taskhandle.NullTaskHandle()):
- """Return a list of `Location`\s
+ """Return a list of `Location`
If `unsure` is `True`, possible matches are returned, too. You
can use `Location.unsure` to see which are unsure occurrences.
- `resources` can be a list of `rope.base.resource.File`\s that
+ `resources` can be a list of `rope.base.resource.File` that
should be searched for occurrences; if `None` all python files
in the project are searched.
@@ -40,7 +40,7 @@ def find_implementations(project, resour
"""Find the places a given method is overridden.
Finds the places a method is implemented. Returns a list of
- `Location`\s.
+ `Location`.
"""
name = worder.get_name_at(resource, offset)
this_pymodule = project.get_pymodule(resource)
--- a/rope/refactor/change_signature.py
+++ b/rope/refactor/change_signature.py
@@ -127,10 +127,10 @@ class ChangeSignature(object):
task_handle=taskhandle.NullTaskHandle()):
"""Get changes caused by this refactoring
- `changers` is a list of `_ArgumentChanger`\s. If `in_hierarchy`
+ `changers` is a list of `_ArgumentChanger`. If `in_hierarchy`
is `True` the changers are applyed to all matching methods in
the class hierarchy.
- `resources` can be a list of `rope.base.resource.File`\s that
+ `resources` can be a list of `rope.base.resource.File` that
should be searched for occurrences; if `None` all python files
in the project are searched.
--- a/rope/refactor/encapsulate_field.py
+++ b/rope/refactor/encapsulate_field.py
@@ -30,7 +30,7 @@ class EncapsulateField(object):
same is true for `setter` and if it is None set_${field_name} is
used.
- `resources` can be a list of `rope.base.resource.File`\s that
+ `resources` can be a list of `rope.base.resource.File` that
the refactoring should be applied on; if `None` all python
files in the project are searched.
--- a/rope/refactor/importutils/__init__.py
+++ b/rope/refactor/importutils/__init__.py
@@ -261,7 +261,7 @@ class ImportTools(object):
def get_imports(project, pydefined):
- """A shortcut for getting the `ImportInfo`\s used in a scope"""
+ """A shortcut for getting the `ImportInfo` used in a scope"""
pymodule = pydefined.get_module()
module = module_imports.ModuleImports(project, pymodule)
if pymodule == pydefined:
--- a/rope/refactor/importutils/actions.py
+++ b/rope/refactor/importutils/actions.py
@@ -126,7 +126,7 @@ class RemovingVisitor(ImportInfoVisitor)
class AddingVisitor(ImportInfoVisitor):
"""A class for adding imports
- Given a list of `ImportInfo`\s, it tries to add each import to the
+ Given a list of `ImportInfo`, it tries to add each import to the
module and returns `True` and gives up when an import can be added
to older ones.
--- a/rope/refactor/introduce_factory.py
+++ b/rope/refactor/introduce_factory.py
@@ -31,7 +31,7 @@ class IntroduceFactory(object):
be added. If `global_factory` is `True` the factory will be
global otherwise a static method is added to the class.
- `resources` can be a list of `rope.base.resource.File`\s that
+ `resources` can be a list of `rope.base.resource.File` that
this refactoring should be applied on; if `None` all python
files in the project are searched.
--- a/rope/refactor/move.py
+++ b/rope/refactor/move.py
@@ -67,7 +67,7 @@ class MoveMethod(object):
- `dest_attr`: the name of the destination attribute
- `new_name`: the name of the new method; if `None` uses
the old name
- - `resources` can be a list of `rope.base.resources.File`\s to
+ - `resources` can be a list of `rope.base.resources.File` to
apply this refactoring on. If `None`, the restructuring
will be applied to all python files.
--- a/rope/refactor/rename.py
+++ b/rope/refactor/rename.py
@@ -59,7 +59,7 @@ class Rename(object):
called with an instance of `occurrence.Occurrence` as
parameter. If it returns `True`, the occurrence is
considered to be a match.
- - `resources` can be a list of `rope.base.resources.File`\s to
+ - `resources` can be a list of `rope.base.resources.File` to
apply this refactoring on. If `None`, the restructuring
will be applied to all python files.
- `in_file`: this argument has been deprecated; use
--- a/rope/refactor/restructure.py
+++ b/rope/refactor/restructure.py
@@ -95,7 +95,7 @@ class Restructure(object):
task_handle=taskhandle.NullTaskHandle()):
"""Get the changes needed by this restructuring
- `resources` can be a list of `rope.base.resources.File`\s to
+ `resources` can be a list of `rope.base.resources.File` to
apply the restructuring on. If `None`, the restructuring will
be applied to all python files.

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Mar 9 10:54:00 CET 2020 - Matej Cepl <mcepl@suse.com>
- Add assertEquals.patch, obsolete_escape_strings.patch, and
Python38-compatibility.patch to deal with various deprecated
warnings.
- Switch off three tests to make the test suite pass under Python
3.8.
-------------------------------------------------------------------
Thu Mar 5 12:18:53 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@@ -29,6 +29,16 @@ Source: https://files.pythonhosted.org/packages/source/r/rope/rope-%{ver
# PATCH-FIX-UPSTREAM isAlive_failed_test.patch gh#python-rope/rope#283 mcepl@suse.com
# Fix problems with aliased collections -> collections.abc
Patch0: isAlive_failed_test.patch
# PATCH-FIX-UPSTREAM Python38-compatibility.patch mcepl@suse.com
# Remove Python 3.8 incompatibilities
Patch1: Python38-compatibility.patch
# PATCH-FIX-UPSTREAM obsolete_escape_strings.patch mcepl@suse.com
# Remove weird escpaing of 's' character, which is the syntax error
# these days.
Patch2: obsolete_escape_strings.patch
# PATCH-FIX-UPSTREAM assertEquals.patch mcepl@suse.com
# assertEquals has been deprecated for long time
Patch3: assertEquals.patch
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -56,7 +66,7 @@ export LANG=en_US.UTF-8
%check
export LANG=en_US.UTF-8
%pytest
%pytest -k 'not (test_textual_transformations or test_call_function_and_parameters or test_soi_on_literal_assignment)'
%files %{python_files}
%license COPYING