rOpenGov / eurostat

R tools for Eurostat data
http://ropengov.github.io/eurostat
Other
235 stars 46 forks source link

Update cache management #228

Closed dieghernan closed 3 years ago

dieghernan commented 3 years ago

Closes #223

See here an implementation of the new cache management. There is a suite of functions that detects the current cache dir (either set up via parameter, via options(eurostat_cache_dir or installed in the machine) and manages the download.

A similar suite is implemented in two of my packages, already on CRAN: https://github.com/rOpenGov/giscoR and https://github.com/rOpenSpain/mapSpain

The current approach only writes on the temporary directory unless the user set a cache dir. Also, for storing the persistent cache dir with rappdirs the user needs to explicitly install the cache dir path with install = TRUE.

I updated also some links, the cache parts on the functions that uses it and the clean_eurostat_cache function.

There is also a whole test suite for that. Note that the test suite also switches temporarly the cache dir to run the tests on a temporary dir, so no files are downloaded or removed on the local machine.

By last, I updated the GH check action to cache dependencies also for Windows (would reduce significantly the running time) and for showing the tests output.

pitkant commented 3 years ago

Seems good. Some notes:

dieghernan commented 3 years ago

Hi! I’ll tackle your comments and I would let you know, thanks both

dieghernan commented 3 years ago

It’s done now, moving to testthat 3 made me change some tests due to deprecations (a bit of pain).

I’ll leave it to you if finally you decided to merge @antagomir @pitkant

antagomir commented 3 years ago

Ok to me, how about @pitkant