This PR modifies get_file so that it caches remote files in the fv3config cache directory. Presently this is done with all files, and there isn't an API to disable it. Adding such an API would be fairly easy, but we'd need to come up with the design (easiest would be some kind of cache_downloads(True/False) routine).
Other small changes:
functions in derive that pertained to filenames for options have been moved to _datastore.py alongside the routines that retrieve directories for options. This was necessary to avoid circular imports.
functions for getting/setting the cache directory have been moved to their own module. This was necessary to avoid circular imports.
anchor versions for black and flake8 in the circleci config and requirements_dev.txt
Ignore a flake8 style convention that black and flake8 disagree on (whitespace before ":")
Tests have been added to check the location chosen to cache a file. The caching itself is untested because it requires remote url access, and might not be necessary because the function itself is quite simple (three lines).
This PR modifies
get_file
so that it caches remote files in the fv3config cache directory. Presently this is done with all files, and there isn't an API to disable it. Adding such an API would be fairly easy, but we'd need to come up with the design (easiest would be some kind ofcache_downloads(True/False)
routine).Other small changes:
derive
that pertained to filenames for options have been moved to_datastore.py
alongside the routines that retrieve directories for options. This was necessary to avoid circular imports.Tests have been added to check the location chosen to cache a file. The caching itself is untested because it requires remote url access, and might not be necessary because the function itself is quite simple (three lines).