Drive cache
Proposed change
Drive by default caches directory entries and will only invalidate them if a new directory is fetched. This caching is happening in get_children().
Rework the cache to use a real TTL cache using the external cachetools. Drive-By: Remove upper limits of dependency versions for click and keychain. Fixes: #289 Fixes: #290
Type of change
- [x] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New service (thank you!)
- [x] New feature (which adds functionality to an existing service)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
- [ ] Documentation or code sample
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] There is no commented out code in this PR.
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated to README
Hmm. Looks like cachetools does not exist for Python <3.5... This means Py27 and Py34 are failing tests. Is this a problem or should we just drop support for those versions in master?
There's also a complain about me accessing _cache from outside the DriveService object... That is true, but I kinda feel it's acceptable to use the service-wide cache from the DriveNode object... But it is still a drive-internal cache which is why I'm prefixing it with an underscore. What's the best solution here? Just silence pylint using # pylint: disable=W0212? Or should the code be reworked?
Will remove support <3.6 or even <3.7
Coming to this PR just after this removal.
Needs #303