From ae43cb204b174adca33ad38057a0d4e59ab81077 Mon Sep 17 00:00:00 2001 From: Erik Danielsson Date: Wed, 15 Jun 2022 16:45:07 +0200 Subject: [PATCH 1/2] Change cache dir from config dir --- CHANGELOG.md | 3 ++- nf_core/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 575d2986e2..1ef743c0b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Updated the package requirements to prevent defunct installations of nf-core [#1620](https://github.com/nf-core/tools/pull/1620) - Add `--fail-warned` flag to `nf-core lint` to make warnings fail [#1593](https://github.com/nf-core/tools/pull/1593) - Add `--fail-warned` flag to pipeline linting workflow [#1593](https://github.com/nf-core/tools/pull/1593) +- Use [`$XDG_CACHE_HOME`](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) or `~/.cache` instead of `$XDG_CONFIG_HOME` or `~/config/` as base directory for API cache ### Modules @@ -58,7 +59,7 @@ - Add a new command `nf-core modules test` which runs pytests locally. - Print include statement to terminal when `modules install` ([#1520](https://github.com/nf-core/tools/pull/1520)) - Allow follow links when generating `test.yml` file with `nf-core modules create-test-yml` ([1570](https://github.com/nf-core/tools/pull/1570)) -- Escaped test run output before logging it, to avoid a rich ` MarkupError` +- Escaped test run output before logging it, to avoid a rich `MarkupError` ### Linting diff --git a/nf_core/utils.py b/nf_core/utils.py index 4f4f38304a..ac7c11c492 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -50,8 +50,8 @@ ] ) -NFCORE_CONFIG_DIR = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.path.join(os.getenv("HOME"), ".config")), +NFCORE_CACHE_DIR = os.path.join( + os.environ.get("XDG_CACHE_HOME", os.path.join(os.getenv("HOME"), ".cache")), "nf-core", ) From 967a3230e7ced7a55a04dbea04c7af86783c245d Mon Sep 17 00:00:00 2001 From: Erik Danielsson Date: Wed, 15 Jun 2022 16:54:07 +0200 Subject: [PATCH 2/2] Fix mistake --- nf_core/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/utils.py b/nf_core/utils.py index ac7c11c492..fbfcae1b04 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -308,7 +308,7 @@ def setup_requests_cachedir(): Also returns the config dict so that we can use the same setup with a Session. """ pyversion = ".".join(str(v) for v in sys.version_info[0:3]) - cachedir = os.path.join(NFCORE_CONFIG_DIR, f"cache_{pyversion}") + cachedir = os.path.join(NFCORE_CACHE_DIR, f"cache_{pyversion}") config = { "cache_name": os.path.join(cachedir, "github_info"),