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
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
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
ea6b01b968
Use pathlib.Path instead of strings
2020-07-26 01:19:41 +02:00
Dave Halter
97c10facf7
Remove super arguments
2020-07-25 23:54:21 +02:00
Dave Halter
6eb6ac0bb2
Ignore Python 2 specific code in tests
2020-07-25 01:41:33 +02:00
Dave Halter
a0662b3b3b
flake8 changes
2020-07-24 16:11:06 +02:00
Dave Halter
736f616787
Remove FileNotFoundError and PermissionError from _compatibility.py
2020-07-24 01:24:59 +02:00
Dave Halter
58790c119e
Fix issues of #136
2020-06-19 20:20:00 +02:00
Dave Halter
3923ecf12f
Ignore permission errors when saving to cache
...
This might happen when a user doesn't have full access to his home directory.
Fixes davidhalter/jedi#1615
2020-06-19 12:06:46 +02:00
Batuhan Taskaya
fe24f0dc1b
Implement garbage collections for inactive cache files ( #121 )
...
Cache files that weren't accessed in the last 30 days will be automatically
garbage collected. This collection happens when the `save_module` is called
via a lock system that would make it happen only one time per day.
2020-06-02 12:36:05 +03:00
Dave Halter
2b0b093276
Make sure to limit the amount of cached files parso stores, fixes davidhalter/jedi#1340
2020-01-05 23:44:51 +01:00
Dave Halter
3e2956264c
Add FileIO to make it possible to cache e.g. files from zip files
2019-03-25 00:48:59 +01:00
Dave Halter
dafffdc9b4
The parser cache in RAM has now grammar versioning.
2017-05-26 12:48:59 -04:00
Dave Halter
8ae5fc60d6
Moved the grammar object out of the cache module.
2017-05-26 12:17:45 -04:00
Dave Halter
333046c253
load_python_grammar -> load_grammar.
2017-05-25 13:28:24 -04:00
Dave Halter
23d1470618
Add a more API focused grammar.
...
This makes it so we don't have to expose all the details of a pgen grammar to the user.
2017-05-21 17:02:15 -04:00
Dave Halter
88f8e172d5
Fixed a bug where providing a cache_path did not really affect anything.
2017-05-19 16:28:07 -04:00
Dave Halter
2d46d1e307
Add a parso test.
2017-05-19 16:17:10 -04:00