SHA256
1
0
forked from pool/python-parso

48 Commits

Author SHA256 Message Date
1eeb38329a Accepting request 1191178 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1191178
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=22
2024-08-06 07:07:49 +00:00
7827e45116 Accepting request 1190186 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1190186
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=21
2024-07-30 09:53:46 +00:00
f14dc8454e Accepting request 1114884 from devel:languages:python
- Switch to pyproject macros.
- Also skip the recalcitrant test under Python 3.12.

OBS-URL: https://build.opensuse.org/request/show/1114884
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=20
2023-10-04 20:30:28 +00:00
b811d419fc - Switch to pyproject macros.
- Also skip the recalcitrant test under Python 3.12.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=44
2023-10-03 02:36:51 +00:00
05dfb00328 Accepting request 1081843 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1081843
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=19
2023-04-22 19:59:49 +00:00
d0e2c48e25 Accepting request 1081511 from home:dirkmueller:acdc:as_python3_module
SR for python stack proposal

OBS-URL: https://build.opensuse.org/request/show/1081511
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=42
2023-04-21 14:16:39 +00:00
eae7e9b7ea Accepting request 1056710 from devel:languages:python
- add cf5969d7a109798adbf9538d70e92138f077d700.patch to fix
  unit tests with Python 3.11/3.12

OBS-URL: https://build.opensuse.org/request/show/1056710
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=18
2023-01-07 16:17:40 +00:00
866c9df945 - add cf5969d7a109798adbf9538d70e92138f077d700.patch to fix
unit tests with Python 3.11/3.12

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=40
2023-01-06 21:46:01 +00:00
230f72341e Accepting request 940007 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/940007
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=17
2021-12-13 19:41:43 +00:00
0979806496 Accepting request 939578 from home:bnavigator:branches:devel:languages:python
- update to 0.8.3:
  * Add basic support for Python 3.11 and 3.12
- Skip tests failing in Python 3.10 gh#davidhalter/parso#192

OBS-URL: https://build.opensuse.org/request/show/939578
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=39
2021-12-11 23:45:24 +00:00
4843cb0436 Accepting request 897854 from devel:languages:python
- update to 0.8.2:
  - Various small bugfixes

OBS-URL: https://build.opensuse.org/request/show/897854
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=16
2021-06-11 20:30:20 +00:00
bee54fc2f0 - update to 0.8.2:
- Various small bugfixes

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=37
2021-06-06 12:43:13 +00:00
682866e36a Accepting request 878622 from devel:languages:python
- update to 0.8.1 (according to gh#davidhalter/jedi#1650 it
  should be compatible with python-jedi now):
  - Dropped Support for Python 2.7, 3.4, 3.5
  - It's possible to use ``pathlib.Path`` objects now in the API
  - The stubs are gone, we are now using annotations
  - ``namedexpr_test`` nodes are now a proper class called ``NamedExpr``
  - A lot of smaller refactorings

OBS-URL: https://build.opensuse.org/request/show/878622
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=15
2021-04-15 14:56:37 +00:00
943de90b9b Doesn't support Python 2 any more.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=35
2020-12-25 20:21:36 +00:00
2a35a5890d - update to 0.8.1 (according to gh#davidhalter/jedi#1650 it
should be compatible with python-jedi now):
  - Dropped Support for Python 2.7, 3.4, 3.5
  - It's possible to use ``pathlib.Path`` objects now in the API
  - The stubs are gone, we are now using annotations
  - ``namedexpr_test`` nodes are now a proper class called ``NamedExpr``
  - A lot of smaller refactorings

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=34
2020-12-25 19:02:58 +00:00
c439044a12 Accepting request 856988 from devel:languages:python
- update to 0.7.1:
  - Fixed a couple of smaller bugs (mostly syntax error detection in
  ``Grammar.iter_errors``)

- Revert back to the 0.7.0 version.

OBS-URL: https://build.opensuse.org/request/show/856988
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=14
2020-12-23 13:18:56 +00:00
b28850b43f - update to 0.7.1:
- Fixed a couple of smaller bugs (mostly syntax error detection in
  ``Grammar.iter_errors``)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=32
2020-12-19 13:18:06 +00:00
0e6b1979f9 - Revert back to the 0.7.0 version.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=31
2020-09-03 20:25:47 +00:00
0754ceca53 ok
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=30
2020-09-03 20:22:48 +00:00
a23ca3f4a3 - update to 0.8.0
* Dropped Support for Python 2.7, 3.4, 3.5
 * it’s possible to use pathlib.Path objects now in the API
 * The stubs are gone, we are now using annotations
 * namedexpr_test nodes are now a proper class called NamedExpr

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=29
2020-08-13 11:01:00 +00:00
2fc683f0e1 Accepting request 793806 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/793806
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=13
2020-04-15 17:53:35 +00:00
Tomáš Chvátal
f574b5cd3d Accepting request 793803 from home:bnavigator:branches:devel:languages:python
- update to 0.7.0
  * Fix a lot of annoying bugs in the diff parser. The fuzzer did not find
    issues anymore even after running it for more than 24 hours (500k tests).
  * Small grammar change: suites can now contain newlines even after a newline.
    This should really not matter if you don't use error recovery. It allows for
    nicer error recovery.
- remove py_38.patch (merged upstream)
 
From upstream's Jedí news thread [1]:

==Released parso 0.7.0. This is not a Jedi upgrade.==

This should be backwards compatible with the last few Jedi versions, so please just upgrade. The upgrade helps a lot with some situations where after working with some code completions would stop. This was completely not reproducible (or it was very hard to reproduce), so people never really reported it.

I fixed a lot of annoying bugs in the diff parser. The fuzzer finally and for the first time did not find issues anymore even after running it for more than 24 hours (500k tests).

[1] https://github.com/davidhalter/jedi/issues/1063#issuecomment-613080481

OBS-URL: https://build.opensuse.org/request/show/793803
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=27
2020-04-14 10:17:56 +00:00
c6ea8bda75 Accepting request 782049 from devel:languages:python
- 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

OBS-URL: https://build.opensuse.org/request/show/782049
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=12
2020-03-08 21:22:36 +00:00
78ac56a74f * add py_38.patch - fix tests with py-3.8.2
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=25
2020-03-06 09:24:08 +00:00
4ca0b938bd - update to 0.6.2
* Add Grammar.refactor (might still be subject to change until 0.7.0)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=24
2020-03-05 12:25:40 +00:00
6bd977ea64 Accepting request 769905 from devel:languages:python
- update to 0.6.1
 * Add parso.normalizer.Issue.end_pos to make it possible to know
    where an issue ends
 * Dropped Python 2.6/Python 3.3 support
 * del_stmt names are now considered as a definition (for name.is_definition())

OBS-URL: https://build.opensuse.org/request/show/769905
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=11
2020-02-06 12:19:20 +00:00
82a2746ca0 - update to 0.6.1
* Add parso.normalizer.Issue.end_pos to make it possible to know
    where an issue ends
 * Dropped Python 2.6/Python 3.3 support
 * del_stmt names are now considered as a definition (for name.is_definition())

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=22
2020-02-04 09:35:11 +00:00
a5c914c21b Accepting request 759718 from devel:languages:python
- update to 0.5.2
 * Add include_setitem to get_definition/is_definition and get_defined_names
 * Fix named expression error listing
 * Fix some f-string tokenizer issues

OBS-URL: https://build.opensuse.org/request/show/759718
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=10
2019-12-29 14:49:24 +00:00
ab264e39fc - update to 0.5.2
* Add include_setitem to get_definition/is_definition and get_defined_names
 * Fix named expression error listing
 * Fix some f-string tokenizer issues

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=20
2019-12-27 17:15:49 +00:00
2f2c3d441e Accepting request 715639 from devel:languages:python
- update to 0.5.1
 * Fix: Some unicode identifiers were not correctly tokenized
 * Fix: Line continuations in f-strings are now working

OBS-URL: https://build.opensuse.org/request/show/715639
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=9
2019-07-21 09:28:55 +00:00
e0e40d4c54 - update to 0.5.1
* Fix: Some unicode identifiers were not correctly tokenized
 * Fix: Line continuations in f-strings are now working

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=18
2019-07-16 10:38:15 +00:00
4ef27cff2d Accepting request 713046 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/713046
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=8
2019-07-08 12:59:34 +00:00
Tomáš Chvátal
294d032391 Accepting request 713021 from home:mcalabkova:branches:devel:languages:python
- update to 0.5.0
  * comp_for is now called sync_comp_for for all Python versions to 
    be compatible with the Python 3.8 Grammar
  * Added .pyi stubs for a lot of the parso API
  * Small FileIO changes

OBS-URL: https://build.opensuse.org/request/show/713021
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=16
2019-07-02 11:48:46 +00:00
14bb52313b Accepting request 695674 from devel:languages:python
- update to 0.4.0
 * Python 3.8 support
 * FileIO support, it's now possible to use abstract file IO, support is alpha

OBS-URL: https://build.opensuse.org/request/show/695674
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=7
2019-04-22 10:22:49 +00:00
7d2669e159 - update to 0.4.0
* Python 3.8 support
 * FileIO support, it's now possible to use abstract file IO, support is alpha

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=14
2019-04-18 12:43:24 +00:00
4e61afa554 Accepting request 674948 from devel:languages:python
- Update to 0.3.4:
  * Fix an f-string tokenizer error
  * Fix async errors in the diff parser
  * A fix in iter_errors
  * 20+ bugfixes in the diff parser and 3 in the tokenizer
  * A fuzzer for the diff parser, to give confidence that the diff parser is in a good shape.
  * Some bugfixes for f-string

- Drop bogus dependency on pytest-cache

OBS-URL: https://build.opensuse.org/request/show/674948
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=6
2019-02-26 21:14:20 +00:00
Tomáš Chvátal
abfea6d573 - Update to 0.3.4:
* Fix an f-string tokenizer error
  * Fix async errors in the diff parser
  * A fix in iter_errors
  * 20+ bugfixes in the diff parser and 3 in the tokenizer
  * A fuzzer for the diff parser, to give confidence that the diff parser is in a good shape.
  * Some bugfixes for f-string

- Drop bogus dependency on pytest-cache

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=12
2019-02-14 12:11:24 +00:00
de53e4e414 Accepting request 659537 from devel:languages:python
Remove superfluous devel dependency for noarch package

OBS-URL: https://build.opensuse.org/request/show/659537
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=5
2018-12-24 10:40:50 +00:00
b8174e040c Remove superfluous devel dependency for noarch package
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=10
2018-12-04 13:45:05 +00:00
2033bc2880 Accepting request 625057 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/625057
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=4
2018-07-31 13:57:38 +00:00
Tomáš Chvátal
b0e3c4b532 - Drop dependency on tox, not really needed
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=8
2018-07-17 13:15:56 +00:00
28af233cc3 Accepting request 622330 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/622330
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=3
2018-07-13 08:22:18 +00:00
Tomáš Chvátal
8b6faeccb3 Accepting request 622325 from home:apersaud:branches:devel:languages:python
update to latest version

OBS-URL: https://build.opensuse.org/request/show/622325
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=6
2018-07-12 17:18:04 +00:00
fbdbea531e Accepting request 597314 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/597314
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=2
2018-04-19 13:29:27 +00:00
Tomáš Chvátal
48f6a4c268 Accepting request 597253 from home:apersaud:branches:devel:languages:python
update to latest version

OBS-URL: https://build.opensuse.org/request/show/597253
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=4
2018-04-17 06:36:07 +00:00
9851343ad5 Accepting request 540491 from devel:languages:python
- update to version 0.1.1:
  * Fixed a few bugs in the caching layer
  * Added support for Python 3.7
- intial version 0.1.0

OBS-URL: https://build.opensuse.org/request/show/540491
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-parso?expand=0&rev=1
2017-11-15 15:56:09 +00:00
17dd21819f Accepting request 540105 from home:apersaud:branches:devel:languages:python
update to latest version

OBS-URL: https://build.opensuse.org/request/show/540105
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=2
2017-11-10 11:52:27 +00:00
84f76efe73 Accepting request 528857 from home:apersaud:branches:devel:languages:python
new package, needed for latest release of python-jedi

OBS-URL: https://build.opensuse.org/request/show/528857
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parso?expand=0&rev=1
2017-09-27 05:51:49 +00:00
2 changed files with 0 additions and 184 deletions

View File

@@ -1,181 +0,0 @@
From cf5969d7a109798adbf9538d70e92138f077d700 Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Sun, 4 Dec 2022 13:29:25 +0100
Subject: [PATCH] Fix unit tests in Python 3.10 (Closes: #192)
---
parso/python/errors.py | 51 ++++++++++++++++++++++++++++++--------
test/test_python_errors.py | 23 +++++++++++++++++
2 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/parso/python/errors.py b/parso/python/errors.py
index 5da046a..09c5047 100644
--- a/parso/python/errors.py
+++ b/parso/python/errors.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import codecs
+import sys
import warnings
import re
from contextlib import contextmanager
@@ -33,7 +34,10 @@ def _get_rhs_name(node, version):
return "literal"
else:
if second.children[1] == ":" or second.children[0] == "**":
- return "dict display"
+ if version < (3, 10):
+ return "dict display"
+ else:
+ return "dict literal"
else:
return "set display"
elif (
@@ -47,7 +51,10 @@ def _get_rhs_name(node, version):
elif first == "[":
return "list"
elif first == "{" and second == "}":
- return "dict display"
+ if version < (3, 10):
+ return "dict display"
+ else:
+ return "dict literal"
elif first == "{" and len(node.children) > 2:
return "set display"
elif type_ == "keyword":
@@ -58,7 +65,10 @@ def _get_rhs_name(node, version):
else:
return str(node.value)
elif type_ == "operator" and node.value == "...":
- return "Ellipsis"
+ if version < (3, 10):
+ return "Ellipsis"
+ else:
+ return "ellipsis"
elif type_ == "comparison":
return "comparison"
elif type_ in ("string", "number", "strings"):
@@ -83,7 +93,10 @@ def _get_rhs_name(node, version):
or "_test" in type_
or type_ in ("term", "factor")
):
- return "operator"
+ if version < (3, 10):
+ return "operator"
+ else:
+ return "expression"
elif type_ == "star_expr":
return "starred"
elif type_ == "testlist_star_expr":
@@ -610,7 +623,10 @@ def is_issue(self, leaf):
@ErrorFinder.register_rule(type='string')
class _StringChecks(SyntaxRule):
- message = "bytes can only contain ASCII literal characters."
+ if sys.version_info < (3, 10):
+ message = "bytes can only contain ASCII literal characters."
+ else:
+ message = "bytes can only contain ASCII literal characters"
def is_issue(self, leaf):
string_prefix = leaf.string_prefix.lower()
@@ -1043,14 +1059,20 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False, is_aug_
error = 'literal'
else:
if second.children[1] == ':':
- error = 'dict display'
+ if self._normalizer.version < (3, 10):
+ error = 'dict display'
+ else:
+ error = 'dict literal'
else:
error = 'set display'
elif first == "{" and second == "}":
if self._normalizer.version < (3, 8):
error = 'literal'
else:
- error = "dict display"
+ if self._normalizer.version < (3, 10):
+ error = "dict display"
+ else:
+ error = "dict literal"
elif first == "{" and len(node.children) > 2:
if self._normalizer.version < (3, 8):
error = 'literal'
@@ -1083,7 +1105,10 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False, is_aug_
error = str(node.value)
elif type_ == 'operator':
if node.value == '...':
- error = 'Ellipsis'
+ if self._normalizer.version < (3, 10):
+ error = 'Ellipsis'
+ else:
+ error = 'ellipsis'
elif type_ == 'comparison':
error = 'comparison'
elif type_ in ('string', 'number', 'strings'):
@@ -1098,7 +1123,10 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False, is_aug_
if node.children[0] == 'await':
error = 'await expression'
elif node.children[-2] == '**':
- error = 'operator'
+ if self._normalizer.version < (3, 10):
+ error = 'operator'
+ else:
+ error = 'expression'
else:
# Has a trailer
trailer = node.children[-1]
@@ -1120,7 +1148,10 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False, is_aug_
elif ('expr' in type_ and type_ != 'star_expr' # is a substring
or '_test' in type_
or type_ in ('term', 'factor')):
- error = 'operator'
+ if self._normalizer.version < (3, 10):
+ error = 'operator'
+ else:
+ error = 'expression'
elif type_ == "star_expr":
if is_deletion:
if self._normalizer.version >= (3, 9):
diff --git a/test/test_python_errors.py b/test/test_python_errors.py
index adf5f06..9686d14 100644
--- a/test/test_python_errors.py
+++ b/test/test_python_errors.py
@@ -1,6 +1,7 @@
"""
Testing if parso finds syntax errors and indentation errors.
"""
+import re
import sys
import warnings
@@ -136,6 +137,28 @@ def _get_actual_exception(code):
wanted = 'SyntaxError: invalid syntax'
elif wanted == "SyntaxError: f-string: single '}' is not allowed":
wanted = 'SyntaxError: invalid syntax'
+ elif "Maybe you meant '==' instead of '='?" in wanted:
+ wanted = wanted.removesuffix(" here. Maybe you meant '==' instead of '='?")
+ elif re.match(
+ r"SyntaxError: unterminated string literal \(detected at line \d+\)", wanted
+ ):
+ wanted = "SyntaxError: EOL while scanning string literal"
+ elif re.match(
+ r"SyntaxError: unterminated triple-quoted string literal \(detected at line \d+\)",
+ wanted,
+ ):
+ wanted = 'SyntaxError: EOF while scanning triple-quoted string literal'
+ elif wanted == 'SyntaxError: cannot use starred expression here':
+ wanted = "SyntaxError: can't use starred expression here"
+ elif wanted == 'SyntaxError: f-string: cannot use starred expression here':
+ wanted = "SyntaxError: f-string: can't use starred expression here"
+ elif re.match(
+ r"IndentationError: expected an indented block after '[^']*' statement on line \d",
+ wanted,
+ ):
+ wanted = 'IndentationError: expected an indented block'
+ elif wanted == 'SyntaxError: unterminated string literal':
+ wanted = 'SyntaxError: EOL while scanning string literal'
return [wanted], line_nr

Binary file not shown.