Idea #21020
Updated by Brett Smith 3 months ago
We should support "XDG Base Directory environment variables":https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html throughout the Python SDK. Things like @XDG_CONFIG_PATH@ and @XDG_CACHE_HOME@. Note that this includes validations like ensuring the paths are absolute. There are probably packages on PyPI that can help us with this.
Known specific instances:
* @arvados.config.initialize@ should default to @config_file=None@. When the value is @None@, the function should search @XDG_CONFIG_PATH@ to find @arvados/settings.conf@.
* @arvados.api.http_cache@ should create and write to to @$XDG_CACHE_HOME/arvados/SUBDIR@.
* <pre>$ git grep -Fe .cache -e .config --line-number sdk/python/ sdk/cwl/ services/fuse/ services/dockercleaner/ tools/user-activity/ tools/crunchstat-summary/
sdk/python/arvados/commands/keepdocker.py:186: os.path.join('.cache', 'arvados', 'docker'), 0o700)
sdk/python/arvados/commands/put.py:354: CACHE_DIR = '.cache/arvados/arv-put'
sdk/python/arvados/commands/put.py:436: CACHE_DIR = '.cache/arvados/arv-put'
sdk/python/arvados/keep.py:179: self._disk_cache_dir = os.path.join(os.path.expanduser("~"), ".cache", "arvados", "keep")
sdk/python/tests/arvados_testutil.py:285: disk_cache_dir = os.path.join(os.path.expanduser("~"), ".cache", "arvados", "keep")
services/fuse/arvados_fuse/command.py:308: help="Filesystem cache location (default `~/.cache/arvados/keep`)",
services/fuse/tests/mount_test_base.py:31: disk_cache_dir = os.path.join(os.path.expanduser("~"), ".cache", "arvados", "keep")
</pre>