Commit Graph

1107 Commits

Author SHA1 Message Date
Peter Law
cf240c7d2b Update mypy to the latest which supports Python 3.6 2023-02-13 19:55:48 +00:00
Dave Halter
ffadfca81b Merge pull request #215 from PeterJCLaw/update-flake8
Update flake8
2023-02-13 19:50:21 +00:00
Peter Law
378e645bbc Update flake8 2023-02-13 19:42:33 +00:00
Dave Halter
df34112b5b Merge pull request #211 from jspricke/test_python3_10
Fix unit tests in Python 3.10 (Closes: #192)
2022-12-06 20:20:10 +00:00
Jochen Sprickerhof
e0a1caecc4 Drop pytest version restriction
Not compatible with Python >= 3.10:

https://github.com/pytest-dev/pytest/discussions/9195
2022-12-05 22:26:00 +01:00
Jochen Sprickerhof
7d43001f9d CI: update tested Python versions 2022-12-05 08:52:20 +01:00
Jochen Sprickerhof
cf5969d7a1 Fix unit tests in Python 3.10 (Closes: #192) 2022-12-05 08:52:19 +01:00
Dave Halter
6b6b59f6d7 Merge pull request #209 from hauntsaninja/implicit-optional
Explicitly allow implicit optionals
2022-09-28 17:49:01 +00:00
hauntsaninja
7af5259159 Explicitly allow implicit optionals
Keeps things working when you upgrade mypy versions.
The other way of solving this problem is in #208
2022-09-27 13:56:26 -07:00
Dave Halter
8ee84d005e Merge pull request #204 from ariebovenberg/fix-slots
Add missing slots to base classes
2022-02-15 00:25:40 +01:00
Arie Bovenberg
0740450899 add missing slots to base classes 2022-02-14 12:56:49 +01:00
Dave Halter
ee5edaf22f Prepare Release 0.8.3 v0.8.3 2021-11-30 22:03:35 +01:00
Dave Halter
285492f4ed Add a Python 3.12 grammar, because that is probably going to be needed in a year from now 2021-11-30 22:02:56 +01:00
Dave Halter
da3a7488f9 Merge pull request #199 from sobolevn/patch-1
Fixes `__slots__` definition in `NodeOrLeaf`
2021-09-15 22:32:18 +02:00
Nikita Sobolev
c5e8602cae Fixes __slots__ definition in NodeOrLeaf 2021-09-15 02:33:53 +03:00
Batuhan Taskaya
ae491cbf55 Merge pull request #195 from sturmianseq/fix
Removing state pollution in `parser_cache`
2021-08-25 12:13:45 +03:00
Dave Halter
9f32dde163 Jedi still has an import dependency on search_ancestor
The problem is basically that Python packaging usually is a bit fuzzy. That's
why I prefer to have this in there for quite some time to avoid conflicts of
version mismatches between Jedi/Parso.
2021-08-23 21:53:34 +02:00
sturmianseq
d26d0d57fe Applying try & finally blocks 2021-08-19 06:42:08 -07:00
sturmianseq
5570975a7d Removing state pollution in parser_cache 2021-08-18 20:16:46 -07:00
Dave Halter
e1523014e4 Merge pull request #194 from mgorny/python310
Update expected exception line numbers for Python 3.10.0rc1
2021-08-06 18:09:00 +02:00
Michał Górny
7652d3904b Update expected exception line numbers for Python 3.10.0rc1
It seems that upstream has fixed line numbers in some of the expections
in Python 3.10.0rc1, so update the tests accordingly.  This means that
test_non_async_in_async() gets the correct line again,
and test_default_except_error_postition() no longer suffers from
the apparent off-by-one problem.

This doesn't fix tests entirely with Python 3.10 but it's a step
forward.
2021-08-06 11:07:11 +02:00
Dave Halter
ed47650fbe Merge pull request #188 from davidhalter/line-ending
Fix line endings support at various locations
2021-05-30 09:37:32 +02:00
Saiyang Gou
60fed7b9f8 Fix flaky test_cache_last_used_update again (#189)
This is a follow up for #177. On Windows, `assert node_cache_item.last_used < now` may fail as the two time values can be equal.
2021-05-29 18:17:24 -07:00
gousaiyang
7000dd24d7 Fix line endings support at various locations 2021-05-29 17:56:50 -07:00
Saiyang Gou
86f3f1096b Add NodeOrLeaf.dump() and NodeOrLeaf.search_ancestor() (#187)
- Add `NodeOrLeaf.dump()` to generate a readable and "round-trippable" dump for a parser tree
- `parso.tree.search_ancestor()` is deprecated, use `NodeOrLeaf.search_ancestor()` instead
- Set up children's parent in `BaseNode.__init__()`
- Add test for `search_ancestor`
- Various small type annotations improvements
2021-05-29 12:40:07 -07:00
Dave Halter
f2b1ff9429 Add a grammar for Python 3.11 (just copied 3.10), so the core devs can work with it 2021-05-15 13:16:23 +02:00
Miro Hrončok
cbb61fb819 Relax a test regex to match new enum repr in Python 3.10.0a7+ (#186)
bpo-40066: Enum: adjust repr() to show only enum and member name (not value,
nor angle brackets) and str() to show only member name.
https://bugs.python.org/issue40066
2021-04-22 12:04:49 -07:00
Dave Halter
966d5446eb Merge pull request #185 from davidhalter/switch-to-github-actions
Travis CI -> GitHub Actions
2021-04-08 01:21:17 +02:00
gousaiyang
b42135fb1a Disable 3.10 build for now 2021-04-07 16:16:49 -07:00
gousaiyang
d76c890667 Try coveralls --service=github 2021-04-07 15:51:13 -07:00
gousaiyang
885f623c4b Still use the coveralls package 2021-04-07 13:25:05 -07:00
gousaiyang
b5429ccbdc Use Coveralls GitHub Action with GITHUB_TOKEN 2021-04-07 13:14:47 -07:00
gousaiyang
60ec880422 Travis CI -> GitHub Actions 2021-04-07 13:01:57 -07:00
Dave Halter
bd03b21446 Merge pull request #184 from davidhalter/remove-nocond-39
Unparenthesized lambda no longer allowed in comp_if since Python 3.9
2021-04-07 21:59:27 +02:00
gousaiyang
8dee324d0c Unparenthesized lambda no longer allowed in comp_if since Python 3.9 2021-04-06 18:43:01 -07:00
Dave Halter
5edab0407a Prepare release 0.8.2 v0.8.2 2021-03-30 22:42:57 +02:00
Dave Halter
c4f297a57a Merge pull request #176 from Terseus/bugfix/175-nonlocal-parameter
Prevent incorrect syntax error with nonlocal of a parameter
2021-03-09 00:50:03 +01:00
Dave Halter
5bba083af8 Merge pull request #177 from bobrik/ivan/fix-flaky-time
Fix flaky test_cache_last_used_update
2021-03-02 13:36:57 +01:00
Ivan Babrou
2799a7a3c2 Fix flaky test_cache_last_used_update
Sometimes time moves slowly and strict comparison is not enough:

```
>       assert now < node_cache_item.last_used < time.time()
E       assert 1614147958.869299 < 1614147958.869299
E        +  where 1614147958.869299 = <parso.cache._NodeCacheItem object at 0x10456fe80>.last_used
E        +  and   1614147958.869299 = <built-in function time>()
E        +    where <built-in function time> = time.time

test/test_cache.py:149: AssertionError
```

In particular, macOS timings can be a bit coarse.

The test failure is from Apple Silicon M1.
2021-02-23 22:27:08 -08:00
Dave Halter
fac5c089ff Merge pull request #173 from bryanforbes/fix-non-default-error
Only apply non-default params logic prior to the star (fixes #161)
2021-02-21 22:55:40 +01:00
Terseus
e5d6663721 Prevent incorrect syntax error with nonlocal of a parameter
Also includes a test for the error "name 'x' is assigned before nonlocal
declaration"

Fixes #175
2021-02-21 10:40:45 +01:00
Bryan Forbes
e5731d3932 Only apply non-default params logic prior to the star (fixes #161) 2021-02-15 19:33:44 -06:00
Dave Halter
93206f6eba Merge pull request #170 from pjvandehaar/master
Show path in warning message
2021-01-26 22:41:17 +01:00
Peter VandeHaar
cbe0b91d6a Show path in warning message 2021-01-26 15:00:00 -05:00
Dave Halter
771fe6bf33 Merge pull request #169 from PeterJCLaw/add-start-end-pos-types
Add type annotations to start- and end-pos attributes
2021-01-03 21:12:00 +01:00
Peter Law
1139e53429 Inline these type annotations
No need for comments for these since Python 3.5 isn't supported.
2021-01-03 17:55:16 +00:00
Peter Law
0e20c33c21 Add type annotations to start- and end-pos attributes
These are frequently used within consuming code, so having annotations
avoids others needing to work around mypy errors from them.
2021-01-03 15:57:53 +00:00
Dave Halter
14c88c1f4b Merge pull request #168 from pybpc/fix-delete-starred
Fix various issues regarding starred expressions
2021-01-01 22:06:06 +01:00
gousaiyang
257ac768fb Parenthesized single starred expression (*x) is no longer valid anywhere in Python 3.9+ 2020-12-30 17:14:39 -08:00
gousaiyang
79aeb2a801 Fix various issues regarding starred expressions
- Properly check for starred expression deletion
- Check for starred expressions not in tuple/list/set (when not in assignment)
- Fix a bug that considered starred expression assignment `[*x] = 1` as invalid
- Enhance test cases for valid and invalid `del` statements and starred expressions
2020-12-30 13:11:59 -08:00