Commit Graph

29 Commits

Author SHA1 Message Date
Dave Halter
a0662b3b3b flake8 changes 2020-07-24 16:11:06 +02:00
Dave Halter
7780cc1c1b Get rid of some Python 2 idiosyncrasies 2020-07-24 02:09:04 +02:00
Dave Halter
a2fc850dc9 Remove scandir compatibility 2020-07-24 01:28:40 +02:00
Dave Halter
736f616787 Remove FileNotFoundError and PermissionError from _compatibility.py 2020-07-24 01:24:59 +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
15403fd998 Use a Windows cache folder change from Jedi
See also 1115cbd94dcae6fb7b215c51f0407333c92c956e in Jedi and the PR in davidhalter/jedi#1575
2020-05-10 11:50:00 +02:00
Dave Halter
9abe5d1e55 Forgot to increase the pickle version 2020-01-20 01:28:06 +01:00
Dave Halter
9ee7409d8a Get rid of Python 3.3 artifacts 2020-01-05 23:59:38 +01: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
1929c144dc Increate the _PICKLE_VERSION to avoid issues with the latest breaking change 2019-06-09 18:11:21 +02:00
Dave Halter
de416b082e Make it clear that get_last_modified should not raise an exception, but return None, if it cannot look up a file 2019-05-22 00:16:26 +02:00
Dave Halter
d5eb96309c Increase the pickle version. With all the changes lately, it's better this way 2019-04-03 01:07:25 +02: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
e77a67cd36 PEP 8 2019-03-22 20:17:59 +01:00
Mike Morearty
bc8566e964 Use cPickle instead of pickle
Change Parso to use cPickle instead of pickle when reading/writing the
cache, which speeds up the cache significantly.

In Python 2, cPickle is up to 1000 times faster than pickle. (In Python
3, if you "import pickle", you are actually getting cPickle.)

As is the convention, the code tries to import cPickle, and if that
fails, it falls back to pickle.

This has a big impact for users of jedi-vim, since in many cases Vim
uses Python 2.
2017-10-24 01:10:32 +02:00
Mike Morearty
89932c368d Fix the cache path
Any caller of Parso can specify a cache path, and if none is specified,
parso will fall back to a default.

Parso's code to read a file from the cache handled this correctly; but
its code to write a file to the cache had a bug -- any override of the
default was ignored.

In the case of Jedi, this is a significant problem, since Jedi overrides
the default. The result is that files will be written to the cache, but
will then never be found when reading from the cache.
2017-10-24 01:08:57 +02:00
Dave Halter
1f6683b8ac Don't use the root logger
The root logger should not be used in parso. Use custom loggers for each module. Fixes #9.
2017-10-12 22:59:17 +02:00
Siddhartha Gandhi
72608704d8 Change Windows default cache directory to local (#1)
Change Windows default cache directory to local

From an issue that called for:
The default jedi cache directory is the roaming folder. In my company, we have restrictions on the file size of the Roaming folder (since I believe these settings are synced across computers). The jedi cache really isn't a fundamental user setting that needs to be synced across devices, so it really should be in the local app data folder. So I propose here that the default windows path use the environment variable %LocalAppData% instead.
2017-06-06 07:58:29 +02:00
Dave Halter
dafffdc9b4 The parser cache in RAM has now grammar versioning. 2017-05-26 12:48:59 -04:00
Dave Halter
f997b91a12 Remove a function that was never used. 2017-05-26 12:23:30 -04:00
Dave Halter
8ae5fc60d6 Moved the grammar object out of the cache module. 2017-05-26 12:17:45 -04:00
Dave Halter
3a0cd6d377 Make sha256 private to avoid confusion for the end user. 2017-05-21 17:35:47 -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
Dave Halter
be782a0141 Trying to make the cache path configurable as a parameter. 2017-05-15 11:12:28 -04:00
Dave Halter
fb05fb4c19 Get rid of most jedi usages. 2017-05-14 13:51:04 -04:00
Dave Halter
efac51c1b1 Use the _compatibility file in parso. 2017-05-11 16:30:38 -04:00
Dave Halter
150fb4c86e Add an initial version of the code from Jedi.
Still includes imports that have to be removed.
2017-05-11 07:13:23 -04:00