Hello community,

here is the log from the commit of package python-parso for openSUSE:Factory 
checked in at 2020-03-08 22:22:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-parso (Old)
 and      /work/SRC/openSUSE:Factory/.python-parso.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-parso"

Sun Mar  8 22:22:36 2020 rev:12 rq:782049 version:0.6.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-parso/python-parso.changes        
2020-02-06 13:19:20.892675857 +0100
+++ /work/SRC/openSUSE:Factory/.python-parso.new.26092/python-parso.changes     
2020-03-08 22:22:43.196024984 +0100
@@ -1,0 +2,7 @@
+Thu Mar  5 12:25:09 UTC 2020 - Ondřej Súkup <mimi...@gmail.com>
+
+- update to 0.6.2
+ * Add Grammar.refactor (might still be subject to change until 0.7.0) 
+ * add py_38.patch - fix tests with py-3.8.2
+
+-------------------------------------------------------------------

Old:
----
  parso-0.6.1.tar.gz

New:
----
  parso-0.6.2.tar.gz
  py_38.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-parso.spec ++++++
--- /var/tmp/diff_new_pack.DYidd8/_old  2020-03-08 22:22:44.016025490 +0100
+++ /var/tmp/diff_new_pack.DYidd8/_new  2020-03-08 22:22:44.020025492 +0100
@@ -18,13 +18,13 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-parso
-Version:        0.6.1
+Version:        0.6.2
 Release:        0
 Summary:        An autocompletion tool for Python
 License:        MIT AND Python-2.0
-Group:          Development/Languages/Python
 URL:            https://github.com/davidhalter/parso
 Source0:        
https://files.pythonhosted.org/packages/source/p/parso/parso-%{version}.tar.gz
+Patch0:         py_38.patch
 BuildRequires:  %{python_module pytest >= 3.0.7}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
@@ -46,6 +46,7 @@
 
 %prep
 %setup -q -n parso-%{version}
+%patch0 -p1
 
 %build
 %python_build

++++++ parso-0.6.1.tar.gz -> parso-0.6.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/CHANGELOG.rst 
new/parso-0.6.2/CHANGELOG.rst
--- old/parso-0.6.1/CHANGELOG.rst       2020-02-03 21:46:42.000000000 +0100
+++ new/parso-0.6.2/CHANGELOG.rst       2020-02-27 02:10:52.000000000 +0100
@@ -3,6 +3,12 @@
 Changelog
 ---------
 
+0.6.2 (2020-02-27)
+++++++++++++++++++
+
+- Bugfixes
+- Add Grammar.refactor (might still be subject to change until 0.7.0)
+
 0.6.1 (2020-02-03)
 ++++++++++++++++++
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/PKG-INFO new/parso-0.6.2/PKG-INFO
--- old/parso-0.6.1/PKG-INFO    2020-02-03 22:05:10.000000000 +0100
+++ new/parso-0.6.2/PKG-INFO    2020-02-27 02:13:56.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: parso
-Version: 0.6.1
+Version: 0.6.2
 Summary: A Python Parser
 Home-page: https://github.com/davidhalter/parso
 Author: David Halter
@@ -106,6 +106,12 @@
         Changelog
         ---------
         
+        0.6.2 (2020-02-27)
+        ++++++++++++++++++
+        
+        - Bugfixes
+        - Add Grammar.refactor (might still be subject to change until 0.7.0)
+        
         0.6.1 (2020-02-03)
         ++++++++++++++++++
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/parso/__init__.py 
new/parso-0.6.2/parso/__init__.py
--- old/parso-0.6.1/parso/__init__.py   2020-02-03 21:46:42.000000000 +0100
+++ new/parso-0.6.2/parso/__init__.py   2020-02-27 02:10:52.000000000 +0100
@@ -43,7 +43,7 @@
 from parso.utils import split_lines, python_bytes_to_unicode
 
 
-__version__ = '0.6.1'
+__version__ = '0.6.2'
 
 
 def parse(code=None, **kwargs):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/parso/grammar.py 
new/parso-0.6.2/parso/grammar.py
--- old/parso-0.6.1/parso/grammar.py    2020-02-03 21:46:42.000000000 +0100
+++ new/parso-0.6.2/parso/grammar.py    2020-02-27 02:10:52.000000000 +0100
@@ -13,6 +13,7 @@
 from parso.python.errors import ErrorFinderConfig
 from parso.python import pep8
 from parso.file_io import FileIO, KnownContentFileIO
+from parso.normalizer import RefactoringNormalizer
 
 _loaded_grammars = {}
 
@@ -170,6 +171,9 @@
 
         return self._get_normalizer_issues(node, self._error_normalizer_config)
 
+    def refactor(self, base_node, node_to_str_map):
+        return RefactoringNormalizer(node_to_str_map).walk(base_node)
+
     def _get_normalizer(self, normalizer_config):
         if normalizer_config is None:
             normalizer_config = self._default_normalizer_config
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/parso/normalizer.py 
new/parso-0.6.2/parso/normalizer.py
--- old/parso-0.6.1/parso/normalizer.py 2020-02-03 21:46:42.000000000 +0100
+++ new/parso-0.6.2/parso/normalizer.py 2020-02-27 02:10:52.000000000 +0100
@@ -12,6 +12,9 @@
 
 
 class Normalizer(use_metaclass(_NormalizerMeta)):
+    _rule_type_instances = {}
+    _rule_value_instances = {}
+
     def __init__(self, grammar, config):
         self.grammar = grammar
         self._config = config
@@ -181,3 +184,20 @@
         if self.is_issue(node):
             issue_node = self.get_node(node)
             self.add_issue(issue_node)
+
+
+class RefactoringNormalizer(Normalizer):
+    def __init__(self, node_to_str_map):
+        self._node_to_str_map = node_to_str_map
+
+    def visit(self, node):
+        try:
+            return self._node_to_str_map[node]
+        except KeyError:
+            return super(RefactoringNormalizer, self).visit(node)
+
+    def visit_leaf(self, leaf):
+        try:
+            return self._node_to_str_map[leaf]
+        except KeyError:
+            return super(RefactoringNormalizer, self).visit_leaf(leaf)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/parso/python/tree.py 
new/parso-0.6.2/parso/python/tree.py
--- old/parso-0.6.1/parso/python/tree.py        2020-02-03 21:46:42.000000000 
+0100
+++ new/parso-0.6.2/parso/python/tree.py        2020-02-27 02:10:52.000000000 
+0100
@@ -1081,7 +1081,13 @@
 
     def get_rhs(self):
         """Returns the right-hand-side of the equals."""
-        return self.children[-1]
+        node = self.children[-1]
+        if node.type == 'annassign':
+            if len(node.children) == 4:
+                node = node.children[3]
+            else:
+                node = node.children[1]
+        return node
 
     def yield_operators(self):
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/parso/tree.py 
new/parso-0.6.2/parso/tree.py
--- old/parso-0.6.1/parso/tree.py       2020-02-03 21:46:42.000000000 +0100
+++ new/parso-0.6.2/parso/tree.py       2020-02-27 02:10:52.000000000 +0100
@@ -45,8 +45,12 @@
         Returns the node immediately following this node in this parent's
         children list. If this node does not have a next sibling, it is None
         """
+        parent = self.parent
+        if parent is None:
+            return None
+
         # Can't use index(); we need to test by identity
-        for i, child in enumerate(self.parent.children):
+        for i, child in enumerate(parent.children):
             if child is self:
                 try:
                     return self.parent.children[i + 1]
@@ -59,8 +63,12 @@
         children list. If this node does not have a previous sibling, it is
         None.
         """
+        parent = self.parent
+        if parent is None:
+            return None
+
         # Can't use index(); we need to test by identity
-        for i, child in enumerate(self.parent.children):
+        for i, child in enumerate(parent.children):
             if child is self:
                 if i == 0:
                     return None
@@ -71,6 +79,9 @@
         Returns the previous leaf in the parser tree.
         Returns `None` if this is the first element in the parser tree.
         """
+        if self.parent is None:
+            return None
+
         node = self
         while True:
             c = node.parent.children
@@ -94,6 +105,9 @@
         Returns the next leaf in the parser tree.
         Returns None if this is the last element in the parser tree.
         """
+        if self.parent is None:
+            return None
+
         node = self
         while True:
             c = node.parent.children
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parso-0.6.1/parso.egg-info/PKG-INFO 
new/parso-0.6.2/parso.egg-info/PKG-INFO
--- old/parso-0.6.1/parso.egg-info/PKG-INFO     2020-02-03 22:05:10.000000000 
+0100
+++ new/parso-0.6.2/parso.egg-info/PKG-INFO     2020-02-27 02:13:55.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: parso
-Version: 0.6.1
+Version: 0.6.2
 Summary: A Python Parser
 Home-page: https://github.com/davidhalter/parso
 Author: David Halter
@@ -106,6 +106,12 @@
         Changelog
         ---------
         
+        0.6.2 (2020-02-27)
+        ++++++++++++++++++
+        
+        - Bugfixes
+        - Add Grammar.refactor (might still be subject to change until 0.7.0)
+        
         0.6.1 (2020-02-03)
         ++++++++++++++++++
         

++++++ py_38.patch ++++++
>From 0234a70e95199d4b9bb257d9ea7a5fcb8baa8c91 Mon Sep 17 00:00:00 2001
From: Dave Halter <davidhalte...@gmail.com>
Date: Fri, 28 Feb 2020 00:31:50 +0100
Subject: [PATCH] Python 3.8.2 was released and an error message changed, fixes
 #103

---
 parso/python/errors.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/parso/python/errors.py b/parso/python/errors.py
index a6f3ae9..eba4181 100644
--- a/parso/python/errors.py
+++ b/parso/python/errors.py
@@ -976,9 +976,7 @@ def _check_assignment(self, node, is_deletion=False, 
is_namedexpr=False):
 
         if error is not None:
             if is_namedexpr:
-                # c.f. CPython bpo-39176, should be changed in next release
-                # message = 'cannot use assignment expressions with %s' % error
-                message = 'cannot use named assignment with %s' % error
+                message = 'cannot use assignment expressions with %s' % error
             else:
                 cannot = "can't" if self._normalizer.version < (3, 8) else 
"cannot"
                 message = ' '.join([cannot, "delete" if is_deletion else 
"assign to", error])

Reply via email to