Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-asttokens for
openSUSE:Factory checked in at 2022-12-06 14:22:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-asttokens (Old)
and /work/SRC/openSUSE:Factory/.python-asttokens.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-asttokens"
Tue Dec 6 14:22:45 2022 rev:7 rq:1040387 version:2.2.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-asttokens/python-asttokens.changes
2022-12-03 10:03:12.475097398 +0100
+++
/work/SRC/openSUSE:Factory/.python-asttokens.new.1835/python-asttokens.changes
2022-12-06 14:22:46.629376396 +0100
@@ -1,0 +2,8 @@
+Mon Dec 5 12:26:12 UTC 2022 - ecsos <[email protected]>
+
+- Update to version 2.2.1
+ * Test 3.11
+- Update to version 2.2.0
+ * Fixes for newer astroid versions
+
+-------------------------------------------------------------------
Old:
----
asttokens-2.1.0.tar.gz
New:
----
asttokens-2.2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-asttokens.spec ++++++
--- /var/tmp/diff_new_pack.pN4iGo/_old 2022-12-06 14:22:47.153379270 +0100
+++ /var/tmp/diff_new_pack.pN4iGo/_new 2022-12-06 14:22:47.157379292 +0100
@@ -21,7 +21,7 @@
%define skip_python2 1
%define skip_python36 1
Name: python-asttokens
-Version: 2.1.0
+Version: 2.2.1
Release: 0
Summary: Annotate AST trees with source code positions
License: Apache-2.0
++++++ asttokens-2.1.0.tar.gz -> asttokens-2.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/.github/workflows/build-and-test.yml
new/asttokens-2.2.1/.github/workflows/build-and-test.yml
--- old/asttokens-2.1.0/.github/workflows/build-and-test.yml 2022-08-15
12:49:10.000000000 +0200
+++ new/asttokens-2.2.1/.github/workflows/build-and-test.yml 2022-12-05
11:33:06.000000000 +0100
@@ -19,6 +19,7 @@
- 3.8
- 3.9
- '3.10'
+ - 3.11
# As per
https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#pypy
list of versions
- pypy-2.7
- pypy-3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/PKG-INFO new/asttokens-2.2.1/PKG-INFO
--- old/asttokens-2.1.0/PKG-INFO 2022-10-29 13:23:38.843023000 +0200
+++ new/asttokens-2.2.1/PKG-INFO 2022-12-05 11:34:12.659172500 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: asttokens
-Version: 2.1.0
+Version: 2.2.1
Summary: Annotate AST trees with source code positions
Home-page: https://github.com/gristlabs/asttokens
Author: Dmitry Sagalovskiy, Grist Labs
@@ -25,6 +25,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens/astroid_compat.py
new/asttokens-2.2.1/asttokens/astroid_compat.py
--- old/asttokens-2.1.0/asttokens/astroid_compat.py 1970-01-01
01:00:00.000000000 +0100
+++ new/asttokens-2.2.1/asttokens/astroid_compat.py 2022-11-29
12:31:12.000000000 +0100
@@ -0,0 +1,14 @@
+try:
+ from astroid import nodes as astroid_node_classes
+
+ # astroid_node_classes should be whichever module has the NodeNG class
+ from astroid.nodes import NodeNG
+except Exception:
+ try:
+ from astroid import node_classes as astroid_node_classes
+ from astroid.node_classes import NodeNG
+ except Exception: # pragma: no cover
+ astroid_node_classes = None
+ NodeNG = None
+
+__all__ = ["astroid_node_classes", "NodeNG"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens/mark_tokens.py
new/asttokens-2.2.1/asttokens/mark_tokens.py
--- old/asttokens-2.1.0/asttokens/mark_tokens.py 2022-10-05
19:53:22.000000000 +0200
+++ new/asttokens-2.2.1/asttokens/mark_tokens.py 2022-12-05
11:33:06.000000000 +0100
@@ -24,12 +24,7 @@
from . import util
from .asttokens import ASTTokens
from .util import AstConstant
-
-try:
- import astroid.node_classes as nc
-except Exception:
- # This is only used for type checking, we don't need it if astroid isn't
installed.
- nc = None
+from .astroid_compat import astroid_node_classes as nc
if TYPE_CHECKING:
from .util import AstNode
@@ -88,6 +83,9 @@
first = token
last = None
for child in cast(Callable, self._iter_children)(node):
+ # astroid slices have especially wrong positions, we don't want them to
corrupt their parents.
+ if util.is_empty_astroid_slice(child):
+ continue
if not first or child.first_token.index < first.index:
first = child.first_token
if not last or child.last_token.index > last.index:
@@ -268,6 +266,11 @@
first_token = self._code.next_token(first_token)
return (first_token, last_token)
+ def visit_matchclass(self, node, first_token, last_token):
+ # type: (util.Token, util.Token, util.Token) -> Tuple[util.Token,
util.Token]
+ last_token = self.handle_following_brackets(node, last_token, '(')
+ return (first_token, last_token)
+
def visit_subscript(self,
node, # type: AstNode
first_token, # type: util.Token
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens/util.py
new/asttokens-2.2.1/asttokens/util.py
--- old/asttokens-2.1.0/asttokens/util.py 2022-10-29 12:14:52.000000000
+0200
+++ new/asttokens-2.2.1/asttokens/util.py 2022-12-05 11:33:06.000000000
+0100
@@ -24,8 +24,9 @@
from six import iteritems
+
if TYPE_CHECKING: # pragma: no cover
- from astroid.node_classes import NodeNG
+ from .astroid_compat import NodeNG
# Type class used to expand out the definition of AST to include fields
added by this library
# It's not actually used for anything other than type checking though!
@@ -218,6 +219,15 @@
)
+def is_empty_astroid_slice(node):
+ # type: (AstNode) -> bool
+ return (
+ node.__class__.__name__ == "Slice"
+ and not isinstance(node, ast.AST)
+ and node.lower is node.upper is node.step is None
+ )
+
+
# Sentinel value used by visit_tree().
_PREVISIT = object()
@@ -388,7 +398,7 @@
"""
child_stmts = [
child for child in ast.iter_child_nodes(node)
- if isinstance(child, (ast.stmt, ast.excepthandler))
+ if isinstance(child, (ast.stmt, ast.excepthandler, getattr(ast,
"match_case", ())))
]
if child_stmts:
return last_stmt(child_stmts[-1])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens/version.py
new/asttokens-2.2.1/asttokens/version.py
--- old/asttokens-2.1.0/asttokens/version.py 2022-10-29 13:23:38.000000000
+0200
+++ new/asttokens-2.2.1/asttokens/version.py 2022-12-05 11:34:12.000000000
+0100
@@ -1 +1 @@
-__version__ = "2.1.0"
+__version__ = "2.2.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens.egg-info/PKG-INFO
new/asttokens-2.2.1/asttokens.egg-info/PKG-INFO
--- old/asttokens-2.1.0/asttokens.egg-info/PKG-INFO 2022-10-29
13:23:38.000000000 +0200
+++ new/asttokens-2.2.1/asttokens.egg-info/PKG-INFO 2022-12-05
11:34:12.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: asttokens
-Version: 2.1.0
+Version: 2.2.1
Summary: Annotate AST trees with source code positions
Home-page: https://github.com/gristlabs/asttokens
Author: Dmitry Sagalovskiy, Grist Labs
@@ -25,6 +25,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens.egg-info/SOURCES.txt
new/asttokens-2.2.1/asttokens.egg-info/SOURCES.txt
--- old/asttokens-2.1.0/asttokens.egg-info/SOURCES.txt 2022-10-29
13:23:38.000000000 +0200
+++ new/asttokens-2.2.1/asttokens.egg-info/SOURCES.txt 2022-12-05
11:34:12.000000000 +0100
@@ -10,6 +10,7 @@
tox.ini
.github/workflows/build-and-test.yml
asttokens/__init__.py
+asttokens/astroid_compat.py
asttokens/asttokens.py
asttokens/line_numbers.py
asttokens/mark_tokens.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/asttokens.egg-info/requires.txt
new/asttokens-2.2.1/asttokens.egg-info/requires.txt
--- old/asttokens-2.1.0/asttokens.egg-info/requires.txt 2022-10-29
13:23:38.000000000 +0200
+++ new/asttokens-2.2.1/asttokens.egg-info/requires.txt 2022-12-05
11:34:12.000000000 +0100
@@ -4,5 +4,5 @@
typing
[test]
-astroid<=2.5.3
+astroid
pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/pyproject.toml
new/asttokens-2.2.1/pyproject.toml
--- old/asttokens-2.1.0/pyproject.toml 2022-08-15 12:49:10.000000000 +0200
+++ new/asttokens-2.2.1/pyproject.toml 2022-11-29 12:31:12.000000000 +0100
@@ -20,5 +20,5 @@
ignore_missing_imports=true
[[tool.mypy.overrides]]
-module = ["astroid", "astroid.node_classes"]
-ignore_missing_imports = true
\ No newline at end of file
+module = ["astroid", "astroid.node_classes", "astroid.nodes",
"astroid.nodes.utils"]
+ignore_missing_imports = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/setup.cfg
new/asttokens-2.2.1/setup.cfg
--- old/asttokens-2.1.0/setup.cfg 2022-10-29 13:23:38.843023000 +0200
+++ new/asttokens-2.2.1/setup.cfg 2022-12-05 11:34:12.663172500 +0100
@@ -28,6 +28,7 @@
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
+ Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
@@ -39,7 +40,7 @@
setup_requires = setuptools>=44; setuptools_scm[toml]>=3.4.3
[options.extras_require]
-test = astroid<=2.5.3; pytest
+test = astroid; pytest
[options.package_data]
asttokens = py.typed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/tests/test_astroid.py
new/asttokens-2.2.1/tests/test_astroid.py
--- old/asttokens-2.1.0/tests/test_astroid.py 2022-08-08 16:44:42.000000000
+0200
+++ new/asttokens-2.2.1/tests/test_astroid.py 2022-11-29 12:31:12.000000000
+0100
@@ -2,9 +2,9 @@
from __future__ import unicode_literals, print_function
import astroid
-from astroid.node_classes import NodeNG
from asttokens import ASTTokens
+from asttokens.astroid_compat import astroid_node_classes
from . import test_mark_tokens
@@ -13,7 +13,7 @@
is_astroid_test = True
module = astroid
- nodes_classes = NodeNG
+ nodes_classes = astroid_node_classes.NodeNG
context_classes = [
(astroid.Name, astroid.DelName, astroid.AssignName),
(astroid.Attribute, astroid.DelAttr, astroid.AssignAttr),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/tests/test_mark_tokens.py
new/asttokens-2.2.1/tests/test_mark_tokens.py
--- old/asttokens-2.1.0/tests/test_mark_tokens.py 2022-10-29
12:14:52.000000000 +0200
+++ new/asttokens-2.2.1/tests/test_mark_tokens.py 2022-12-05
11:33:06.000000000 +0100
@@ -19,6 +19,11 @@
from . import tools
+try:
+ from astroid.nodes.utils import Position as AstroidPosition
+except Exception:
+ AstroidPosition = ()
+
class TestMarkTokens(unittest.TestCase):
maxDiff = None
@@ -230,7 +235,7 @@
def test_slices(self):
# Make sure we don't fail on parsing slices of the form `foo[4:]`.
- source = "(foo.Area_Code, str(foo.Phone)[:3], str(foo.Phone)[3:], foo[:],
bar[::2, :], [a[:]][::-1])"
+ source = "(foo.Area_Code, str(foo.Phone)[:3], str(foo.Phone)[3:], foo[:],
bar[::2, :], bar2[:, ::2], [a[:]][::-1])"
m = self.create_mark_checker(source)
self.assertIn("Tuple:" + source, m.view_nodes_at(1, 0))
self.assertEqual(m.view_nodes_at(1, 1),
@@ -243,7 +248,7 @@
# important, so we skip them here.
self.assertEqual({n for n in m.view_nodes_at(1, 56) if 'Slice:' not in n},
{ "Subscript:foo[:]", "Name:foo" })
- self.assertEqual({n for n in m.view_nodes_at(1, 64) if 'Slice:' not in n},
+ self.assertEqual({n for n in m.view_nodes_at(1, 64) if 'Slice:' not in n
and 'Tuple:' not in n},
{ "Subscript:bar[::2, :]", "Name:bar" })
def test_adjacent_strings(self):
@@ -745,6 +750,32 @@
partial_sums = [total := total + v for v in values]
""")
+ if sys.version_info >= (3, 10):
+ def test_match_case(self):
+ m = self.create_mark_checker("""
+if 0:
+ match x:
+ case ast.BinOp():
+ if z:
+ pass
+ case cls(a,b) if y:
+ pass
+ case _:
+ match y:
+ case 1:
+ pass
+ case _:
+ pass
+""")
+ self.assertEqual(m.view_nodes_at(10, 6), {
+ 'Match:'
+ ' match y:\n'
+ ' case 1:\n'
+ ' pass\n'
+ ' case _:\n'
+ ' pass',
+ })
+
def parse_snippet(self, text, node):
"""
Returns the parsed AST tree for the given text, handling issues with
indentation and newlines
@@ -814,6 +845,10 @@
else:
self.assertEqual(type(t1), type(t2))
+ if isinstance(t1, AstroidPosition):
+ # Ignore the lineno/col_offset etc. from astroid
+ return
+
if isinstance(t1, (list, tuple)):
self.assertEqual(len(t1), len(t2))
for vc1, vc2 in zip(t1, t2):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/asttokens-2.1.0/tox.ini new/asttokens-2.2.1/tox.ini
--- old/asttokens-2.1.0/tox.ini 2022-10-29 12:14:52.000000000 +0200
+++ new/asttokens-2.2.1/tox.ini 2022-12-05 11:33:06.000000000 +0100
@@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
-envlist = py{27,35,36,37,38,39,310,py,py3}
+envlist = py{27,35,36,37,38,39,310,311,py,py3}
[testenv]
commands = pytest {posargs}