Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pyupgrade for
openSUSE:Factory checked in at 2022-06-28 15:22:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyupgrade (Old)
and /work/SRC/openSUSE:Factory/.python-pyupgrade.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyupgrade"
Tue Jun 28 15:22:56 2022 rev:25 rq:985525 version:2.33.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyupgrade/python-pyupgrade.changes
2022-05-30 12:44:15.548415185 +0200
+++
/work/SRC/openSUSE:Factory/.python-pyupgrade.new.1548/python-pyupgrade.changes
2022-06-28 15:23:15.402021598 +0200
@@ -1,0 +2,10 @@
+Tue Jun 21 08:52:27 UTC 2022 - Sebastian Wagner <[email protected]>
+
+- update to version 2.33.0:
+ - feat: rewrite deprecated unittest methods
+ - Fix typos
+ * README.md
+ * tests/features/typing_classes_test.py
+ * tests/features/yield_from_test.py
+
+-------------------------------------------------------------------
Old:
----
python-pyupgrade-2.32.1.tar.gz
New:
----
python-pyupgrade-2.33.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyupgrade.spec ++++++
--- /var/tmp/diff_new_pack.PO37v0/_old 2022-06-28 15:23:15.826022230 +0200
+++ /var/tmp/diff_new_pack.PO37v0/_new 2022-06-28 15:23:15.834022242 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pyupgrade
-Version: 2.32.1
+Version: 2.33.0
Release: 0
Summary: A tool to automatically upgrade syntax for newer versions
License: MIT
++++++ python-pyupgrade-2.32.1.tar.gz -> python-pyupgrade-2.33.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyupgrade-2.32.1/.pre-commit-config.yaml
new/pyupgrade-2.33.0/.pre-commit-config.yaml
--- old/pyupgrade-2.32.1/.pre-commit-config.yaml 2022-05-05
03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/.pre-commit-config.yaml 2022-06-06
22:38:38.000000000 +0200
@@ -24,7 +24,7 @@
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
- rev: v2.32.1
+ rev: v2.33.0
hooks:
- id: pyupgrade
args: [--py37-plus]
@@ -37,6 +37,6 @@
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v0.950
+ rev: v0.960
hooks:
- id: mypy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyupgrade-2.32.1/README.md
new/pyupgrade-2.33.0/README.md
--- old/pyupgrade-2.32.1/README.md 2022-05-05 03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/README.md 2022-06-06 22:38:38.000000000 +0200
@@ -20,7 +20,7 @@
```yaml
- repo: https://github.com/asottile/pyupgrade
- rev: v2.32.1
+ rev: v2.33.0
hooks:
- id: pyupgrade
```
@@ -390,7 +390,7 @@
+print('py3.6+')
```
-Note that `if` blocks without an `else` will not be rewriten as it could
introduce a syntax error.
+Note that `if` blocks without an `else` will not be rewritten as it could
introduce a syntax error.
### remove `six` compatibility code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pyupgrade-2.32.1/pyupgrade/_plugins/unittest_aliases.py
new/pyupgrade-2.33.0/pyupgrade/_plugins/unittest_aliases.py
--- old/pyupgrade-2.32.1/pyupgrade/_plugins/unittest_aliases.py 2022-05-05
03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/pyupgrade/_plugins/unittest_aliases.py 2022-06-06
22:38:38.000000000 +0200
@@ -35,6 +35,12 @@
'assertRaisesRegexp': 'assertRaisesRegex',
}
+FUNCTION_MAPPING = {
+ 'findTestCases': 'defaultTestLoader.loadTestsFromModule',
+ 'makeSuite': 'defaultTestLoader.loadTestsFromTestCase',
+ 'getTestCaseNames': 'defaultTestLoader.getTestCaseNames',
+}
+
@register(ast.Call)
def visit_Call(
@@ -59,3 +65,15 @@
new=f'self.{method_mapping[node.func.attr]}',
)
yield ast_to_offset(node.func), func
+ elif (
+ isinstance(node.func, ast.Attribute) and
+ isinstance(node.func.value, ast.Name) and
+ node.func.value.id == 'unittest' and
+ node.func.attr in FUNCTION_MAPPING
+ ):
+ func = functools.partial(
+ replace_name,
+ name=node.func.attr,
+ new=f'unittest.{FUNCTION_MAPPING[node.func.attr]}',
+ )
+ yield ast_to_offset(node.func), func
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyupgrade-2.32.1/setup.cfg
new/pyupgrade-2.33.0/setup.cfg
--- old/pyupgrade-2.32.1/setup.cfg 2022-05-05 03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/setup.cfg 2022-06-06 22:38:38.000000000 +0200
@@ -1,6 +1,6 @@
[metadata]
name = pyupgrade
-version = 2.32.1
+version = 2.33.0
description = A tool to automatically upgrade syntax for newer versions.
long_description = file: README.md
long_description_content_type = text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pyupgrade-2.32.1/tests/features/typing_classes_test.py
new/pyupgrade-2.33.0/tests/features/typing_classes_test.py
--- old/pyupgrade-2.32.1/tests/features/typing_classes_test.py 2022-05-05
03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/tests/features/typing_classes_test.py 2022-06-06
22:38:38.000000000 +0200
@@ -162,7 +162,7 @@
id='indented, but on next line',
),
pytest.param(
- # mypy treates Tuple[int] and Tuple[int,] the same so in practice
+ # mypy treats Tuple[int] and Tuple[int,] the same so in practice
# preserving this doesn't really matter
'C = typing.NamedTuple("C", [("a", Tuple[int,])])',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pyupgrade-2.32.1/tests/features/unittest_aliases_test.py
new/pyupgrade-2.33.0/tests/features/unittest_aliases_test.py
--- old/pyupgrade-2.32.1/tests/features/unittest_aliases_test.py
2022-05-05 03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/tests/features/unittest_aliases_test.py
2022-06-06 22:38:38.000000000 +0200
@@ -63,3 +63,25 @@
def test_fix_unittest_aliases_py3(s, expected):
ret = _fix_plugins(s, settings=Settings(min_version=(3,)))
assert ret == expected
+
+
[email protected](
+ ('s', 'expected'),
+ (
+ (
+ 'unittest.findTestCases(MyTests)',
+ 'unittest.defaultTestLoader.loadTestsFromModule(MyTests)',
+ ),
+ (
+ 'unittest.makeSuite(MyTests)',
+ 'unittest.defaultTestLoader.loadTestsFromTestCase(MyTests)',
+ ),
+ (
+ 'unittest.getTestCaseNames(MyTests)',
+ 'unittest.defaultTestLoader.getTestCaseNames(MyTests)',
+ ),
+ ),
+)
+def test_fix_unittest_aliases_py311(s, expected):
+ ret = _fix_plugins(s, settings=Settings(min_version=(3, 11)))
+ assert ret == expected
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyupgrade-2.32.1/tests/features/yield_from_test.py
new/pyupgrade-2.33.0/tests/features/yield_from_test.py
--- old/pyupgrade-2.32.1/tests/features/yield_from_test.py 2022-05-05
03:00:25.000000000 +0200
+++ new/pyupgrade-2.33.0/tests/features/yield_from_test.py 2022-06-06
22:38:38.000000000 +0200
@@ -88,7 +88,7 @@
'\n'
' for x, y in z(): # Comment one\n'
'\n'
- ' # Commment two\n'
+ ' # Comment two\n'
' yield x, y # Comment three\n'
' # Comment four\n'
'\n\n'